added theano machinery, loss and gradient should be working including normalization, but untested