This repository provides an implementation of Focused Reward Transformer (FRT), an advanced model for robot motion skill learning. The FRT improves upon Decision Transformers (DT) by integrating immediate reward mechanisms, optimizing motion control through a balanced approach between long-term planning and real-time adaptation.
To set up the environment, install the required dependencies using:
pip install -r requirements.txt
Additionally, ensure MuJoCo is installed for running simulations.
The architecture consists of three key components:
Reward-Integrated Transformer (RIT): Adds real-time reward sequences into input embeddings.
Reward-Driven Transformer (RDT): Introduces a reward-specific attention block for improved reward learning.

Focused Reward Transformer (FRT): Optimizes reward integration within the self-attention mechanism.
The model was evaluated on three environments:

To train and test the model, run:
python train.py --env Hopper
python train.py --env Walker2d
python train.py --env HalfCheetah
Modify hyperparameters in config.py as needed.

If you use this work, please cite:
@article{FRT2024,
author = {Borui Nan, Xinyi Zheng, Wanru Gong, Lanyue Bi, Xiaoyv Zhu, Xiaoqing Zhu},
title = {Robot Motion Skill Learning Method based on Focused Reward Transformer (FRT)},
journal = {arXiv preprint},
year = {2024}
}
This project is licensed under the MIT License.