nami.processes.fm#
Classes
|
|
|
- class nami.processes.fm.FlowMatching(field, base, solver, *, t0=1.0, t1=0.0, event_ndim=None, validate_args=True)[source]#
Bases:
LazyDistribution- forward(c=None)[source]#
Define the computation performed at every call.
Should be overridden by all subclasses.
Note
Although the recipe for forward pass needs to be defined within this function, one should call the
Moduleinstance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.- Return type:
- Parameters:
c (Tensor | None)
- class nami.processes.fm.FlowMatchingProcess(field, base, solver, *, t0=1.0, t1=0.0, context=None, validate_args=True)[source]#
Bases:
object- Parameters:
base (torch.distributions.Distribution)
t0 (float)
t1 (float)
context (torch.Tensor | None)
validate_args (bool)
- property base#
- property field#
- log_prob(x, *, estimator=None)[source]#
Evaluate log-density via change of variables.
Callers should usually pass
estimator=...unless the field implementscall_and_divergenceitself. We do not auto-select a divergence estimator here because the tradeoff is model-dependent: exact traces are deterministic but can be expensive, while Hutchinson-style estimators scale better but add stochasticity.