tensortrade.agents.a2c_agent module

References

class tensortrade.agents.a2c_agent.A2CAgent(env, shared_network=None, actor_network=None, critic_network=None)[source]

Bases: tensortrade.agents.agent.Agent

get_action(state, **kwargs)[source]

Get an action for a specific state in the environment.

Return type:int
restore(path, **kwargs)[source]

Restore the agent from the file specified in path.

save(path, **kwargs)[source]

Save the agent to the directory specified in path.

train(n_steps=None, n_episodes=None, save_every=None, save_path=None, callback=None, **kwargs)[source]

Train the agent in the environment and return the mean reward.

Return type:float
class tensortrade.agents.a2c_agent.A2CTransition(state, action, reward, done, value)

Bases: tuple

action

Alias for field number 1

done

Alias for field number 3

reward

Alias for field number 2

state

Alias for field number 0

value

Alias for field number 4