Theano based kernel