class_docstr: A handler class for implementing `MixUp` style scheduling
class_docstr_tok: ["A","handler","class","for","implementing","`","MixUp","`","style","scheduling"]
docstr: lf is a loss function that applies the original loss function on both outputs based on `self.lam`
docstr_tok: ["lf","is","a","loss","function","that","applies","the","original","loss","function","on","both","outputs","based","on","`","self.lam","`"]
code: def lf(self, pred, *yb):
      "lf is a loss function that applies the original loss function on both outputs based on `self.lam`"
      if not self.training:
          return self.old_lf(pred, *yb)
      with NoneReduce(self.old_lf) as lf:
          loss = torch.lerp(
              lf(pred, *self.yb1), lf(pred, *yb), self.lam
          )
      return reduce_loss(
          loss, getattr(self.old_lf, "reduction", "mean")
      )
  
imports: from __future__ import annotations
  from ..basics import *
  from torch.distributions.beta import Beta
label_desc: Use image node_id 6 for calling the MixHandler obj's underlying member method code with example usage: obj.lf(pred) and returns: reduce_loss, self