Suppose I have a complex neural network giving four parameters `mu, precision, alpha, beta`

, which may be fixed for all training, learned during training or varying for each batch, such as:

```
X,Y = next_batch(data)
(mu,precision,alpha,beta) = ComplexNN(X)
```

Then I have `Parent := NormalInverseGamma(mu,precision,alpha,beta)`

, `Q := Normal(mean, variance)`

, and `P := Normal(mean_prior, variance_prior)`

. Where `(mean, variance) ~ Parent`

and `target ~ Q`

. The `target`

samples will be used by some other task which has itâ€™s own loss. How could I perform the training with `L = LogLikelihood(Q,Y) - DKL(Q,P) + other_task_loss`

?