SwitchLoss#

class radionets.core.callbacks.SwitchLoss(second_loss, when_switch)[source]#

Bases: Callback

Callback for switching loss functions during training.

Changes the loss function to a different one after a specified number of epochs.

Parameters:
second_losscallable

The loss function to switch to.

when_switchint

Epoch number after which to switch loss functions.

Attributes Summary

learn

name

Name of the Callback, camel-cased and with 'Callback' removed

order

run

run_train

run_valid

Methods Summary

__call__(event_name)

Call self.{event_name} if it's defined

before_epoch()

Attributes Documentation

learn = None#
name#

Name of the Callback, camel-cased and with ‘Callback’ removed

order = 0#
run = True#
run_train = True#
run_valid = True#

Methods Documentation

__call__(event_name)#

Call self.{event_name} if it’s defined

before_epoch()[source]#