Ok, please imagine this (pseudocode) setup
data1 = [1,2,3,4,5]
data2_idx = [0,2,4]
data2 = data1[data2_idx]
weights = [-1,-1, 0, 1, 1]
weights2 = weights[data2_idx]
weights_mb = pm.Minibatch(weights, 2)
weights2_idx = pm.Minibatches(weights2, 2)
data1_mb = pm.Minibatch(data1, 2)
data2_mb = pm.Minibatch(data2, 2)
lk1 = pm.Normal('lk1', mu=..., sd=..., observed=data1_mb)
lk2 = pm.Normal('lk2', mu=..., sd=..., observed=data2_mb)
p1 = pm.Potential('weights-for-lk1', weights_mb)
p2 = pm.Potential('weights-for-lk2', weights2_mb)
I think this will go wrong, although I’m not really sure.
The problem I see is that because the minibatches for data1 and data2 are shuffled differently, the can/will end up with different original data rows. For example lk1 might see a value of [1,2] and lk2 might see a value of [1,5]. This leads to potentials of [-1, -1] and [-1, 1], which I think is not what I want. Mixing two different observations with different weights seems to me to lead to problems.
Is it that this special case of mixed observed data and weights is not model able with a Potential?
Do I need to use two different models for this case or is it doable in one?