lcodeca / rllibsumoutils

Python3 library able to connect the RLLIB framework with the SUMO simulator.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

random seed

zzchuman opened this issue · comments

Hello, @lcodeca I want use rllib and sumo to control the traffic signal. And I want to make the experiment results reproducible.
So, I want to find all the random seed.

  1. numpy pandas
  2. tensorflow , torch
  3. rllib config
  4. sumo cmd

The above are all the random number seeds I found. Can U give me some advice?

Hi,
I set the seeds through the config files for rllib and sumo.
I do the same in my environments using https://numpy.org/doc/stable/reference/random/legacy.html#numpy.random.RandomState

Regards,
Lara

Hello Lara, I set the random seed as:
torch.manual_seed(42)
np.random.seed(65)

trainer = DQNTrainer(env="single", config={
"gamma": 0.99,
"seed": 42,
"framework": "torch",
})

    sumo_cmd = [self._sumo_binary,
                '-n', self._net,
                '-r', self._route,
                '--seed', 56]

And you use another random seed setting. from numpy.random import RandomState

Can you give some advice about torch rllib sumo?

I can't, cause I never used Torch.
What I can tell you, it's that I don't use np.random.seed(65) but I use RandomState. And I use it in my custom-made MARL environment. For the rest, I'm not sure what you are asking for.