simple_backprop_flows module

Simple flows with an easily computable jacobian - useful for tests and checks

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

Bases: zunis.models.flows.backprop_jacobian_flows.general_backprop_j_flow.GeneralBackpropJacobianFlow

Flow transformation as a pure matrix multiplication Expected jacobian: det(self.flow.weight)

Initializes internal Module state, shared by both nn.Module and ScriptModule.

training: bool[source]
weight_init_identity_(std=None)[source]

Initialize weights as eye + normal(0,std) Essentially realizing a resnet-like layer

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

Bases: zunis.models.flows.backprop_jacobian_flows.general_backprop_j_flow.GeneralBackpropJacobianFlow

Flow transformation as an element-wise sigmoid application Expected jacobian: sigmoid(x)*(1-sigmoid(x))

Initializes internal Module state, shared by both nn.Module and ScriptModule.

training: bool[source]