core.nn.cfnets.ContinuousFlow

core.nn.cfnets.ContinuousFlow(
    continuous_flow_net,
    context_embedding_net=torch.nn.Identity(),
    theta_embedding_net=torch.nn.Identity(),
    context_with_glu=False,
    theta_with_glu=False,
)

A continuous normalizing flow network. It defines a time-dependent vector field on the parameter space (score or flow), which optionally depends on additional context information.

v = v(f(t, theta), g(context))

This class combines the network v for the continuous flow itself, as well as embedding networks f, g, for the context and parameters, respectively.

The parameters and context can optionally be provided as gated linear unit (GLU) context to the main network, rather than as the main input to the network. For a DenseResidualNet, this context is input repeatedly via GLUs, for each residual block.

Parameters

Name Type Description Default
continuous_flow_net nn.Module Main network for the continuous flow. required
context_embedding_net nn.Module Embedding network for the context information (e.g., observed data). torch.nn.Identity()
theta_embedding_net nn.Module Embedding network for the parameters. torch.nn.Identity()
context_with_glu bool Whether to provide context as GLU or main input to the continuous_flow_net. False
theta_with_glu bool Whether to provide theta (and t) as GLU or main input to the continuous_flow_net. False

Attributes

Name Description
context_embedding_net
context_with_glu
continuous_flow_net
theta_embedding_net
theta_with_glu
use_cache

Methods

Name Description
forward

forward

core.nn.cfnets.ContinuousFlow.forward(t, theta, *context)