Add RNG support to ProbabilisticActor #3701
Closed
valterschutz
started this conversation in
Ideas
Replies: 2 comments 2 replies
-
|
In case anyone else has the same problem, I managed to solve this temporarily by using the following hack: with torch.random.fork_rng():
seed = int(
torch.randint(0, 2**32 - 1, (1,), generator=rng).item()
)
torch.manual_seed(seed)
# Seedable behavior |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
Thanks for this suggestion |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm studying a problem where a "meta environment" consists of an agent (base agent) and an environment (base environment). I want to make this meta environment deterministic given a seed, without setting a global RNG state. I already know how to make the base environment deterministic (use a
torch.Generatorfor custom step/reset logic), but I don't know how to make the base agent's policy deterministic.From what I understand, the randomness of the base agent's actions comes from
ProbabilisticActor, but there does not seem to be a way to pass an RNG.See the example "Separating the random seed for the agent and environment." from Empirical Design in Reinforcement Learning for additional motivation behind this.
Beta Was this translation helpful? Give feedback.
All reactions