pub struct TrainingDataset {
pub features: Vec<Vec<f32>>,
pub labels: Vec<f32>,
pub soft_targets: Option<Vec<f32>>,
}Expand description
Training dataset with features and labels
Fields§
§features: Vec<Vec<f32>>Input features (N x input_dim)
labels: Vec<f32>Target labels (N)
soft_targets: Option<Vec<f32>>Optional teacher soft targets for distillation (N)
Implementations§
Source§impl TrainingDataset
impl TrainingDataset
Sourcepub fn new(features: Vec<Vec<f32>>, labels: Vec<f32>) -> Result<Self>
pub fn new(features: Vec<Vec<f32>>, labels: Vec<f32>) -> Result<Self>
Create a new training dataset
Sourcepub fn with_soft_targets(self, soft_targets: Vec<f32>) -> Result<Self>
pub fn with_soft_targets(self, soft_targets: Vec<f32>) -> Result<Self>
Add soft targets from teacher model for knowledge distillation
Sourcepub fn split(&self, val_ratio: f32) -> Result<(Self, Self)>
pub fn split(&self, val_ratio: f32) -> Result<(Self, Self)>
Split dataset into train and validation sets
Trait Implementations§
Source§impl Clone for TrainingDataset
impl Clone for TrainingDataset
Source§fn clone(&self) -> TrainingDataset
fn clone(&self) -> TrainingDataset
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TrainingDataset
impl RefUnwindSafe for TrainingDataset
impl Send for TrainingDataset
impl Sync for TrainingDataset
impl Unpin for TrainingDataset
impl UnwindSafe for TrainingDataset
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more