Pooling layer to act as sum of squares function layer

95 views
Skip to first unread message

Fábio Ferreira

unread,
Mar 9, 2016, 10:26:40 AM3/9/16
to Caffe Users
Hi,

is there a way to change the type of a Pooling layer to other than "MAX", "AVE" or "STOCHASTIC"? I'd like to apply the square pool 'technique' described in the paper 'On Random Weights and Unsupervised Feature Learning' (Andrew M. Saxe et. al., Stanford). It describes it as follows: the calculated outputs of an upper convolutional layer are squared and summed instead of, for example, maxed in a max pool layer and then given to the next layer.

If there's no such parameter setting the Pooling layer to act as such a function, how can this be best implemented in caffe? I checked the caffe documentation on layers and the only thing that came close to what I was looking for, was the "Sum-of-Squares / Euclidean" layer (which is a loss layer). However, this mentioned layer takes two inputs and I don't know about the effects of using a loss layer in my case (or more general: in the middle of a network).

Thanks in advance for constructive answers.

P.S.: I'm new to caffe.

Jan

unread,
Mar 9, 2016, 11:04:39 AM3/9/16
to Caffe Users
You could implement that as a pooling layer type. It shouldn't be too hard. Take a look at the code of the pooling layer to see how pooling is done, then try to adjust it.

Jan

Christopher Reale

unread,
Mar 9, 2016, 11:51:11 AM3/9/16
to Caffe Users
You could use a Power layer to square all values followed by an average pooling layer to sum all values. You could then use another Power layer to scale from mean square to sum of squares.
Reply all
Reply to author
Forward
0 new messages