NeuroTorch

neurotorch package

Subpackages

Submodules

neurotorch.dimension module

class neurotorch.dimension.Dimension(size: int | None = None, dtype: DimensionProperty = DimensionProperty.NONE, name: str | None = None)

Bases: object

This object is used to represent a dimension.

size

The size of the dimension.

Type:

int

dtype

The type of the dimension.

Type:

DimensionProperty

name

The name of the dimension.

Type:

str

__init__(size: int | None = None, dtype: DimensionProperty = DimensionProperty.NONE, name: str | None = None)

Constructor for Dimension.

Parameters:
  • size (int) – The size of the dimension.

  • dtype (DimensionProperty) – The type of the dimension.

  • name (str) – The name of the dimension.

static from_int(size: int | None) Dimension

Create a Dimension from an integer.

Parameters:

size (int) – The size of the dimension.

Returns:

A dimension with the given size and None as dtype.

Return type:

Dimension

static from_int_or_dimension(dimension: int | Dimension | None) Dimension

Create a Dimension from an integer or a Dimension.

Parameters:

dimension (int or Dimension) – The dimension to convert.

Returns:

A dimension with the given size and None as dtype if the input is an integer and the given dimension

if it is a Dimension. :rtype: Dimension

class neurotorch.dimension.DimensionProperty(value)

Bases: Enum

Enum for dimension properties.

NONE: No dimension property. This type of dimension can be used for features, neurons, unknown, etc. TIME: Time dimension. This type of dimension can be used for time series. SPATIAL: Spatial dimension. This type of dimension can be used for spatial data like images, videos, etc.

NONE = 0
SPATIAL = 2
TIME = 1
class neurotorch.dimension.Size(dimensions: int | Dimension | Iterable[int | Dimension])

Bases: object

This object is used to represent the size of a space.

Attributes:

dimensions (List[Dimension]): The dimensions of the space.

__init__(dimensions: int | Dimension | Iterable[int | Dimension])

Constructor for Size.

Parameters:

dimensions (int or Dimension or Iterable[int or Dimension]) – The dimensions of the space.

Module contents

NeuroTorch: A Python library for machine learning and neuroscience.