def __init__(self, flow, latent_prior, verbosity=None):
     self.flow = flow
     self.latent_prior = latent_prior
     self.loss = abstract_attribute()
     self.logger = logging.getLogger(__name__).getChild(
         self.__class__.__name__ + ":" + hex(id(self)))
     self.set_verbosity(verbosity)
Beispiel #2
0
    def __init__(self, *, d, transform, mask):
        """
        Parameters
        ----------
        d: int
            dimension of the space
        transform: function or :py:class:`InvertibleTransform <zunis.models.flows.coupling_cells.transforms.InvertibleTransform>`
            bijective variable transform that maps the unit hypercube (in `d-sum(mask)` dimensions) to itself
            given some parameters. It should have the same signature as
            :py:meth:`InvertibleTransform.forward <zunis.models.flows.coupling_cells.transforms.InvertibleTransform.forward>`
        mask: list of bool
            indicates which variables are passed (y_N) through and which are transformed (y_M)
        """
        super(GeneralCouplingCell, self).__init__(d=d)

        self.mask = mask + [False]
        self.mask_complement = not_list(mask) + [False]
        self.transform = transform
        self.T = abstract_attribute()
Beispiel #3
0
 def __init__(self, d):
     super(AnalyticFlow, self).__init__(d=d)
     self.flow_ = abstract_attribute()
Beispiel #4
0
 def __init__(self, *args, verbosity=None, **kwargs):
     self.model_trainer = abstract_attribute()
     self.logger = logging.getLogger(__name__).getChild(
         self.__class__.__name__ + ":" + hex(id(self)))
     self.set_verbosity(verbosity)
 def __init__(self, *, d):
     super(GeneralBackpropJacobianFlow, self).__init__(d=d)
     # A backprop Jacobian flow must implement an attribute flow_
     # which computes the transformation in a differentiable way
     self.flow_ = abstract_attribute()