add flow-matching policy with factory integration#3359
add flow-matching policy with factory integration#3359DeepforThink wants to merge 8 commits intohuggingface:mainfrom
Conversation
|
Thanks for reviewing! I can quickly address any CI or design feedback |
There was a problem hiding this comment.
Pull request overview
This PR adds a new flow_matching policy implementation to LeRobot and wires it into the existing policy factory + processor pipeline so it can be instantiated via the standard configuration/factory entrypoints.
Changes:
- Added
FlowMatchingConfig,FlowMatchingPolicy, and a flow-matching processor module undersrc/lerobot/policies/flow_matching/. - Integrated
flow_matchingintomake_policy_configandmake_pre_post_processorsinsrc/lerobot/policies/factory.py, and exportedFlowMatchingConfigfromsrc/lerobot/policies/__init__.py. - Added targeted unit tests for config factory creation and a basic forward/select_action path.
Reviewed changes
Copilot reviewed 7 out of 8 changed files in this pull request and generated 14 comments.
Show a summary per file
| File | Description |
|---|---|
src/lerobot/policies/flow_matching/configuration_flow_matching.py |
Introduces the FlowMatchingConfig dataclass and feature validation/delta index definitions. |
src/lerobot/policies/flow_matching/modeling_flow_matching.py |
Implements the Flow Matching model (vector field net), Euler sampling, and PreTrainedPolicy interface. |
src/lerobot/policies/flow_matching/processor_flow_matching.py |
Adds pre/post-processing pipeline factory for Flow Matching integration with LeRobot processors. |
src/lerobot/policies/flow_matching/README.md |
Documents the new policy module layout. |
src/lerobot/policies/factory.py |
Registers the new config type and processor factory selection. |
src/lerobot/policies/__init__.py |
Exports FlowMatchingConfig in the public policies module. |
tests/policies/flow_matching/test_flow_matching.py |
Adds initial tests for config factory instantiation and basic policy behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Thanks! All review threads are resolved on my side. Could a maintainer please approve workflows so required checks can run? |
624610d to
e6c4003
Compare
|
Thanks for the follow-up review 🙏 I just pushed the latest updates, and the PR is currently blocked by branch protection:
Could a maintainer please help with:
All review comments have been addressed on my side. Thank you! |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Pierson Dong <149588243+DeepforThink@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Pierson Dong <149588243+DeepforThink@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Pierson Dong <149588243+DeepforThink@users.noreply.github.com>
694a946 to
bc2403d
Compare
Type / Scope
Summary / Motivation
This PR introduces a new
flow_matchingpolicy in LeRobot and integrates it into the policy factory and preprocessing pipeline.Motivation:
Related issues
What changed
flow_matchingpolicy module:src/lerobot/policies/flow_matching/configuration_flow_matching.pysrc/lerobot/policies/flow_matching/modeling_flow_matching.pysrc/lerobot/policies/flow_matching/processor_flow_matching.pysrc/lerobot/policies/flow_matching/README.mdFlowMatchingConfiginsrc/lerobot/policies/__init__.pyflow_matchingintosrc/lerobot/policies/factory.py(config + processor paths)tests/policies/flow_matching/test_flow_matching.pymodeling_flow_matching.pyto satisfyruffchecksHow was this tested (or how to run locally)
pre-commiton changed flow-matching files in conda envlerobot(includinggitleaks) — all checks passed.PYTHONPATH= PYTEST_DISABLE_PLUGIN_AUTOLOAD=1 conda run -n lerobot python -m pytest -q tests/policies/flow_matching/test_flow_matching.py2 passed, 1 warning in 0.57sChecklist (required before merge)
pre-commit)pytest)Reviewer notes
Please focus on:
src/lerobot/policies/flow_matching/modeling_flow_matching.py(objective + Euler sampling path)src/lerobot/policies/factory.py(registration and processor integration)tests/policies/flow_matching/test_flow_matching.py(targeted behavioral coverage)