New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split up layers/base.py #68
Comments
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 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. |
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 |
Yep, that's the idea. But for specialized stuff like the |
I think that as long as there aren't any namespace conflicts (e.g. a layer with the same name in |
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 The alternative is to What's the best option? We should probably pick one of these and do that consistently across the library. |
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 |
Yes! Let's do that :) |
I'll try to sort this out today. |
This was done in #81. |
nntools.layers
currently has the following structure:corrmm.py
:Conv2DMMLayer
(2D convolution usingGpuCorrMM
)cuda_convnet.py
:Conv2DCCLayer
,MaxPool2DCCLayer
,ShuffleBC01ToC01BLayer
,ShuffleC01BToBC01Layer
(2D convolution and pooling using pylearn2's cuda-convnet wrappers)base.py
: all other layer classes we have__init__.py
: imports*
frombase
and imports the two other submodulesbase.py
is a very long file with several different kinds of layers. I propose to split it up into smaller files that each hold a group of layers that belong together.__init__.py
should still import those layers directly, so one doesn't have to remember which group a layer belongs to. A possible layout might be:base.py:
helper.py:
get_all_*
,set_all_*
?.py: DenseLayer, NINLayer
noise.py: DropoutLayer, GaussianNoiseLayer
conv.py: Conv1DLayer, Conv2DLayer, [Conv3DLayer]
pool.py: MaxPool2DLayer, FeaturePoolLayer, FeatureWTALayer, GlobalPoolLayer
?.py: FlattenLayer, [ReshapeLayer, ReshuffleLayer], PadLayer?
merge.py: ConcatLayer, ElemwiseSumLayer
There are some questions marks, but that's about the grouping I see (some of these groups are already formed in the existing
base.py
, some are a little different). Any comments, refinements, suggestions? Let's try to converge on a good set of categories and split it up!The text was updated successfully, but these errors were encountered: