Dataset

Trait Dataset 

Source
pub trait Dataset {
    // Required methods
    fn len(&self) -> usize;
    fn get(
        &self,
        index: usize,
    ) -> Option<(Box<dyn ArrayProtocol>, Box<dyn ArrayProtocol>)>;
    fn inputshape(&self) -> Vec<usize>;
    fn outputshape(&self) -> Vec<usize>;

    // Provided method
    fn is_empty(&self) -> bool { ... }
}
Expand description

Dataset trait for providing data samples.

Required Methods§

Source

fn len(&self) -> usize

Get the number of samples in the dataset.

Source

fn get( &self, index: usize, ) -> Option<(Box<dyn ArrayProtocol>, Box<dyn ArrayProtocol>)>

Get a sample from the dataset by index.

Source

fn inputshape(&self) -> Vec<usize>

Get the input shape of the dataset.

Source

fn outputshape(&self) -> Vec<usize>

Get the output shape of the dataset.

Provided Methods§

Source

fn is_empty(&self) -> bool

Check if the dataset is empty.

Implementors§