Help to model a difficult logistic regression model with minibatches

My pymc formulation sums the batch over all pixels, so the model is still the same. However, yes, I might have problems of sparsity…

Mhh I am not familiar with these models, let me check and understand! Thank you!