You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to apply my flax model using modified parameters new_params. I generated new_params by manually doing some operations on the original parameters (state.params) using jax.tree.map. However, when I apply my model with new_params, the output type differs from the one I get when using the original state.params.
With state.params, I receive a JAX Array as the output. However, when using new_params directly (without involving the state), the output is a BatchTracer instead.
Basically what I want is doing a forward pass without updating the parameters of my network.
Could anyone explain why this is happening and how I can ensure consistent output types because I need JAX Array as the output and I do not want to update the state ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello,
I am trying to apply my flax model using modified parameters
new_params
. I generatednew_params
by manually doing some operations on the original parameters (state.params
) usingjax.tree.map
. However, when I apply my model withnew_params
, the output type differs from the one I get when using the originalstate.params
.With
state.params
, I receive a JAXArray
as the output. However, when usingnew_params
directly (without involving the state), the output is aBatchTracer
instead.Basically what I want is doing a forward pass without updating the parameters of my network.
My function for that looks like that:
Could anyone explain why this is happening and how I can ensure consistent output types because I need JAX Array as the output and I do not want to update the state ?
Thanks!
Beta Was this translation helpful? Give feedback.
All reactions