Overview

Almond Bot can be trained to perform complex tasks using a combination of data collection and model training. The best way to train Almond Bot is to record training episodes using the Twin and then use those episodes to train a model. We recommend recording 50-100 episodes for each task you want to train with variations in Almond Bot’s starting pose as well as minor variations in the task environment.

Overall, the steps are:

  1. Record training episodes
  2. Train a model
  3. Deploy the model

Record Training Episodes

Once you have the robot in Teleoperation Mode, ideally using the Twin, you can record training episodes by moving the robot and recording the Pose and Joints data.

When recording, you must provide a name for the task and specify the duration of the episode in seconds.

When you’re ready to record, call client.record_episode before every episode. Recording will automatically stop after the specified duration.

# Record Training Episodes

episode = await client.record_episode(task_name="my_task", duration_seconds=10)

To manage your eposides you can use:

  • client.list_episodes(task_name="my_task") to list all episodes
  • client.delete_episode(task_name="my_task", episode_id=episode.id) to delete an episode
  • client.replay_episode(task_name="my_task", episode_id=episode.id) to replay an episode

Train a Model

Once you have recorded enough episodes, you’re ready to train a model using the train_task method.

You must provide a name for the task and a name for the training. The training name is used to identify the training when listing trainings or deleting a training. The model specifies which AIModel to use for training.

Note: Training takes hours to complete.

# Train a Model

training = await client.train_task(task_name="my_task", training_name="my_pi0_training", model=AIModel.P0)

To monitor and manage your trainings you can use:

  • client.list_trainings(task_name="my_task") to list all trainings

Run a Model

After training is complete, you can run a model using the run_task method.

# Run a Model

model = await client.run_task(task_name="my_task", training_name="my_pi0_training")