Struct SpeechCommandsDataset
pub struct SpeechCommandsDataset { /* private fields */ }
Expand description
Speech Commands dataset from Huggingface v0.02. See Speech Commands dataset.
The data is downloaded from Huggingface and stored in a SQLite database (3.0 GB). The dataset contains 99,720 audio samples of 2,607 people saying 35 different words.
NOTE: The most samples are under 1 second long but there are some with pure background noise that need splitting into shorter segmants.
The labels are 20 target words, silence and other words.
The dataset is split into 3 parts:
- train: 84,848 audio files
- test: 4,890 audio files
- validation: 9,982 audio files
Implementations§
§impl SpeechCommandsDataset
impl SpeechCommandsDataset
pub fn new(split: &str) -> SpeechCommandsDataset
pub fn new(split: &str) -> SpeechCommandsDataset
Create a new dataset with the given split.
pub fn train() -> SpeechCommandsDataset
pub fn train() -> SpeechCommandsDataset
Create a new dataset with the train split.
pub fn test() -> SpeechCommandsDataset
pub fn test() -> SpeechCommandsDataset
Create a new dataset with the test split.
pub fn validation() -> SpeechCommandsDataset
pub fn validation() -> SpeechCommandsDataset
Create a new dataset with the validation split.
pub fn num_classes() -> usize
pub fn num_classes() -> usize
Returns the number of classes in the dataset
Trait Implementations§
§impl Dataset<SpeechItem> for SpeechCommandsDataset
impl Dataset<SpeechItem> for SpeechCommandsDataset
§fn get(&self, index: usize) -> Option<SpeechItem>
fn get(&self, index: usize) -> Option<SpeechItem>
Gets the item at the given index.
§fn iter(&self) -> DatasetIterator<'_, I> ⓘwhere
Self: Sized,
fn iter(&self) -> DatasetIterator<'_, I> ⓘwhere
Self: Sized,
Returns an iterator over the dataset.
Auto Trait Implementations§
impl Freeze for SpeechCommandsDataset
impl !RefUnwindSafe for SpeechCommandsDataset
impl Send for SpeechCommandsDataset
impl Sync for SpeechCommandsDataset
impl Unpin for SpeechCommandsDataset
impl !UnwindSafe for SpeechCommandsDataset
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<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<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) {
// do sth with window
}