tensorforce / tensorforce

Tensorforce: a TensorFlow library for applied reinforcement learning
Apache License 2.0
3.3k stars 530 forks source link

Tracked tensor in TensorForce agent #859

Open devantheryl opened 2 years ago

devantheryl commented 2 years ago

Hello,

I have a problem to track the parameters of the agent.

At first when I create a DDQNagent with tracking = 'all'.

when I call :

tracked = agent.tracked_tensors()

I can find the exploration and learning rate values (which I decrease linearly).

when I load an already trained agent (to train another instance from a pre-trained base) and I change the exploration and learning rate values like this:

agent = Agent.load( directory = "model/8_job_ddqn_weekend/lunar-snowflake-2/", filename = "0000011000.hdf5", environment = environment, learning_rate = 0.0001, tracking = 'all', exploration = 0.5, )

the values I modified (exploration and learning rate in this case) are not visible anymore. Is there a way to access their values?

Thanks in advance !

AlexKuhnle commented 2 years ago

Hi @devantheryl,

When you say they are not visible, do you mean that they still show the "old" values? If so, that may be a bug in how the tracked_tensors() feature is implemented (i.e. I'm pretty sure the new values will be used, they are just not returned).

devantheryl commented 2 years ago

Hi @AlexKuhnle , thank's for the quick answer :)

No, I mean the values are not present at all.

new agent created with tracked_tensor = 'all' :

image

agent loaded and exploration + learning rate modified as mentionned above :

image

as you can see, the two modified values aren't present anymore in the tracked values.

AlexKuhnle commented 2 years ago

Ah, right, so it's precisely the modified values which are missing... Okay, need to look into that.