Open Yonv1943 opened 2 years ago
There are bug in if_act_target and if_cri_target in AgentBase.py
if_act_target
if_cri_target
AgentBase.py
class AgentXXX.__init__() should set args.if_cri_target = getattr(self, "if_cri_target", True) (or False) in default.
class AgentXXX.__init__()
args.if_cri_target = getattr(self, "if_cri_target", True)
Takes AgentDQN as an example, the following code should be changed.
https://github.com/AI4Finance-Foundation/ElegantRL/blob/3ded1cef5d9c9100422935141b07d3ec5301db4b/elegantrl/agents/AgentDQN.py#L21-L26
Change to fhe following code (as ElegantRL HelloWorld version do): https://github.com/AI4Finance-Foundation/ElegantRL/blob/3ded1cef5d9c9100422935141b07d3ec5301db4b/elegantrl_helloworld/agent.py#L62-L69
ElegantRL HelloWorld
1 If the default value is true, how to set it as false?
2 if getattr is to set value for an attr, it should be setattr. getattr only gets values instead of changing values.
Isn't it self.if_act_target?
There are bug in
if_act_target
andif_cri_target
inAgentBase.py
class AgentXXX.__init__()
should setargs.if_cri_target = getattr(self, "if_cri_target", True)
(or False) in default.Takes AgentDQN as an example, the following code should be changed.
https://github.com/AI4Finance-Foundation/ElegantRL/blob/3ded1cef5d9c9100422935141b07d3ec5301db4b/elegantrl/agents/AgentDQN.py#L21-L26
Change to fhe following code (as
ElegantRL HelloWorld
version do): https://github.com/AI4Finance-Foundation/ElegantRL/blob/3ded1cef5d9c9100422935141b07d3ec5301db4b/elegantrl_helloworld/agent.py#L62-L69