GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ComputationalRobotics/TRAC: This repository is the official implementation of the TRAC optimizer in Fast TRAC: A Parameter-Free Optimizer for Lifelong Reinforcement Learning.

BranchesTags
Open more actions menu

Latest commit

 

History

53 Commits
53 Commits

Folders and files

NameName
Last commit message
Last commit date
.ipynb_checkpoints
.ipynb_checkpoints
 
 
figures
figures
 
 
logs
logs
 
 
package
package
 
 
vision_exp
vision_exp
 
 
.DS_Store
.DS_Store
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 
main.ipynb
main.ipynb
 
 
requirements.txt
requirements.txt
 
 
trac.py
trac.py
 
 

Repository files navigation

TRAC: Adaptive Parameter-free Optimization āš”ļø

Open In ColabarXiv Open In ColabPypi

This repository is the official implementation of the TRAC optimizer in Fast TRAC: A Parameter-Free Optimizer for Lifelong Reinforcement Learning.

How can you quickly adapt to new tasks or distribution shifts? Without knowing when or how much to adapt? And without ANY tuning? šŸ¤”šŸ’­

Well, we suggest you get on the fast TRAC šŸŽļøšŸ’Ø.

TRAC is a parameter-free optimizer for continual environments inspired by online convex optimization and uses discounted adaptive online prediction.

Update [05/02/25]: TRAC Torch supports saving and loading trac states

Update [08/20/24]: TRAC is now supported for JAX and Optax!

Implement with only one line change with both PyTorch/JAX!

Like other meta-tuners, TRAC can work with any of your continual, fine-tuning, or lifelong experiments with just one line change.

pip install trac-optimizer

PyTorch

from trac_optimizer import start_trac
# original optimizer
optimizer = torch.optim.Adam
lr = 0.001
optimizer = start_trac(log_file='logs/trac.text', optimizer)(model.parameters(), lr=lr)

JAX

from trac_optimizer.experimental.jax.trac import start_trac
# original optimizer
optimizer = optax.adam(1e-3)
optimizer = start_trac(optimizer)

After this modification, you can continue using your optimizer methods exactly as you did before. Whether it's calling optimizer.step() to update your model's parameters or optimizer.zero_grad() to clear gradients, everything stays the same. TRAC integrates into your existing workflow without any additional overhead.

Control Experiments

We recommend running main.ipynb in Google Colab. This approach requires no setup, making it easy to get started with our control experiments. If you run locally, to install the necessary dependencies, simply:

pip install -r requirements.txt

Control Experiment

Vision-based RL Experiments

Our vision-based experiments for Procgen and Atari are hosted in the vision_exp directory, which is based off this Procgen Pytorch implementation.

To initiate an experiment with the default configuration in the Procgen "starpilot" environment, use the command below. You can easily switch to other game environments, like Atari, by altering the --exp_name="atari" parameter:

python vision_exp/train.py --exp_name="procgen" --env_name="starpilot" --optimizer="TRAC" --warmstart_step=0

Game 1 Game 2 Game 3

About

This repository is the official implementation of the TRAC optimizer in Fast TRAC: A Parameter-Free Optimizer for Lifelong Reinforcement Learning.

Resources

Readme
MIT license
Activity
Custom properties

Stars

36 stars

Watchers

2 watching

Forks

7 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800Ɨ600. No cookies required.