Skip to content

Factor reshape to function #22

Description

@krzysztofrusek

observations = history.observations[-1, ...]
n_steps, _, window_size, _ = observations.shape
key = jax.random.key(42)
qvals = compute_qvals(
params, state, observations, key
) # [n_agents, n_steps, n_actions]
# Build flat feature matrix: [n_agents * n_steps, window_size * n_features]
# transpose [n_steps, n_agents, w, f] -> [n_agents, n_steps, w, f] then flatten last two dims
XX = np.asarray(observations).transpose(1, 0, 2, 3).reshape(n_agents * n_steps, -1)

Metadata

Metadata

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions