Skip to content

[Bug] Wrong seed handling in DQN agent #35

@PabloHendriks

Description

@PabloHendriks

Hi,

I was using the DQN implementation and noticed a bug with the seed handling.

rng = jax.random.PRNGKey(0)  # use a dummy rng here
 _action = basic_env.action_space().sample(rng)
_, _env_state = env.reset(rng, env_params)
_obs, _, _reward, _done, _ = env.step(rng, _env_state, _action, env_params)
_timestep = TimeStep(obs=_obs, action=_action, reward=_reward, done=_done)
buffer_state = buffer.init(_timestep)

This block of code (lines 81-86) used to initialise the environment overwrites the specified seed.

I have only worked with the DQN algorithm, so I do not know if the same issue applies to other agents.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions