Giter Club home page Giter Club logo

Comments (10)

nicholas-leonard avatar nicholas-leonard commented on August 21, 2024

Check out https://github.com/Atcold/net-toolkit/tree/master . I agree that it would be nice to include this into the core nn repo.

from nn.

ibmua avatar ibmua commented on August 21, 2024

Great, thanks! This one should definitely get included into standart NN package - almost everybody who uses NN needs those more than half of the actual NN package functions anyway.

from nn.

Atcold avatar Atcold commented on August 21, 2024

There is an easier way.
Define model, clone out cleanModel, train model, getParameters from model and copy onto cleanModel's parameters.

from nn.

nicholas-leonard avatar nicholas-leonard commented on August 21, 2024

@Atcold so true! Hadn't thought about it that way. #200 would actually make that quite easy.

from nn.

Atcold avatar Atcold commented on August 21, 2024

Alright @nicholas-leonard, and this

clone = mlp:clone() -- this copies all the parameters and gradParameters
clone:share(mlp,"weight","gradWeight","bias","gradBias") -- this deletes and replaces them

should go into the manual (since I never used shared stuff before and it looks like it would make things easier).

from nn.

nicholas-leonard avatar nicholas-leonard commented on August 21, 2024

Noted.

from nn.

Atcold avatar Atcold commented on August 21, 2024

Great.

from nn.

mys007 avatar mys007 commented on August 21, 2024

I would like to revive this issue with the following suggestion: I propose each module have a special function sanitize() which would clear all temporary variables, including outputs and gradInputs. All other ways of "sanitizing" the model are just hacks which don't handle everything or clean too much; only modules itself can know what's appropriate (encapsulation).
One could even have this in write() method, i.e. serialization would do this automatically, although this might introduce side effects (when serializing to clone or if one wants to really save everything for some reason); nevertheless, in cudnn this is used.
@soumith Could it even get to the Roadmap:)?

from nn.

soumith avatar soumith commented on August 21, 2024

@mys007 Sergey will open a PR for this shortly, he wrote this feature and wrote unit tests when he was interning at Facebook.

from nn.

mys007 avatar mys007 commented on August 21, 2024

I call this programming by thought:).

from nn.

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.