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

Enable BatchNorm for Keras Model in DDPG Example #246

Merged
merged 16 commits into from
Sep 21, 2020

Conversation

amifunny
Copy link
Contributor

@amifunny amifunny commented Sep 4, 2020

training=True was added to each model call to enable BatchNorm.

examples/rl/ddpg_pendulum.py Outdated Show resolved Hide resolved
examples/rl/ddpg_pendulum.py Outdated Show resolved Hide resolved
@amifunny amifunny requested a review from fchollet September 7, 2020 17:24
"""

"""
After 100 episodes:

![after_img](https://i.imgur.com/eEH8Cz6.gif)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How did the extra whitespace get added? You can remove it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, Many blank lines are added by black.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

black does not add any such blank lines. Let's get rid of them.

  • Start from the original file (on the master branch)
  • Add the training=True statements and modify the "last modified" date
  • Run black ddpg_pendulum.py
  • Commit the file

@amifunny amifunny requested a review from fchollet September 8, 2020 13:36
Copy link
Contributor

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also just remove the added extra space by hand...

Please add the generated files.

@amifunny
Copy link
Contributor Author

Sorry for the late response. Deleted extra lines manually.

Generating files with cmd -
python autogen.py add_example rl/ddpg_pendulum

gave the following error -
Traceback (most recent call last): File "../scripts/autogen.py", line 918, in <module> working_dir=get_working_dir(sys.argv[3]) if len(sys.argv) == 4 else None, File "../scripts/autogen.py", line 212, in add_example assert path.count(os.path.sep) == 1 AssertionError
Can you add it on your part?

@amifunny amifunny requested a review from fchollet September 21, 2020 14:09
Copy link
Contributor

@fchollet fchollet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, I will refresh the files then.

@fchollet fchollet merged commit 90f6f74 into keras-team:master Sep 21, 2020
@fchollet
Copy link
Contributor

FYI batchnorm breaks training entirely so I have removed it.

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