zuko.flows.neural#
Neural flows and transformations.
Classes#
Descriptions#
- class zuko.flows.neural.MNN(signal=16, **kwargs)#
Creates a monotonic neural network (MNN).
The monotonic neural network is parametrized by its internal positive weights, which are independent of the features and context. To modulate its behavior, it receives as input a signal vector that can depend on the features and context.
See also
References
Neural Autoregressive Flows (Huang et al., 2018)- Parameters:
signal (int) – The number of signal features of the monotonic network.
kwargs – Keyword arguments passed to
zuko.nn.MonotonicMLP
.
- class zuko.flows.neural.UMNN(signal=16, **kwargs)#
Creates an unconstrained monotonic neural network (UMNN).
The integrand neural network is parametrized by its internal weights, which are independent of the features and context. To modulate its behavior, it receives as input a signal vector that can depend on the features and context.
References
Unconstrained Monotonic Neural Networks (Wehenkel et al., 2019)- Parameters:
signal (int) – The number of signal features of the integrand network.
kwargs – Keyword arguments passed to
zuko.nn.MLP
.
- class zuko.flows.neural.NAF(features, context=0, transforms=3, randperm=False, signal=16, network={}, **kwargs)#
Creates a neural autoregressive flow (NAF).
Warning
Invertibility is only guaranteed for features within the interval \([-10, 10]\). It is recommended to standardize features (zero mean, unit variance) before training.
References
Neural Autoregressive Flows (Huang et al., 2018)- Parameters:
features (int) – The number of features.
context (int) – The number of context features.
transforms (int) – The number of autoregressive transformations.
randperm (bool) – Whether features are randomly permuted between transformations or not. If
False
, features are in ascending (descending) order for even (odd) transformations.signal (int) – The number of signal features of the monotonic network.
kwargs – Keyword arguments passed to
zuko.flows.autoregressive.MaskedAutoregressiveTransform
.
- class zuko.flows.neural.UNAF(features, context=0, transforms=3, randperm=False, signal=16, network={}, **kwargs)#
Creates an unconstrained neural autoregressive flow (UNAF).
Warning
Invertibility is only guaranteed for features within the interval \([-10, 10]\). It is recommended to standardize features (zero mean, unit variance) before training.
References
Unconstrained Monotonic Neural Networks (Wehenkel et al., 2019)- Parameters:
features (int) – The number of features.
context (int) – The number of context features.
transforms (int) – The number of autoregressive transformations.
randperm (bool) – Whether features are randomly permuted between transformations or not. If
False
, features are in ascending (descending) order for even (odd) transformations.signal (int) – The number of signal features of the monotonic network.
network (Dict[str, Any]) – Keyword arguments passed to
UMNN
.kwargs – Keyword arguments passed to
zuko.flows.autoregressive.MaskedAutoregressiveTransform
.