pub trait ModelBase {
// Required methods
fn backward_step(&mut self, loss: &Tensor);
fn get_var_store_mut(&mut self) -> &mut VarStore;
fn get_var_store(&self) -> &VarStore;
fn save<T: AsRef<Path>>(&self, path: T) -> Result<()>;
fn load<T: AsRef<Path>>(&mut self, path: T) -> Result<()>;
}Expand description
Base interface.
Required Methods§
Sourcefn backward_step(&mut self, loss: &Tensor)
fn backward_step(&mut self, loss: &Tensor)
Trains the network given a loss.
Sourcefn get_var_store_mut(&mut self) -> &mut VarStore
fn get_var_store_mut(&mut self) -> &mut VarStore
Returns var_store as mutable reference.
Sourcefn get_var_store(&self) -> &VarStore
fn get_var_store(&self) -> &VarStore
Returns var_store.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.