Comments (4)
Because there are many nn modules that just expect a tensor. The default behaviour in nngraph is everything is a table of something. You can see here (https://github.com/torch/nngraph/blob/master/gmodule.lua#L171) that non-table inputs are put into a table. It made the logic in the in the rest of the system consistent to assume that every input is a table.
from nngraph.
An alternative consistent implementation could see everything as a nested table.
I.e., the input can be a tensor or a table with other tables or tensors.
from nngraph.
The inconsistency does make trying to understand gmodule.lua quite a lot more complicated than it might otherwise be. Lots of edge-cases and stuff. Would making the nn modules document what they expect as input help? Like:
function Linear:expectsTensor()
return true
end
from nngraph.
I think we have resolved this offline already/
from nngraph.
Related Issues (20)
- clearState() on gModule with moduleFromCriterion does not behave as expected
- One problem with gmodule.lua
- problem in nn-graph installation HOT 4
- how to copy particular layer's weights from pretrained nn.Sequential model to nngraph's particular module? HOT 1
- Questions about reading pretrain model weights in nngraph HOT 1
- How to copy a node from a gmodule to another gmodule? HOT 1
- gradInput is nil when training with multiple GPUs with DataParallelTable HOT 1
- How nngraph works? HOT 1
- luarocks install pl Error: No results matching query were found.
- how to access node in a trained gmodule HOT 4
- how to dump nngraph.node just like dump a table to console or file
- ittermediate feature maps HOT 1
- check output of intermediate layers of a trained nngraph model HOT 2
- Copying weights from one model to another HOT 2
- How to expand a defined nngraph model?
- Automatic tensor type conversion
- How to Convert an nn model to nngraph model HOT 1
- Convert an nngraph model to nn model
- Error: No results matching query were found for Lua 5.3. HOT 1
- installing nngraph via luarocks throws an error
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 nngraph.