Skip to content

Taka-Hashimoto/Simple_TDMPC

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple TD-MPCs

This is an implementation of TD-MPC and TD-MPC2 using JAX/Flax. While the official implementation of TD-MPC2 supports learning multiple tasks, this implementation focuses on simplicity and only supports learning a single task.

Inspired by CleanRL, this implementation is designed to enhance readability by not dispersing the algorithm processing across multiple files, but rather organizing it within a single file to make the algorithmic flow easy to follow.

Execution Results

Here are the test results of training in the DM-Control environment.

Learning Curves

Animations

  • Learning results by TD-MPC
  • Learning results by TD-MPC2

Environment Setup

Follow the steps below to set up the execution environment.

Docker Setup

# Build the image
docker build -t simple_tdmpc .

# Start the container
docker run \
    --gpus all \
    -it \
    --rm \
    -w $HOME/work \
    -v $(pwd):$HOME/work \
    simple_tdmpc:latest bash

Installation of Dependencies

Install dependencies using Poetry.

poetry install

Execution Methods

Running TD-MPC

poetry run python src/tdmpc.py 

Running TD-MPC2

poetry run python src/tdmpc2.py 

Options

  • Adding the --capture_video option allows saving videos of the training process in the /videos folder.

    poetry run python src/tdmpc2.py --capture_video
    
  • The --track option enables recording of experiment logs through wandb.

    poetry run wandb login
    poetry run python src/tdmpc2.py --track --capture_video
    

    If a 'transport failed error' occurs, execute the git config command displayed in the error message.

  • The --task option allows switching the task for training.

    poetry run python src/tdmpc2.py --task 'dm_control/quadruped-run-v0' --total_timesteps 1000000
    

Referenced Repositories

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published