tensortrade.agents.parallel.parallel_dqn_agent module

class tensortrade.agents.parallel.parallel_dqn_agent.ParallelDQNAgent(create_env: Callable[[None], TradingEnvironment], model: tensortrade.agents.parallel.parallel_dqn_model.ParallelDQNModel = 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 = None, n_episodes: int = None, save_every: int = None, save_path: str = None, callback: callable = None, **kwargs) → float[source]

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

update_networks(model: tensortrade.agents.parallel.parallel_dqn_model.ParallelDQNModel)[source]