Giter VIP home page Giter VIP logo

Comments (3)

Hananel-Hazan avatar Hananel-Hazan commented on June 2, 2024 2

If I'm not mistaken (I didnt use this part of the code for a long time) the method bindsnet.conversion.ann_to_snn() assume that the given ANN is already fully trained. The result of this method is an equivalent SNN that should perform similarly to the ANN.
The only training here should be performed on the ANN, not the SNN. Therefore, step three is not relevant.

About the PR, if the code work on the main BindsNET, I will be glad if you submit it to this repository, with only one request, you will help in the future to update the code if necessary to new upcoming changes in PyTorch/BindsNET.

from bindsnet.

Hananel-Hazan avatar Hananel-Hazan commented on June 2, 2024

Thank you for using BindsNET.
I'm a little confused, are you training the SNN twice?

The conversion process should be:

  1. Build an ANN using a regular PyTorch module and train it using your favorite gradient descent method.
  2. Building an SNN with the same topology as the ANN from the previous step.
  3. Converting the ANN weights to the equivalent range for SNN from the previous step.
  4. Testing SNN on the testing data.

Note

  1. when the training/conversion process finish, use network. train(mode=False) to freeze the weights.
  2. ANN conversion to SNN should be used only once, running the code twice can lead to unexpected results. If the conversion wasn't successful the first time, some parameters need to be changed, and the process need to be started again.

ps. The script that you are using to convert the network is not updated and is not part of the supported code in BindsNET. The code you are using probably contain some code that needs to be update. With that said, I will be happy to help you use it, and hopefully, you can help by contributing your time to fix some of the small kinks that exist in the BindsNET code.

from bindsnet.

0xnurl avatar 0xnurl commented on June 2, 2024

Thanks Hananel for the very quick reply!

We're not training the SNN twice. We're just using the ANN->SNN conversion as a way to build a deep SNN architecture. We couldn't find an example of a multilayer architecture in your example, so we've been using this method. Does this make sense?

So our process is:

  1. Build multilayer ANN in PyTorch.
  2. Convert to SNN using bindsnet.conversion.ann_to_snn()
  3. Train SNN as in your examples (eth_mnist.py)

So basically this should work right? The problem is that after step 3, the SNN doesn't seem to retain the weights.

Re: unsupported code, yes I'm aware of that and even opened a pull request to update the external script.
However, the conversion module is part of the BindsNET package, so should be supported, right?

Any help would be much appreciated.
Thanks again!

from bindsnet.

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.