HandyRL icon indicating copy to clipboard operation
HandyRL copied to clipboard

Replay Buffer

Open Chandanpanda opened this issue 2 years ago • 2 comments

Many thanks for the great code. I have a question.

How do I insert into the replay buffer? For example, I want to use other agents or random or rule based agents actions=>experience into the replay buffer, especially in the beginning.

Chandanpanda avatar Jun 23 '23 04:06 Chandanpanda

Hi @Chandanpanda

Thank you for using HandyRL. I'll provide you with some helpful information.

  1. How to mix rule-based agents or pre-trained agents into the replay buffer in a football competition:

You can find some codes for selecting the model to send to generation.py inside the worker.py at the following link, but please note that the code at this time may have differences from the latest version of HandyRL:

https://github.com/YuriCat/TamakEriFever/blob/master/handyrl_core/worker.py#L58-L92

  1. How to perform both supervised learning and reinforcement learning simultaneously:

You can refer to the following link for an example of performing both supervised learning and reinforcement learning using the same buffer in HandyRL. Prepare the training data and set the replay_rate in the config. Load the training data to be used by the Replayer class and select the replay data to be used for training in _select_record():

https://github.com/YuriCat/HandyRL/compare/develop...feature/train_with_replay_same_buffer_simplest

We provide HandyRL as a code base, allowing for customization with minimal code. If you have developed good code, we encourage you to submit a pull request to the HandyRL repository!

ikki407 avatar Jun 23 '23 15:06 ikki407

This is fantastic information! I will review these. Thanks for the prompt response. Regards,Chandan

Sent from Yahoo Mail on Android

On Fri, Jun 23, 2023 at 21:04, Ikki @.***> wrote:

Hi @Chandanpanda

Thank you for using HandyRL. I'll provide you with some helpful information.

  • How to mix rule-based agents or pre-trained agents into the replay buffer in a football competition:

You can find some codes for selecting the model to send to generation.py inside the worker.py at the following link, but please note that the code at this time may have differences from the latest version of HandyRL:

https://github.com/YuriCat/TamakEriFever/blob/master/handyrl_core/worker.py#L58-L92

  • How to perform both supervised learning and reinforcement learning simultaneously:

You can refer to the following link for an example of performing both supervised learning and reinforcement learning using the same buffer in HandyRL. Prepare the training data and set the replay_rate in the config. Load the training data to be used by the Replayer class and select the replay data to be used for training in _select_record():

@.***/train_with_replay_same_buffer_simplest

We provide HandyRL as a code base, allowing for customization with minimal code. If you have developed good code, we encourage you to submit a pull request to the HandyRL repository!

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

Chandanpanda avatar Jun 23 '23 16:06 Chandanpanda