Types#

class lfeats.Container(data: ndarray | Tensor)[source]#

Dataclass to hold generic data.

property array: ndarray#

Get the data as a NumPy array.

Returns:
outnp.ndarray

The data as a NumPy array.

is_array() bool[source]#

Check if the data is a NumPy array.

Returns:
outbool

True if the data is a NumPy array, False otherwise.

is_tensor() bool[source]#

Check if the data is a PyTorch tensor.

Returns:
outbool

True if the data is a PyTorch tensor, False otherwise.

property ndim: int#

Get the number of dimensions of the data.

Returns:
outint

The number of dimensions of the data.

property shape: tuple[int, ...]#

Get the shape of the data.

Returns:
outtuple[int, …]

The shape of the data.

property tensor: Tensor#

Get the data as a PyTorch tensor.

Returns:
outtorch.Tensor

The data as a PyTorch tensor.

class lfeats.Audio(data: ndarray | Tensor, sample_rate: int)[source]#

Dataclass to hold audio data.

property length: int#

Get the length of the audio samples.

Returns:
outint

The length of the audio samples.

class lfeats.Features(data: ndarray | Tensor, source: str, layers: list[int] | None = None)[source]#

Dataclass to hold latent features.

property length: int#

Get the length of the audio samples.

Returns:
outint

The length of the audio samples.