Registry / ai-ml / flow-matching

flow-matching

JSON →
library1.0.10pypypiunverified

Flow Matching for Generative Modeling, a library by Meta Research for training continuous normalizing flows via flow matching objectives. Current version 1.0.10, supports Python >=3.9, actively maintained.

pip install flow-matching
INSTALL
IMPORT
SIG · FLOW-MATCHING
F
flow-matching
ai-mlpythonv1.0.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

FlowMatching
from flow_matching import FlowMatching
from flow_matching import FlowMatching

Minimal example: create a flow matching model, compute the flow matching objective between random source and target samples.

import torch from flow_matching import CondOTFlowMatching from flow_matching.objectives import FMObjective dim = 2 flow = CondOTFlowMatching(dim=dim) objective = FMObjective(flow) x0 = torch.randn(100, dim) x1 = torch.randn(100, dim) t = torch.rand(100) loss = objective(x0, x1, t) print(f"Loss: {loss.item()}")
Debug
Known issues
breakingAs of v1.0.0, the API was completely rewritten. Imports like `from flow_matching import FlowMatching` now return a high-level wrapper, not the old `CNF` class. If upgrading from <1.0, review all imports.
fix
Update imports: use `from flow_matching import CondOTFlowMatching` instead of old `from flow_matching import FlowMatching`.
affects: <1.0.0
deprecatedThe `models.CNF` class is deprecated since v1.0.0. Use `CondOTFlowMatching` or other specific flow matching classes.
fix
Replace `from flow_matching.models import CNF` with `from flow_matching import CondOTFlowMatching`.
affects: >=1.0.0
gotchaThe library expects input tensors (x0, x1) to have dtype `torch.float32`. Using float64 may cause silent errors or performance degradation.
fix
Ensure tensors are float32: `x0 = x0.float()`.
affects: all
Upgrade
Version history
1.0.10latest on PyPI · released Dec 18, 2024
Audit
Dependencies
torchrequiredCore dependency for tensor operations and neural networks.
torchdiffeqrequiredUsed for ODE solvers in sampling.
Agent activity
17 hits · last 30 days
node
12
OpenAI (training)
1
Resources
flow-matching — pip install flow-matching · libregistry