Skip to content

NA #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

NA #17

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion disentangled_rnns/library/rnn_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,9 @@ def unroll_network(xs):
apply = jax.jit(model.apply)
y_hats, states = apply(params, key, xs)

states = np.squeeze(np.array(states))
if isinstance(states, tuple) or isinstance(states, list) and len(states) == 1:
states = np.array(states[0])

# States should now be (n_timesteps, n_episodes, n_hidden)
assert states.shape[0] == xs.shape[0], (
'States and inputs should have the same number of timesteps.')
Expand Down
Loading