scimba_torch.neural_nets.structure_preserving_nets.symplectic_nets¶
Symplectic neural networks composed of invertible layers.
Classes
|
An invertible neural network composed of multiple invertible layers. |
|
An invertible neural network composed of multiple invertible layers. |
|
An invertible neural network composed of multiple invertible layers. |
|
An invertible neural network composed of multiple invertible layers. |
- class GSymplecticNet(size, conditional_size, width, nb_layers, **kwargs)[source]¶
Bases:
InvertibleNetAn invertible neural network composed of multiple invertible layers.
- Parameters:
size (
int) – dimension of the input dataconditional_size (
int) – dimension of the conditional input datawidth (
int) – width of the hidden layers in each layernb_layers (
int) – number of invertible layers to compose**kwargs – other arguments for the invertible layers
- log_abs_det_jacobian(y, mu)[source]¶
Computes the log absolute determinant of the Jacobian.
- Parameters:
y (
Tensor) – Input tensor of shape (batch_size, size).mu (
Tensor) – Conditional input of shape (batch_size, conditional_size).
- Return type:
Tensor- Returns:
Log determinant of shape (batch_size,).
- class PeriodicGSymplecticNet(size, conditional_size, width, nb_layers, **kwargs)[source]¶
Bases:
InvertibleNetAn invertible neural network composed of multiple invertible layers.
- Parameters:
size (
int) – dimension of the input dataconditional_size (
int) – dimension of the conditional input datawidth (
int) – width of the hidden layers in each layernb_layers (
int) – number of invertible layers to compose**kwargs – other arguments for the invertible layers
- forward(inputs)[source]¶
Applies all layers in sequence.
- Parameters:
inputs (
Tensor) – Input tensor of shape (2,batch_size, size).- Return type:
Tensor- Returns:
Transformed tensor of shape (batch_size, size).
- backward(inputs)[source]¶
Applies all layers in reverse order.
- Parameters:
inputs (
Tensor) – Input tensor of shape (2, batch_size, size).- Return type:
Tensor- Returns:
Inverse transformed tensor of shape (batch_size, size).
- log_abs_det_jacobian(y, mu)[source]¶
Computes the log absolute determinant of the Jacobian.
- Parameters:
y (
Tensor) – Input tensor of shape (batch_size, size).mu (
Tensor) – Conditional input of shape (batch_size, conditional_size).
- Return type:
Tensor- Returns:
Log determinant of shape (batch_size,).
- class LASymplecticNet(size, conditional_size, width, nb_layers, **kwargs)[source]¶
Bases:
InvertibleNetAn invertible neural network composed of multiple invertible layers.
- Parameters:
size (
int) – dimension of the input dataconditional_size (
int) – dimension of the conditional input datawidth (
int) – width of the hidden layers in each layernb_layers (
int) – number of invertible layers to compose**kwargs – other arguments for the invertible layers
- log_abs_det_jacobian(y, mu)[source]¶
Computes the log absolute determinant of the Jacobian.
- Parameters:
y (
Tensor) – Input tensor of shape (batch_size, size).mu (
Tensor) – Conditional input of shape (batch_size, conditional_size).
- Return type:
Tensor- Returns:
Log determinant of shape (batch_size,).
- class PSymplecticNet(size, conditional_size, deg, nb_layers, **kwargs)[source]¶
Bases:
InvertibleNetAn invertible neural network composed of multiple invertible layers.
- Parameters:
size (
int) – dimension of the input dataconditional_size (
int) – dimension of the conditional input datadeg (
int) – degree of the polynomial transformationnb_layers (
int) – number of invertible layers to compose**kwargs – other arguments for the invertible layers
- log_abs_det_jacobian(y, mu)[source]¶
Computes the log absolute determinant of the Jacobian.
- Parameters:
y (
Tensor) – Input tensor of shape (batch_size, size).mu (
Tensor) – Conditional input of shape (batch_size, conditional_size).
- Return type:
Tensor- Returns:
Log determinant of shape (batch_size,).