Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update train_agent.md #1237

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

TangLongbin
Copy link

@TangLongbin TangLongbin commented Oct 31, 2024

Description

In train_agent.md, the class BlackjackAgent needs env for initialization, but the demo code is initialized without env which results in errors. I added the parameters and use 'agent.env' instead of 'env' in the training.

No code for post-processing the training log (such as reward, episode length and training error) visualization. It should be average value rather value of each episode (gym.wrappers.RecordEpisodeStatistics only records this) which is not the same as figure provided in the doc. So I add the average value calculation (for later visualization) and the visualization code using matplotlib to help people get the result the expected.

Type of change

Please delete options that are not relevant.

  • Documentation only change (no code changed)

Screenshots

Please attach before and after screenshots of the change if applicable.

Checklist:

  • I have run the pre-commit checks with pre-commit run --all-files (see CONTRIBUTING.md instructions to set it up)
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes

Fixed some one bug (agent initialized without `env`) and add the average value calculation (for later visualization).
@pseudo-rnd-thoughts
Copy link
Member

@TangLongbin Could you summarise what you are fixing or solving in this PR?

@TangLongbin
Copy link
Author

@TangLongbin Could you summarise what you are fixing or solving in this PR?

Sure! I remembered that i added description when pulling the request, but it's gone for some reasons. Sorry for that! I'll explain the modification here:

  • In train_agent.md, the class BlackjackAgent needs env for initialization, but the demo code is initialized without env which results in errors. I added the parameters and use 'agent.env' instead of 'env' in the training.

  • No code for post-processing the training log (such as reward, episode length and training error) visualization. It should be average value rather value of each episode (gym.wrappers.RecordEpisodeStatistics only records this) which is not the same as figure provided in the doc. So I add the average value calculation (for later visualization) and the visualization code using matplotlib to help people get the result the expected.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants