conv1d

113 views
Skip to first unread message

skaaes...@gmail.com

unread,
Feb 11, 2015, 11:31:45 AM2/11/15
to lasagn...@googlegroups.com
Hi

What is the difference between the 1d convolutions in lasagne?


sc, mc0, mc1 ?

What would be fastest to use for filters of length ~20

best regards Søren

Sander Dieleman

unread,
Feb 11, 2015, 6:12:51 PM2/11/15
to lasagn...@googlegroups.com, skaaes...@gmail.com
They should be equivalent but obviously they are all different implementations.

The sd/md versions convert a convolution into multiple dot products and are only suitable for short filter lengths. 20 is probably excessive for this, they've worked fine for me up to 8 though.

So you probably want sc, mc0 or mc1. These all use conv2d under the hood, discarding one of the dimensions. The difference between them is which dimension they discard: sc discards the channel dimension (sc for "single channel"), and the mc ones discard height and width respectively. Try them all in combination with your favourite convolution backend, and use the one that's fastest :)

Sander

Jack Kelly

unread,
Feb 12, 2015, 5:34:01 AM2/12/15
to lasagn...@googlegroups.com, skaaes...@gmail.com
Søren, sorry to jump in but I'm a big fan of your & Colin Raffel's work on implementing LSTMs in Lasagne.  I had to be nosey and ask... are you thinking of using conv1d to implement a "hierarchical subsampling LSTM" (chapter 9 in Alex Grave's 2012 book on "Supervised Sequence Labelling with RNNs")?  I was planning to have a go at implementing an HSLSTM tomorrow using your and craffel's LSTM code, along with Lasagne's conv1d to handle the convolutions in the time dimension but if you've already done it then that would be awesome ;)

pch...@gmail.com

unread,
Apr 21, 2015, 11:32:19 PM4/21/15
to lasagn...@googlegroups.com, skaaes...@gmail.com
HI Jack,

Do you have a simple example of using conv1d in Lasagne ? Appreciate if you can share some working snippets.
Thanks.

Patrick

Jack Kelly

unread,
Apr 22, 2015, 11:11:26 AM4/22/15
to lasagn...@googlegroups.com, pch...@gmail.com, skaaes...@gmail.com
@Patrick sure, here's a quick example of using Conv1D between two recurrent layers:

https://github.com/JackKelly/nntools/blob/master/examples/recurrent_subsampling.py

That example is a little silly because convolving in the time axis isn't very useful in that example.  But it runs.
Reply all
Reply to author
Forward
0 new messages