core.posterior_models.flow_matching.FlowMatchingPosteriorModel

core.posterior_models.flow_matching.FlowMatchingPosteriorModel(**kwargs)

Attributes

Name Description
eps
sigma_min

Methods

Name Description
evaluate_vector_field Evaluate the vector field v(t, theta_t, context_data) that generates the flow
loss Calculates loss as the mean squared error between the predicted vector field and

evaluate_vector_field

core.posterior_models.flow_matching.FlowMatchingPosteriorModel.evaluate_vector_field(
    t,
    theta_t,
    *context_data,
)

Evaluate the vector field v(t, theta_t, context_data) that generates the flow via the ODE

d/dt f(theta_t, t, context) = v(f(theta_t, t, context), t, context).

For flow matching, the vector field is regressed directly during training.

Parameters

Name Type Description Default
t time (noise level) required
theta_t noisy parameters, perturbed with noise level t required
*context_data list with context data (GW data) ()

loss

core.posterior_models.flow_matching.FlowMatchingPosteriorModel.loss(
    theta,
    *context,
)

Calculates loss as the mean squared error between the predicted vector field and the vector field for transporting the parameter data to samples from the prior.

Parameters

Name Type Description Default
theta Parameter values at which to evaluate the density. Should have a batch dimension (even if size B = 1). required
context Context information (typically observed data). Must have the same leading (batch) dimension as theta. ()

Returns

Name Type Description
loss torch.Tensor Mean loss across the batch (a scalar).