pub struct SupervisedDataset { /* private fields */ }Expand description
Supervised dataset with aligned input/target sample axis at position 0.
Implementations§
Source§impl SupervisedDataset
impl SupervisedDataset
Sourcepub fn augment_nhwc(
&self,
pipeline: &ImageAugmentationPipeline,
seed: u64,
) -> Result<Self, ModelError>
pub fn augment_nhwc( &self, pipeline: &ImageAugmentationPipeline, seed: u64, ) -> Result<Self, ModelError>
Returns a new dataset with NHWC image augmentations applied to inputs.
Source§impl SupervisedDataset
impl SupervisedDataset
pub fn new(inputs: Tensor, targets: Tensor) -> Result<Self, ModelError>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn inputs(&self) -> &Tensor
pub fn targets(&self) -> &Tensor
pub fn batches( &self, batch_size: usize, ) -> Result<MiniBatchIter<'_>, ModelError>
pub fn batches_with_options( &self, batch_size: usize, options: BatchIterOptions, ) -> Result<MiniBatchIter<'_>, ModelError>
pub fn split_by_counts( &self, train_count: usize, validation_count: usize, shuffle: bool, seed: u64, ) -> Result<DatasetSplit, ModelError>
pub fn split_by_ratio( &self, train_ratio: f32, validation_ratio: f32, shuffle: bool, seed: u64, ) -> Result<DatasetSplit, ModelError>
pub fn split_by_class_ratio( &self, train_ratio: f32, validation_ratio: f32, shuffle: bool, seed: u64, ) -> Result<DatasetSplit, ModelError>
Trait Implementations§
Source§impl Clone for SupervisedDataset
impl Clone for SupervisedDataset
Source§fn clone(&self) -> SupervisedDataset
fn clone(&self) -> SupervisedDataset
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 moreSource§impl Debug for SupervisedDataset
impl Debug for SupervisedDataset
Source§impl PartialEq for SupervisedDataset
impl PartialEq for SupervisedDataset
impl StructuralPartialEq for SupervisedDataset
Auto Trait Implementations§
impl Freeze for SupervisedDataset
impl RefUnwindSafe for SupervisedDataset
impl Send for SupervisedDataset
impl Sync for SupervisedDataset
impl Unpin for SupervisedDataset
impl UnsafeUnpin for SupervisedDataset
impl UnwindSafe for SupervisedDataset
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more