Trait border_core::Agent
source · [−]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
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.