I don’t see anything wrong with what you’re doing here, or how you’re thinking about it. For many straightforward things you can pretty much use theano as you would numpy, just replace np with tt. Have you tried running this model? Do you get reasonable results?