:py:mod:`nessai.flows.nsf` ========================== .. py:module:: nessai.flows.nsf .. autoapi-nested-parse:: Implementation of Neural Spline Flows. .. !! processed by numpydoc !! Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: nessai.flows.nsf.NeuralSplineFlow Attributes ~~~~~~~~~~ .. autoapisummary:: nessai.flows.nsf.logger .. py:data:: logger .. !! processed by numpydoc !! .. py:class:: NeuralSplineFlow(features, hidden_features, num_layers, num_blocks_per_layer, num_bins=8, context_features=None, activation=F.relu, dropout_probability=0.0, batch_norm_within_layers=False, batch_norm_between_layers=False, apply_unconditional_transform=False, linear_transform='permutation', tails='linear', tail_bound=5.0, **kwargs) Bases: :py:obj:`nessai.flows.base.NFlow` Implementation of Neural Spline Flow See: https://arxiv.org/abs/1906.04032 :Parameters: **features** : int Number of features (dimensions) in the data space **hidden_features** : int Number of neurons per layer in each neural network **num_layers** : int Number of coupling transformations **num_blocks_per_layer** : int Number of layers (or blocks for resnet) per neural network for each coupling transform **num_bins** : int, optional (8) Number of bins to use for each spline **context_features** : int, optional Number of context (conditional) parameters. **activation** : function Activation function implemented in torch **dropout_probability** : float, optional (0.0) Dropout probability used in each layer of the neural network **batch_norm_within_layers** : bool, optional (False) Enable or disable batch norm within the neural network for each coupling transform **batch_norm_between_layers** : bool, optional (False) Enable or disable batch norm between coupling transforms **linear_transform** : {'permutation', 'lu', 'svd'} Linear transform to use between coupling layers. Not recommended when using a custom mask. **kwargs** : dict Additional kwargs parsed to the spline constructor, e.g. `tails` or `tail_bound`. See nflows for details .. !! processed by numpydoc !!