ElegantRL icon indicating copy to clipboard operation
ElegantRL copied to clipboard

not deterministic

Open Timodhau opened this issue 3 years ago • 2 comments

Hello, I ran elegant rl with finrl processor using the function DRLAgent_erl.DRL_prediction and it seemed to not be deterministic.

Timodhau avatar Mar 13 '22 12:03 Timodhau

Perhaps the stochasticity is brought by the env.reset().

Because both stochastic and determinstic policy algorithms will use determinstic policy by default during the testing phase.

Yonv1943 avatar Mar 26 '22 12:03 Yonv1943

Well i took a look just before : with _torch.no_grad(): for i in range(environment.max_step): s_tensor = _torch.as_tensor((state,), device=device) a_tensor = act(s_tensor) # action_tanh = act.forward() action = ( a_tensor.detach().cpu().numpy()[0] ) # not need detach(), because with torch.no_grad() outside state, reward, done, _ = environment.step(action) in file models.py, my states are similar. Maybe i introduced an error myself but I don't think so.

Timodhau avatar Apr 04 '22 14:04 Timodhau