I have a semi-supervised problem as follows:
I only know ground-truth for batches of examples, e.g. for batch 1 with examples b1=(e1,e2,…) there should be at least one high value from the outputs o1=(o1,o2,…) while for batch 2 there shouldnt be any high outputs.  Is there a way to setup a per-batch loss such as
L=(max(o1,o2,...)-E(b))**2
or
L=E(b)*log(max(o1,o2,...)
or the like, where E is the known expectation for batch b?
At inference time I’d like to send instances and not batches, to get back  individual outputs- so I blv each example must generate a prediction.