Giter Club home page Giter Club logo

Comments (6)

VinF avatar VinF commented on August 22, 2024

Hi,

To introduce weight normalization (or any other form of normalization such as layer normalization or the usage of SeLu), you would need to modify the neural network (e.g. deer/q_networks/NN_keras.py if you use AC_net_keras). You can then also choose appropriate hyper-parameters that are well suited for the given neural network when you instantiate one of the learning algorithms (or even write your own modifications of the provided learning algorithms).

Hope this helps.

PS: the links you provided do not have the right url.

from deer.

p-ruediger avatar p-ruediger commented on August 22, 2024

I appreciate your quick response!

Honestly, I was hoping that applying weight normalization to the neural network model provided by NN_keras.py would only require to make changes to AC_net_keras.py in ll. 75-82 similar to the changes made in ll. 63-69 of cifar10_cnn.py in the aforementioned example. As you probably noticed, I'm new to Deep RL. Maybe you can point out the reason(s) for why one would have to change NN_keras.py in order to introduce weight normalization.

from deer.

VinF avatar VinF commented on August 22, 2024

Right, in the code you provided they have integrated the normalization in the optimizer instead of modifying the neural network definition. So it should be possible to directly take their optimizers and use it in the learning algorithm (replacing the simple SGD+momentum in AC_net_Keras as you pointed out)

from deer.

p-ruediger avatar p-ruediger commented on August 22, 2024

Thanks for the clarification.

Is normalization and weight normalization in particular something you would like to add to your library at this point? If it is not, you may, of course, feel free to close this issue. Otherwise maybe someone else or I will propose an appropriate implementation and post it here at some point.

Anyway, thanks for your help!

from deer.

VinF avatar VinF commented on August 22, 2024

We have to be sure that the benefit of adding this outweigh the additional complexity in the code and for the user. If it's only a matter of adding an update rule in AC_net_keras.py in ll. 75-82, then maybe ok. But I guess we would need to add the whole weight normalization code in this library...

from deer.

p-ruediger avatar p-ruediger commented on August 22, 2024

Yes, I thought about that, as well. Overall, Weight Normalization might not be worth the additional complexity. One would not only have to add the whole code by OpenAI but also find a solution for the data-dependent initialization. The latter would probably make Weight Normalization only applicable to certain environments or even leave the solution of the initialization problem completely to the user.

Therefore, I decided to go with Batch Normalization for now. The implementation for Keras models is very straightforward and training seems to improve. You are welcome to take a look at my implementation of Batch Normalization for NN_keras.py.

PS: I am not sure if feeding the "training=0" argument to the layer is correct but it seems to work.

from deer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.