angelolab / Nimbus

Other
12 stars 1 forks source link

Training tweaks (grokking training scheme, selective loss function and label smoothing) #21

Closed JLrumberger closed 2 years ago

JLrumberger commented 2 years ago

Instructions

In order to get a good baseline model a few tweaks need to be implemented:

Relevant background

This just adds a few tweaks that are known to improve training and generalization. It should give us a good baseline to compare future approaches that target the noisy labels problem.

Design overview

Code mockup

LossFunction():
  def __init__(self, loss_name: str, selective_masking: bool, kwargs*)
    self.loss_fn = self.get_loss_fn(loss_name, kwargs*)

  def mask_loss(self, loss_img, gt):
    loss_img[gt==-1] = 0

  def get_loss_fn(self, loss_name):
    self.loss_fn = getattr(tf.keras.losses, loss_name)(kwargs*)

  def forward(pred, gt):
    loss_img = self.loss_fn(pred, gt)
    if self.selective_masking:
      loss_img = self.mask_loss(loss_img, gt)
    return loss_img.mean()

Required inputs

Output files

This just improves training but no direct output is created.

Timeline Give a rough estimate for how long you think the project will take. In general, it's better to be too conservative rather than too optimistic.

Estimated date when a fully implemented version will be ready for review: tomorrow

Estimated date when the finalized project will be merged in: tomorrow

ngreenwald commented 2 years ago

nice