ElegantRL icon indicating copy to clipboard operation
ElegantRL copied to clipboard

请问Multiworkers支持怎么开启?

Open Thisisaname1125 opened this issue 2 years ago • 1 comments

在知乎上看到可以开启multiworkers进行探索,但是不知道在哪里可以开启这个功能?

Thisisaname1125 avatar Mar 14 '23 08:03 Thisisaname1125

https://github.com/AI4Finance-Foundation/ElegantRL/blob/594b0c31de443a24c1032b75418fdc134664e92f/examples/demo_A2C_PPO.py#L39-L44

Set args.num_worker in the code to a value greater than 1, and enable multi-processing by setting if_single_process = False. This will enable multiple workers.

将代码中的 args.num_worker=4 设置为大于1 的数值,并且开启多进程 if_single_process = False ,multi-workers 就会开启


You can see the code for the multiple workers that are enabled in train/run.py.

开启的多个workers 的代码 可以看 train/run.py

https://github.com/AI4Finance-Foundation/ElegantRL/blob/594b0c31de443a24c1032b75418fdc134664e92f/elegantrl/train/run.py#L116-L120

Yonv1943 avatar Mar 27 '23 01:03 Yonv1943