Teano uses a workaround for a three-dimensional convolutional neural network (CNN) using a variation on a two-dimensional CNN:
https://github.com/Theano/Theano/blob/master/theano/tensor/nnet/conv3d2d.py
He relies on the ability to capture the diagonal of the matrix and change it. On the website above:
So the relevant part of `x` is some matrix `u`. Suppose it has 7 rows and 4 columns:: [ 0 0 0 0 ] [ 0 0 0 0 ] [ 0 0 0 0 ] [ 0 0 0 0 ] [ 0 0 0 0 ] [ 0 0 0 0 ] The view returned by this function is also a matrix. It is a thick, diagonal `stripe` across u that discards the lower left triangle and the upper right triangle: [ x 0 0 0 ] [ xx 0 0 ] [ xxx 0 ] [ 0 xxx ] [ 0 0 xx ] [ 0 0 0 x ] In this case the return value would be this view of shape 3x4. The returned view has the same number of dimensions as the input `x`, and the only difference is that the shape along dimension `i0` has been reduced by `shape[i1] - 1` because of the triangles that got chopped out.
Can this be done in Tensorflow? This seems like a relatively easy task that can still use the vast majority of Tensorflow CNN structures when processing 3D data types.
source share