cgt icon indicating copy to clipboard operation
cgt copied to clipboard

Loading pre-trained models, e.g. VGG

Open joschu opened this issue 9 years ago • 2 comments

It would be nice to be able to load well-known pre-trained models like VGG and GoogLeNet into CGT data-structures. There's a half-written script for loading Caffe prototxt files, called caffe2cgt.py. For VGG, all of the operations are already implemented, whereas some of the other models involve "local response normalization" layers that are not yet implemented.

joschu avatar Sep 01 '15 21:09 joschu

I think the general consensus is that local response normalization is sort of pointless. To the best of my knowledge people aren't really using this anymore. That said, if you want to reproduce existing models exactly I guess you have no choice but to implement it. It's just a bit unfortunate to be spending valuable development time on stuff like this :)

We have a pure-Theano implementation in Lasagne: https://github.com/Lasagne/Lasagne/blob/master/lasagne/layers/normalization.py#L47 That should translate to CGT fairly well, I assume! It's not the fastest, but maybe it'll save you some time.

benanne avatar Sep 01 '15 22:09 benanne

That's interesting to hear that LRN is not considered to be important anymore, and thanks for the pointer to the Lasagne code.

I was also thinking about implementing the cross-channel LRN with a matrix multiplication (after permuting the axes so that channels are last) and the 2D neighborhood version as im2col + matrix multiplication.

joschu avatar Sep 02 '15 01:09 joschu