uoguelph-mlrg / theano_alexnet

Theano-based Alexnet
BSD 3-Clause "New" or "Revised" License
229 stars 115 forks source link

Results from intermediate stages from ConvPoolLayer #9

Closed tumble-weed closed 9 years ago

tumble-weed commented 9 years ago

Hi any suggestions on how i can obtain the outputs from the convolution-pre-nonlinearity, the nonlinearity, the normalization steps individually?

gwding commented 9 years ago

In train.py line 50, the model is defined. You actually have access to all the layers in model.layers, which is a list. for the layer you want to compute, you can compile a new function using model.layers[i].output as the output of a theano function.

gwding commented 9 years ago

I see, in that case I suggest you do something like self.conv_out = conv_out in the ConvPoolLayer, then you should have that attribute available.

But be aware that the cudaconvnet and cudnn might have some difference in the convlayer.

On 31 May 2015 at 12:26, oogilyboogily notifications@github.com wrote:

yes bu each layer is a composite conv+pool+norm operation, my question is how can i get the result after conv but before pool say.

upon using the python inbuilt dir on an element of this list i get: ['W', 'class', 'delattr', 'dict', 'doc', 'format', ' getattribute', 'hash', 'init', 'module', 'new', 'reduce', ' _reduceex', 'repr', 'setattr', 'sizeof', 'str', 'subclasshook', 'weakref', 'b', 'channel', 'convstride', 'filter_shape', 'filter_size', 'image_shape', 'lib_conv', 'lrn', 'output', 'padsize', 'params', 'poolsize', 'poolstride', 'weight_type']

it would seem that such an intermediate result is not directly accessible from a layer object?

— Reply to this email directly or view it on GitHub https://github.com/uoguelph-mlrg/theano_alexnet/issues/9#issuecomment-107217510 .

tumble-weed commented 9 years ago

Yeah it worked. thanks.