Skip to content

Training Policies

Use Adamo to fine-tune a base policy on your datasets and deploy it to your robot in a few lines of code, all on Adamo’s hosted GPUs. Inspect your runs on the Training page and manage your weights on the Policies page.

import adamo
episodes = adamo.Recordings().list(folder="yam-london", tasks=["StackCubes"])
dataset = adamo.Dataset(episodes, adamo.Export(
state=["left/joint_pos", "right/joint_pos"],
action=["left/joint_cmd", "right/joint_cmd"],
tasks={"StackCubes": "stack four cubes"},
images=["zed.left", "wrist_left", "wrist_right"],
))
with adamo.Training(base_model="physical-intelligence/pi0.5", lora_rank=32, name="my-fine-tuned-policy") as training:
for step, data in zip(range(3000), dataset.batches(training, batch_size=32)):
training.forward_backward(data, loss_fn="flow_matching")
training.optim_step(adamo.AdamParams(learning_rate=2.5e-5))
weights = training.save_weights("my-fine-tuned-policy/final", ttl_seconds=30 * 24 * 3600).result()
with adamo.Robot(name="yam-london") as robot:
with robot.inference(weights.path, prompt="stack four cubes") as run:
run.wait()

The training loop runs in your script, so you control every step. See Cloud Inference to run the policy on your robot.

adamo.Dataset(recordings: list[RecordingInfo], export: Export, cache_ttl_seconds: int | None = 86400, decoders: dict[str, Struct] | None = None, save_folder: str | None = None)

Train on your recordings without downloading them. adamo.Dataset builds a training dataset from recordings made with Adamo. It is the same dataset as Recordings.export with format="lerobot", built on Adamo compute.

It returns at once and builds in the background, so a Training started meanwhile gets its GPU during the build. result() waits for the build.

Training caches the dataset next to its GPUs, so later runs start without downloading it again. The cache expires cache_ttl_seconds after its last use, and counts towards your organization’s storage.

Binary topics need an adamo.Struct decoder: decoders={"proprioception/joints": adamo.Struct(">8x14f")}.

MemberDescription
batches(training, batch_size)An endless iterator of Datum lists, with frames drawn at random.
result(timeout=None)Waits until the dataset is built. Raises why the build failed.
frame_rate, frame_count, episode_count, idWhat was built.

Choose which cameras the policy sees, and in which order. Export(images=...) names the cameras each example holds. Use a track’s name for its whole picture. Add .left or .right to a side-by-side stereo track for one eye:

images=["wrist_left", "wrist_right", "zed"] # zed: (1080, 3840, 3), both eyes in one picture
images=["wrist_left", "wrist_right", "zed.left"] # zed.left: (1080, 1920, 3)
images=["wrist_left", "wrist_right", "zed.left", "zed.right"] # each eye as its own picture

Without images, every camera track is kept whole.

  • The base model resizes each picture to its input size. A whole stereo picture squeezes both eyes into one input, so prefer one or two eye keys.
  • Use .left and .right only on side-by-side tracks. A stereo pair sent as two eye tracks needs no suffix: images=["head_left", "head_right"].
  • Choosing an eye costs nothing: the dataset keeps the recorded video, and the worker crops each frame.
  • robot.inference crops the same eye from the live track, so a policy trained on zed.left runs on a robot that sends the whole zed track.

A Datum is one training example. To train on data you did not record with Adamo, build each Datum yourself from arrays, so any data loader works:

with adamo.Training(base_model="physical-intelligence/pi0.5") as training:
training.compute_norm_stats(episode_arrays)
for images, states, prompts, actions in loader:
data = [
adamo.Datum(
model_input=adamo.ModelInput(images={"top": image}, state={"proprioception/joints": state}, prompt=prompt, frame_rate=30),
loss_fn_inputs={"control/joint_cmd.positions": chunk},
)
for image, state, prompt, chunk in zip(images, states, prompts, actions)
]
training.forward_backward(data)
training.optim_step(adamo.AdamParams(learning_rate=2.5e-5))

compute_norm_stats(episode_arrays, fraction=1.0) sends the state and action values of your episodes, each a {key: (frame_count, size) array}, so the worker computes the base model’s normalization stats. Call it before the first forward_backward. An adamo.Dataset does this for you.

InputShapeTypeNotes
images[key](height, width, 3)uint8, floats in 0..1, or PNG or JPEG bytesPNG and JPEG bytes are usually smaller to send.
state[key](size,)floatsRaw values, such as radians.
loss_fn_inputs[key](training.action_horizon, size)floatsRaw actions of this frame and the next ones. Where an episode ends sooner, repeat its last action.
promptstrThe task.
frame_rateintFrames per second of the state and actions.
  • Keys are the robot’s track and topic names. Saved weights keep them, so robot.inference knows what to read and where to publish.
  • A run keeps one set of keys and one frame rate. A datum with other keys raises.
adamo.Training(base_model: str, lora_rank: int | None = None, seed: int | None = None, embodiment: Embodiment | None = None, name: str | None = None, tags: list[str] = [], regions: list[str] = [])

You write the training loop, so you control the batches, the learning rate schedule and when to save. Training starts a training run and waits until its worker has a GPU and has loaded the base model. Leaving the with block or calling training.stop() frees the GPU.

Pick the base model closest to your robot and task:

Base modelModelAction chunkDefault embodiment
physical-intelligence/pi0.5Physical Intelligence’s pi05_base.50 stepsRequired
physical-intelligence/pi0.5-droidPhysical Intelligence’s pi05_droid, pi0.5 fine-tuned on DROID for the Franka. Its actions are 7 joint velocities and a gripper position.15 steps7 Joints, then a Gripper
physical-intelligence/pi0.5-liberoPhysical Intelligence’s pi05_libero, pi0.5 fine-tuned on the LIBERO sim.10 stepsLIBERO’s arm, below
robocurve/pi0.5-yampi0.5 fully fine-tuned by robocurve on AllenAI’s MolmoAct2 bimanual YAM data. Gemma license.16 stepsadamo.BimanualArms()
nvidia/GR00T-N1.7NVIDIA’s GR00T N1.7 3B.40 stepsRequired
abc/dit-bottlesABC-DiT trained to put plastic bottles in a bin.30 stepsadamo.BimanualArms()
allenai/MolmoAct2AllenAI’s MolmoAct230 stepsRequired
allenai/MolmoAct2-BimanualYAMMolmoAct2 fine-tuned by AllenAI on bimanual YAM data. Apache 2.0.30 stepsadamo.BimanualArms()
allenai/MolmoAct2-DROIDMolmoAct2 fine-tuned by AllenAI for the DROID Franka. Apache 2.0.15 steps7 Joints, then a Gripper
allenai/MolmoAct2-SO100_101MolmoAct2 fine-tuned by AllenAI for SO-100/101. Apache 2.0.30 steps5 Joints, then a Gripper
black-forest-labs/flux-3-action-baseBlack Forest Labs’ FLUX 3 Action world action model, with new action heads for your robot. It learns from the frames each action leads to, so it trains only on dataset.batches, with 1 to 3 cameras and as many state values as action values. FLUX Kommunity License.33 steps, of which it learns the first 32Required
openwam/OpenWAM-AlphaThe pretrained OpenWAM-α world-action model. Apache 2.0.32 stepsRequired
runwayml/praxis-1-droidRunway’s Praxis-1 world action model fine-tuned on DROID for the Franka. Its state and actions are the poses and gripper runwayml/praxis-1-droid reads and sends. It learns from the frames of a whole window of 4 chunks, so it trains only on dataset.batches at 15 Hz. Apache 2.0.93 stepsA 7-value end-effector Controls, then a Gripper
runwayml/praxis-1-yamPraxis-1 fine-tuned by Runway for bimanual YAM. Its state and actions are the poses and grippers runwayml/praxis-1-yam reads and sends. It trains only on dataset.batches at 15 Hz. Apache 2.0.93 stepsEach arm’s 7-value end-effector Controls and Gripper, left then right

OpenWAM learns to predict the video of the 32 frames after each datum along with its actions, so it trains only on datums from an adamo.Dataset, whose images point at recorded frames. It sees up to three cameras, a main camera then two wrist cameras. It was pretrained on end-effector poses, and each arm’s joints take the slots of its arm’s pose, so the first steps start further from the pretrained robot than with the other models. lora_rank sets the adapters of its video and action models.

abc/dit-bottles trains all of its weights and ignores lora_rank. The other base models train LoRA adapters of rank lora_rank, 32 when left out, 16 for Praxis-1.

embodiment describes the robot’s state and action vectors, part by part, in order. It defaults to the robot the base model was trained for.

embodiment = adamo.Embodiment({"arm": adamo.Joints(7, side="right"), "gripper": adamo.Gripper(side="right")})

side, "left" or "right", lets a base model start from a pretrained robot with the same parts.

A vehicle such as a forklift is driven by commands, not joint targets. Describe them with adamo.Controls: the model predicts them as absolute values, and since no pretrained robot has them, it learns them from scratch.

When the robot observes something other than what it commands, pass state and action instead of one set of parts. Each vector then holds only its own parts, so nothing is padded with zeros. Here the forklift reads 16 sensor values and is driven by 12 joystick commands:

embodiment = adamo.Embodiment(state={"sensors": adamo.Controls(16)}, action={"joystick": adamo.Controls(12)})

A datum’s state then has a sensors entry, and its loss_fn_inputs a joystick entry. Parts passed as the first argument appear in both vectors, before the ones passed to state and action.

physical-intelligence/pi0.5-libero is one of these: the LIBERO arm reads its end-effector pose and two finger positions, and is driven by end-effector deltas and a gripper command. Its default embodiment is:

embodiment = adamo.Embodiment(state={"end_effector": adamo.Controls(6), "fingers": adamo.Gripper(2)}, action={"end_effector_delta": adamo.Controls(6), "gripper": adamo.Gripper()})

seed sets the adapters’ initial weights, the training noise and the frames dataset.batches(training, ...) draws, so two runs with the same seed train on the same data. name and tags label the run on the Training page. A / in name groups runs into folders there: pi0.5/stack-cubes sits in the pi0.5 folder.

To control the region of your training worker, use regions: regions=["uk", "eu", "global"] tries London, then Europe, then anywhere. The region names are listed in Choosing the region.

MethodReturnsDescription
forward_backward(data, loss_fn="flow_matching")ForwardBackwardOutputAdds the gradients of a list of Datum to the run’s gradient sum. .loss is the mean loss of the call. .metrics["example_count"] counts the datums since the last optim_step.
optim_step(adam_params)NoneApplies AdamW to the mean of the summed gradients and clears them.
save_weights(path, ttl_seconds=None, override=False, tags=[])ModelWeightsSaves the weights for robot.inference.
save_state(path, ttl_seconds=None, override=False, tags=[])ModelWeightsSaves the weights and the optimizer state, to resume training.
Training.from_state(path, name=None, tags=[], regions=[])TrainingStarts a run from a saved state.
action_horizonintThe steps in one action chunk of the base model.

Several forward_backward calls before one optim_step act as one larger batch. "flow_matching" is the only loss function.

AdamParams(learning_rate, beta1=0.9, beta2=0.95, eps=1e-8, weight_decay=1e-10, grad_clip_norm=1.0) holds the optimizer settings of one step, so the learning rate can follow any schedule. grad_clip_norm=0 turns clipping off.

Every method returns immediately with a future. The worker runs calls in the order they were made, so don’t wait on each step: while the GPU trains on one batch, the worker loads the next. To follow the loss, keep the futures and read them every few steps:

in_flight = []
for step, data in zip(range(3000), dataset.batches(training, batch_size=32)):
in_flight.append(training.forward_backward(data, loss_fn="flow_matching"))
training.optim_step(adamo.AdamParams(learning_rate=2.5e-5))
if (step + 1) % 10 == 0:
print(step + 1, sum(future.result().loss for future in in_flight) / len(in_flight))
in_flight.clear()
  • result(timeout=None) waits for the result. A timeout raises TimeoutError and leaves the call running.
  • In async code, use forward_backward_async, optim_step_async, save_weights_async and save_state_async, then await future.result_async().
  • Once a forward_backward or optim_step fails, no later call runs, and their futures say which call failed. A failed save stops nothing.

Keep your script running: the SDK checks in with the worker every 30 s, and a run whose client is gone for 10 minutes ends. Anything not saved by then is lost.

MethodUse it to
save_weightsRun the policy on a robot with robot.inference.
save_stateResume training. It saves the optimizer state with the weights, and robot.inference runs it too.

Save a state every few hundred steps, and resume from the latest one after a crash or a lost connection:

# save
if (step + 1) % 500 == 0:
training.save_state(f"my-fine-tuned-policy/step-{step + 1}")
# resume
with adamo.Training.from_state("my-fine-tuned-policy/step-1500") as training:
...

Each save returns a ModelWeights:

weights = training.save_weights("my-fine-tuned-policy/final").result()
print(weights.path) # my-fine-tuned-policy/final
print(weights.expires_at) # None: kept forever

A path is any name you choose, unique in your organization. A / groups saves into folders on the Policies page, so name a run’s saves after it: my-fine-tuned-policy/step-1500 and my-fine-tuned-policy/final sit in the my-fine-tuned-policy folder. Saving at a taken path asks you to confirm, and raises FileExistsError without a yes. override=True replaces it without asking.

Saves are kept for ttl_seconds, or forever with ttl_seconds=None. tags label them on the Policies page.