Giter VIP home page Giter VIP logo

Comments (11)

k-chaney avatar k-chaney commented on May 18, 2024 2

@sharath @djsaunde Has there been any movement on this? If not it is something I can crank out rev 1 of this week. I will probably first look into subclassing torch.nn.Module as it would provide the most functionality for the least work. Some benefits to exploit out of the box:

  1. .to(device) will allow for management of devices directly
  2. saving of Networks and torch.nn.Modules together (e.g. a reservoir type setup as in examples/mnist/minimal_reservoir.py)
  3. this enable the use of the full pytorch data loading pipeline with pin_memory enabled which provides asynchronous transfer to the gpu

from bindsnet.

djsaunde avatar djsaunde commented on May 18, 2024 1

from bindsnet.

k-chaney avatar k-chaney commented on May 18, 2024 1

@djsaunde so I've put some initial work into this. I need to check why the tests are failing on the build server. However, this should give you an initial look into how it could work. Almost everything utilizes the buffer functionality in torch.nn.Module, except for the weights and biases which are Parameters without gradients. I haven't migrated the Network to inherit from torch.nn.Module yet as I'm still thinking about how the Monitors will play out.

from bindsnet.

k-chaney avatar k-chaney commented on May 18, 2024 1

register_buffer just registers a tensor to be tracked by pytorch to help with to() and state_dict(), so there's no real performance hit here.

The only reason would be to keep __init__.py as strictly management of the submodule, which is traditionally what I've kept __init__.py for. This would be more philosophy of design for bindsnet than anything else.

I think this would be a good feature, something I've been thinking about as I've been writing more code as well. But is definitely out of scope for this.

from bindsnet.

djsaunde avatar djsaunde commented on May 18, 2024

Hey @sharath, any movement on this feature?

from bindsnet.

sharath avatar sharath commented on May 18, 2024

@djsaunde I'll work on this soon.

from bindsnet.

djsaunde avatar djsaunde commented on May 18, 2024

@k-chaney it'd be great if you could take a look at this. I think the preferred approach is having Nodes, Connections, and Network objects subclass torch.nn.Module, like you said.

from bindsnet.

Hananel-Hazan avatar Hananel-Hazan commented on May 18, 2024

I think @sharath will be occupied this week.
Feel free to start on it.

from bindsnet.

djsaunde avatar djsaunde commented on May 18, 2024

Great! The code changes look good so far. Do you think it will have any impact on runtime performance? What exactly does register_buffer do?

One thing I'm a little wary of is migrating the Network code to bindsnet.network.network; that seems a little redundant, and it might be better to keep it in the __init__.py file. Unless there's a good reason not to?

It may be interesting to optionally keep gradients for "smoothed" versions of nodes / topology objects (i.e., without discontinuities), but that will probably be better off as future work.

from bindsnet.

k-chaney avatar k-chaney commented on May 18, 2024

@djsaunde what's the best way to look at the travis log? All of the tests pass for me locally. (nevermind I found the link to the travis-ci website)

from bindsnet.

k-chaney avatar k-chaney commented on May 18, 2024

This has been initially completed in #266

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.