Comments (9)
Looks good to me. I would call the first ? 'dense.py' and the second one 'shape.py' or something. Since these names are not really going to be exposed to the user, they're not really that crucial to get 'right' imo. Short is good :)
On that note, we should probably still make a distinction between the 'base' set of layers, that are available in the nn.layers
namespace, and the more specialized stuff that is only accessible through the submodules (like nn.layers.cuda_convnet
, nn.layers.corrmm
).
I believe all the layers you listed are probably important enough to live in the main namespace, but we'll have to keep this in mind and make a decision when we add in the recurrent layers for example.
from lasagne.
I think splitting up base.py is definitely a good idea, but I'd propose that we give access to all of the layer classes straight from nntools.layers
(e.g. DropoutLayer
would be nntools.layers.DropoutLayer
instead of nntools.layers.noise.DropoutLayer
) - I don't think there will be any namespace conflicts (e.g. something in some layer submodule which is not in another), and I think it will save a lot of typing. I think this is what you just proposed @benanne; I guess what I'm saying is I think all layers are probably important enough to live in the main namespace.
from lasagne.
Yep, that's the idea. But for specialized stuff like the cuda_convnet
and cormm
layers, I don't think it's necessary. Are you saying you think these should also be available in the main namespace?
from lasagne.
I think that as long as there aren't any namespace conflicts (e.g. a layer with the same name in cuda_convnet
and conv
), we may as well put them all in the same namespace.
from lasagne.
I was thinking about doing this quickly, but clearly there are a lot of dependencies between future submodules. How should these be handled?
It seems cleanest to just import those submodules where necessary and use them directly. But this will make the code a bit harder to read, because it is less like 'normal' code that a user would write (i.e. a user would write layers.DenseLayer
, or just DenseLayer
, but never dense.DenseLayer
).
The alternative is to import *
the necessary submodules (since that is what happens in __init__.py
anyway).
What's the best option? We should probably pick one of these and do that consistently across the library.
from lasagne.
I think the best option is yet another way: Importing just the names that are needed, to be explicit about the dependencies. E.g., if the recurrence
module depends on dense.DenseLayer
, it should do from .dense import DenseLayer
. This way the code still reads like 'normal' code, as you called it, and we avoid the namespace mess created by import *
.
from lasagne.
Yes! Let's do that :)
from lasagne.
I'll try to sort this out today.
from lasagne.
This was done in #81.
from lasagne.
Related Issues (20)
- ThinPlateSpline is bugged, proposed fix HOT 2
- Update Lasagne installation doc to new gpuarray backend HOT 3
- AttributeError: 'Conv2DLayer' object has no attribute 'flip_filters' HOT 1
- Theano discontinuation HOT 5
- Where is the GlobalMaxPool2D?? HOT 1
- How to save layer l_out as lasagne layer to network in json or h5 format to be imported from Matlab HOT 1
- how to get the exact value of the tensor variable and its type. HOT 2
- The tremendous different time consuming on mnist between cnn and mlp architecture. HOT 6
- How to put constraint on the weights in each layer. HOT 1
- How to put the constraint on parameters
- AttributeError: 'Conv2DLayer' object has no attribute 'num_groups' HOT 2
- Why the `bcast` is needed in `create_param()`? HOT 2
- rules in setting weights in the combination of conv2d layer and batch norm layer HOT 1
- updates.py HOT 2
- Hi! There are some problems about creating a new layer! HOT 1
- lasagne\layers\base.py HOT 1
- LocallyConnected2DLayer params not initialized correctly HOT 1
- Center Loss as an Objective Function?
- Error with mock in Python 3.8.3 and 3.9 HOT 3
- lasagne isn't running on CUDA (Windows 10) .theanorc setup HOT 2
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 lasagne.