:py:mod:`n2j.models.flow` ========================= .. py:module:: n2j.models.flow .. autoapi-nested-parse:: Credit to Miles Cranmer: https://github.com/MilesCranmer/easy_normalizing_flow/blob/master/flow.py Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: n2j.models.flow.MaskedLinear n2j.models.flow.MADE n2j.models.flow.MAF n2j.models.flow.Perm n2j.models.flow.Flow Attributes ~~~~~~~~~~ .. autoapisummary:: n2j.models.flow.DEBUG .. py:data:: DEBUG :value: False .. py:class:: MaskedLinear(in_features, out_features, bias=True) Bases: :py:obj:`torch.nn.Linear` same as Linear except has a configurable mask on the weights .. py:method:: set_mask(mask) .. py:method:: forward(input) .. py:class:: MADE(nin, hidden_sizes, nout, num_masks=1, natural_ordering=False) Bases: :py:obj:`torch.nn.Module` .. py:method:: update_masks() .. py:method:: forward(x) .. py:class:: MAF(features, context, hidden=100, nlayers=1) Bases: :py:obj:`torch.nn.Module` x0 only depends on x0, etc .. py:method:: fmualpha(x) .. py:method:: load_context(x, context) .. py:method:: invert(u, context) .. py:method:: forward(x, context) .. py:class:: Perm(nvars, perm=None) Bases: :py:obj:`torch.nn.Module` .. py:method:: forward(x, context) .. py:method:: invert(x, context) .. py:class:: Flow(*layers) Bases: :py:obj:`torch.nn.Module` .. py:method:: forward(x, context) .. py:method:: invert(u, context)