pub struct AudioClassificationDataset { /* private fields */ }Expand description
A dataset for audio classification tasks.
Implementations§
Source§impl AudioClassificationDataset
impl AudioClassificationDataset
Sourcepub fn new(
waveforms: Vec<Tensor<f32>>,
labels: Vec<usize>,
sample_rate: usize,
num_classes: usize,
) -> Self
pub fn new( waveforms: Vec<Tensor<f32>>, labels: Vec<usize>, sample_rate: usize, num_classes: usize, ) -> Self
Creates a new audio classification dataset from waveforms and labels.
Sourcepub fn sample_rate(&self) -> usize
pub fn sample_rate(&self) -> usize
Returns the sample rate.
Sourcepub fn num_classes(&self) -> usize
pub fn num_classes(&self) -> usize
Returns the number of classes.
Trait Implementations§
Source§impl Dataset for AudioClassificationDataset
impl Dataset for AudioClassificationDataset
Auto Trait Implementations§
impl Freeze for AudioClassificationDataset
impl !RefUnwindSafe for AudioClassificationDataset
impl Send for AudioClassificationDataset
impl Sync for AudioClassificationDataset
impl Unpin for AudioClassificationDataset
impl !UnwindSafe for AudioClassificationDataset
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> 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