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§
Sourcefn get(
&self,
index: usize,
) -> Option<(Box<dyn ArrayProtocol>, Box<dyn ArrayProtocol>)>
fn get( &self, index: usize, ) -> Option<(Box<dyn ArrayProtocol>, Box<dyn ArrayProtocol>)>
Get a sample from the dataset by index.
Sourcefn inputshape(&self) -> Vec<usize>
fn inputshape(&self) -> Vec<usize>
Get the input shape of the dataset.
Sourcefn outputshape(&self) -> Vec<usize>
fn outputshape(&self) -> Vec<usize>
Get the output shape of the dataset.