Skip to content

Conversation

@fracapuano
Copy link
Collaborator

@fracapuano fracapuano commented Oct 22, 2025

Part of PR stack (the lower, the closer to main)

What this does

The tutorial will be released very shortly (~tomorrow), and this PR adds the examples I have added in it to the library. Happy to tweak them, although they have all been tested end-to-end for functionality! Together with the behavior conversion and tutorial, I hope this is a good step towards making the library more hackable (and researcher friendly, 😉!)

FYI, I won't be able to change these examples in the tutorial but for second edition. That can be released soon (TBD), and I'd be happy to add there whatever ends up landing on main

fracapuano and others added 6 commits October 23, 2025 00:28
* fix: expose a function explicitly building a frame for inference

* fix: first make dataset frame, then make ready for inference

* fix: reducing reliance on lerobot record for policy's ouptuts too

* fix: encapsulating squeezing out + device handling from predict action

* fix: remove duplicated call to build_inference_frame and add a function to only perform data type handling (whole conversion is: keys matching + data type conversion)

* refactor(envs): add custom-observation-size (#2167)

* fix: add MockMotorBus to MockRobot

* rl: first drafts

* add: all components of HIL SERL

* fix: actor block works

* fix: less friction, less friction

* add: hil-serl complete example

* fix: dataset names

* fix: restructuring example folder

* fix: act works but found bug in how ACT works

* fix: same path for both pre and postprocessors

* fix: paths

* add: example usage for act

* add: using ACT example

* fix: training examples

* fix: using examples

* fix: camera index

* fix: rename workflows into tutorial so that the path of the files is lerobot/examples/tutorial/...

* fix: upload everything in one repo

* fix: model name

* fix: simplify model path

* add: VLAs example

---------

Signed-off-by: Francesco Capuano <[email protected]>
Copilot AI review requested due to automatic review settings October 22, 2025 23:25
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds tutorial examples demonstrating how to use and train various LeRobot policies, including ACT, Diffusion, PI0, SmolVLA, reward classifiers, HIL-SERL reinforcement learning, and asynchronous inference. These examples are designed to accompany an upcoming tutorial release and make the library more accessible to researchers and users.

Key changes:

  • Addition of complete code examples for policy inference and training
  • Implementation of HIL-SERL dual-buffer RL system with reward classifiers
  • Examples for asynchronous inference using client-server architecture

Reviewed Changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
examples/tutorial/act/act_training_example.py Training example for ACT policy
examples/tutorial/act/act_using_example.py Inference example for ACT policy
examples/tutorial/diffusion/diffusion_training_example.py Training example for Diffusion policy
examples/tutorial/diffusion/diffusion_using_example.py Inference example for Diffusion policy
examples/tutorial/pi0/using_pi0_example.py Inference example for PI0 policy
examples/tutorial/smolvla/using_smolvla_example.py Inference example for SmolVLA policy
examples/tutorial/rl/reward_classifier_example.py Training example for reward classifier
examples/tutorial/rl/hilserl_example.py HIL-SERL reinforcement learning example
examples/tutorial/async-inf/robot_client.py Asynchronous inference client example
examples/tutorial/async-inf/policy_server.py Asynchronous inference server example
actor_learner_example.py Comprehensive actor-learner example with reward classifier testing

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@fracapuano fracapuano self-assigned this Oct 22, 2025
@fracapuano fracapuano changed the title Feat/api examples Add API Examples Oct 22, 2025
@imstevenpmwork imstevenpmwork self-requested a review October 23, 2025 10:34
@imstevenpmwork imstevenpmwork added examples enhancement Suggestions for new features or improvements labels Oct 23, 2025
Copy link
Collaborator

@imstevenpmwork imstevenpmwork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks !

@imstevenpmwork imstevenpmwork merged commit 326aca0 into main Oct 23, 2025
9 checks passed
@imstevenpmwork imstevenpmwork deleted the feat/api-examples branch October 23, 2025 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Suggestions for new features or improvements examples

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants