loss#

omnipose.core.loss(self, lbl, y)[source]#

Loss function for Omnipose. :param lbl: transformed labels in array [nimg x nchan x xy[0] x xy[1]]

lbl[:,0] cell masks lbl[:,1] thresholded mask layer lbl[:,2] boundary field lbl[:,3] smooth distance field lbl[:,4] boundary-emphasizing weights lbl[:,5:] flow components

Parameters

y (ND-tensor, float) -- network predictions, with dimension D, these are: y[:,:D] flow field components at 0,1,...,D-1 y[:,D] distance fields at D y[:,D+1] boundary fields at D+1