tensortrade.agents.dqn_agent module

References

class tensortrade.agents.dqn_agent.DQNAgent(env, policy_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.dqn_agent.DQNTransition(state, action, reward, next_state, done)

Bases: tuple

action

Alias for field number 1

done

Alias for field number 4

next_state

Alias for field number 3

reward

Alias for field number 2

state

Alias for field number 0