Adding a new operator for an objective which involves gradients

@ferrine should be able to help you. But likely it is related to clone when you are setting up approx.logq

Also, side note you should replace the two for loop with theano.scan for performance.