theano code and explanation