tensortrade.agents.dqn_agent module

class tensortrade.agents.dqn_agent.DQNAgent(env: TradingEnv, policy_network: <sphinx.ext.autodoc.importer._MockObject object at 0x7f37561e1b90> = None)[source]

Bases: tensortrade.agents.agent.Agent

get_action(state: numpy.ndarray, **kwargs) → int[source]

Get an action for a specific state in the environment.

restore(path: str, **kwargs)[source]

Restore the agent from the file specified in path.

save(path: str, **kwargs)[source]

Save the agent to the directory specified in path.

train(n_steps: int = 1000, n_episodes: int = 10, save_every: int = None, save_path: str = 'agent/', callback: callable = None, **kwargs) → float[source]

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

class tensortrade.agents.dqn_agent.DQNTransition(state, action, reward, next_state, done)

Bases: tuple


Alias for field number 1


Alias for field number 4


Alias for field number 3


Alias for field number 2


Alias for field number 0