pub trait Agent<E: Env, R: ReplayBufferBase>: Policy<E> {
    fn train(&mut self);
fn eval(&mut self);
fn is_train(&self) -> bool;
fn opt(&mut self, buffer: &mut R) -> Option<Record>;
fn save<T: AsRef<Path>>(&self, path: T) -> Result<()>;
fn load<T: AsRef<Path>>(&mut self, path: T) -> Result<()>; }
Expand description

Represents a trainable policy on an environment.

Required methods

Set the policy to training mode.

Set the policy to evaluation mode.

Return if it is in training mode.

Do an optimization step.

Save the agent in the given directory. This method commonly creates a number of files consisting the agent in the directory. For example, the DQN agent in border_tch_agent crate saves two Q-networks corresponding to the original and target networks.

Load the agent from the given directory.

Implementors