neural net module
- class neural_net.PersLay(output_dim)
Bases:
torch.nn.modules.module.ModuleA Pytorch implementation of the PersLay. This implementation will use a small fully connected network as weight function, and a different small fully connected network as phi. This is used to vectorize a persistence diagram in a neural network.
- Parameters
output_dim – The amount of output nodes of the PersLay.
- forward(x)
Passes a dataset Tensor through the PersLay.
- Parameters
x – A Tensor containing the data.
- Returns
A Tensor containing the output of this PersLay.
- training: bool
- class neural_net.TopAELoss
Bases:
torch.nn.modules.module.ModuleA pytorch implementation of the Topological AutoEncoder loss function.
- forward(input, latent, output, point_count)
Calculates the loss for a given input and its corresponding latent-space, and output. This is a combination of the reconstruction loss between input and output, and the homology loss between input and latent space.
- Parameters
input – The input of the AutoEncoder.
latent – The latent space of the AutoEncoder when fed with input.
output – The output of the AutoEncoder when fed with input
point_count – The amount of points in the diagram that is the input.
- Returns
A Tensor with the loss of the AutoEncoder.
- training: bool
- class neural_net.TopologicalAutoEncoder(**kwargs)
Bases:
torch.nn.modules.module.ModuleImplement a Topological AutoEncoder in pytorch.
- Parameters
input_shape – Tuple containing: (Amount of simplices, input dimensions)
latent_space_size – An integer stating the amount of dimensions in the latent space.
- forward(x)
Passes a dataset Tensor through the PersLay.
- Parameters
x – A Tensor containing the data.
- Returns
A Tensor containing the output of the AutoEncoder, and a Tensor containing the output at the latent space.
- training: bool