use super::Trainer;
use crate::dataset::DatasetBase;
use crate::{IntoDataset, Records};
use concision_core::Model;
impl<'a, M, T, R> Trainer<'a, M, T, R>
where
M: Model<T>,
R: Records,
{
pub fn new(model: &'a mut M, dataset: R) -> Self
where
R: IntoDataset<R::Inputs, R::Targets>,
T: Default,
{
Self {
dataset: dataset.into_dataset(),
model,
loss: T::default(),
}
}
pub const fn loss(&self) -> &T {
&self.loss
}
pub fn loss_mut(&mut self) -> &mut T {
&mut self.loss
}
pub const fn dataset(&self) -> &DatasetBase<R::Inputs, R::Targets> {
&self.dataset
}
pub fn dataset_mut(&mut self) -> &mut DatasetBase<R::Inputs, R::Targets> {
&mut self.dataset
}
pub fn begin(&self) -> &Self {
todo!("Define a generic training loop...")
}
}