Struct MnistDataset
pub struct MnistDataset { /* private fields */ }Expand description
The MNIST dataset consists of 70,000 28x28 black-and-white images in 10 classes (one for each digits), with 7,000 images per class. There are 60,000 training images and 10,000 test images.
The data is downloaded from the web from the CVDF mirror.
Implementations§
§impl MnistDataset
impl MnistDataset
pub fn train() -> MnistDataset
pub fn train() -> MnistDataset
Creates a new train dataset.
pub fn test() -> MnistDataset
pub fn test() -> MnistDataset
Creates a new test dataset.
Trait Implementations§
§impl Dataset<MnistItem> for MnistDataset
impl Dataset<MnistItem> for MnistDataset
§fn get(&self, index: usize) -> Result<MnistItem, DatasetError>
fn get(&self, index: usize) -> Result<MnistItem, DatasetError>
Gets the item at the given index. Read more
§fn get_many(&self, indexes: Vec<usize>) -> Result<Vec<I>, E>
fn get_many(&self, indexes: Vec<usize>) -> Result<Vec<I>, E>
Gets the items at given indexes Read more
§fn iter(&self) -> DatasetIterator<'_, I, E> ⓘwhere
Self: Sized,
fn iter(&self) -> DatasetIterator<'_, I, E> ⓘwhere
Self: Sized,
Returns an iterator over the dataset.
Auto Trait Implementations§
impl Freeze for MnistDataset
impl RefUnwindSafe for MnistDataset
impl Send for MnistDataset
impl Sync for MnistDataset
impl Unpin for MnistDataset
impl UnsafeUnpin for MnistDataset
impl UnwindSafe for MnistDataset
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<K, Q> Comparable<Q> for K
impl<K, Q> Comparable<Q> for K
§impl<K, Q> Equivalent<Q> for K
impl<K, Q> Equivalent<Q> for K
§fn equivalent(&self, key: &Q) -> bool
fn equivalent(&self, key: &Q) -> bool
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
§impl<I, T> Windows<I> for Twhere
T: Dataset<I>,
impl<I, T> Windows<I> for Twhere
T: Dataset<I>,
§fn windows(&self, size: usize) -> WindowsIterator<'_, I> ⓘ
fn windows(&self, size: usize) -> WindowsIterator<'_, I> ⓘ
Is empty if the Dataset is shorter than size.
§Panics
Panics if size is 0.
§Examples
use crate::burn_dataset::{
transform::{Windows, WindowsDataset},
Dataset, InMemDataset,
};
let items = [1, 2, 3, 4].to_vec();
let dataset = InMemDataset::new(items.clone());
for window in dataset.windows(2) {
// window is a Result<Vec<I>, DatasetError>
}