DCT/IDCT layers of ACDC (C and C^{-1} in the acronym) from https://github.com/mdenil/acdc-torch for the CPU, ported to Theano and based on the original code (M.Moczulski, M. Denil, J. Appleyard, N. de Freitas, "ACDC: A Structured Efficient Linear Layer", http://arxiv.org/abs/1511.05946 ). libfftw3 is required: http://www.fftw.org/ .