repeated_cell module

class MaskListRepeatedCellFlow(*args, **kwargs)[source]

Bases: zunis.models.flows.sequential.invertible_sequential.InvertibleSequentialFlow

Sequential normalizing flow based on repeating a single coupling cell type with each a different mask as a sequence of transformations

Parameters
  • d (int) – dimensionality of the space

  • cell – callable that yields an instance of zunis.models.flows.coupling_cells.general_coupling.InvertibleCouplingCell the coupling cell to be repeated.

  • masks (list of lists of bool) – list of masks for each flow in the cell. The order is from latent space to target space

  • input_flow (, None) – flow model to be used as an input. Typically to deform the input space to be suited to the repeated cell

  • output_flow (, None) – flow model to be used as an output. Typically to deform the input space to be suited to the repeated cell

  • cell_params (dict) – parameters of the cell

  • input_cell_params (dict, None) – parameters of the input cell

  • output_cell_params (dict) – parameters of the output cell

training: bool[source]
class RepeatedCellFlow(*args, **kwargs)[source]

Bases: zunis.models.flows.sequential.repeated_cell.MaskListRepeatedCellFlow

Repeated cell flow: a sequential model with a coupling cell model This is meant as a higher-level API to generate boilerplate models based on architecture and masking strategy

Parameters
  • d (int) – dimensionality

  • cell ({"pwlinear", "pwquad", "realnvp"}) – coupling cell choice

  • masking ({"checkerboard", "maximal"}) – masking strategy. See RepeatedCellFlow.masking and masking

  • input_cell (optional) – Transformation before the repeated cell

  • output_cell (optional) – Transformation after the repeated cell

  • cell_params (dict, optional) – parameters for the repeated cell

  • input_cell_params (dict, optional) – parameters for the input_cell

  • output_cell_params (dict, optional) – parameters for the output_cell

  • masking_options (dict, optional) – parameters for the masking strategy

cells = {'pwlinear': (<class 'zunis.models.flows.coupling_cells.piecewise_coupling.piecewise_linear.PWLinearCoupling'>, None, None), 'pwquad': (<class 'zunis.models.flows.coupling_cells.piecewise_coupling.piecewise_quadratic.PWQuadraticCoupling'>, None, None), 'realnvp': (<class 'zunis.models.flows.coupling_cells.real_nvp.RealNVP'>, None, <class 'zunis.models.flows.analytic_flows.element_wise.InvertibleAnalyticSigmoid'>)}[source]
masking = {'checkerboard': functools.partial(<function n_ary_mask_strategy>, n=2), 'iflow': <function iflow_strategy>, 'maximal': <function maximal_masking_strategy>}[source]
training: bool[source]