NeuralTSNE.TSNE.NeuralNetwork package

Submodules

NeuralTSNE.TSNE.NeuralNetwork.neural_network module

class BaseModel(*args, **kwargs)[source]View on GitHub

Bases: Module, ABC

Base class for neural network models.

abstract property in_features: intView on GitHub

Return the number of input features.

class NeuralNetwork(initial_features: int | None = None, n_components: int | None = None, multipliers: List[float] | None = None, pre_filled_layers: OrderedDict | Sequential | None = None)[source]View on GitHub

Bases: BaseModel

Neural network model for dimensionality reduction.

Parameters:
  • initial_features (int, optional) – Number of input features.

  • n_components (int, optional) – Number of components in the output.

  • multipliers (List[float], optional) – List of multipliers for hidden layers.

  • pre_filled_layers (Union[OrderedDict, nn.Sequential], optional) – Pre-filled OrderedDict or nn.Sequential for layers. Defaults to None.

Note

The neural network is designed for dimensionality reduction with hidden layers defined by the list of multipliers. ReLU activation functions are applied between layers. If pre_filled_layers is provided, the neural network is initialized with the given layers and other parameters are ignored.

forward(x)[source]View on GitHub

Forward pass through the neural network.

Parameters:

x (torch.Tensor) – Input tensor.

Returns:

Output tensor.

Return type:

torch.Tensor

property in_features: intView on GitHub

Return the number of input features.

Module contents