Comments (10)
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.
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.
There is an easier way.
Define model
, clone out cleanModel
, train model
, getParameters
from model
and copy onto cleanModel
's parameters.
from nn.
@Atcold so true! Hadn't thought about it that way. #200 would actually make that quite easy.
from nn.
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.
Noted.
from nn.
Great.
from nn.
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.
@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.
I call this programming by thought:).
from nn.
Related Issues (20)
- How to resume training from a certain epoch or how to update an already trained model in torch ? HOT 1
- Simple neural net has different output for inputs in the same batch that are identical HOT 11
- SpatialDepthWiseConvolution swaps height and width HOT 3
- Strange behavior of nn.Padding during training
- Using nn.Padding throws luajit: C++ exception
- UpSample
- nn.test() fails: Kmeans - invalid arguments (CudaLongTensor)
- Ask a question of nn.SplitTable? HOT 1
- Simple real time object detection using Torch
- ClassNLLCriterion.cu t < n_classes failed.
- Why gradInput of nn.Mul is computed by gradOutput add by weight rather than multiply by weight?
- FastLSTM out of memory error
- parallelcriterion has no length operator
- TripletCriterion (aka triplet loss) missing
- Cannot run Torch train command – NYI stack traceback
- Backprop procedure for nn.Narrow
- install/share/lua/5.1/nn/LookupTable.lua:73: bad argument #3 to 'index' (Tensor | LongTensor expected, got torch.CudaLongTensor)
- Compatibility issues
- same sentence different padding length result different embedding because softmax precision
- BatchNormalization.lua:87: got 32-feature tensor, expected 0 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nn.