ecnet.callbacks

Training callbacks used by ECNet.fit.

Training callback objects/functions

class ecnet.callbacks.CallbackOperator[source]

Bases: object

CallbackOperator: executes individual callback steps at each step

add_cb(cb)[source]
on_train_begin()[source]
on_train_end()[source]
on_epoch_begin(epoch)[source]
on_epoch_end(epoch)[source]
on_batch_begin(batch)[source]
on_batch_end(batch)[source]
on_loss_begin(batch)[source]
on_loss_end(batch)[source]
on_step_begin(batch)[source]
on_step_end(batch)[source]
class ecnet.callbacks.Callback[source]

Bases: object

Base Callback object

on_train_begin()[source]
on_train_end()[source]
on_epoch_begin(epoch)[source]
on_epoch_end(epoch)[source]
on_batch_begin(batch)[source]
on_batch_end(batch)[source]
on_loss_begin(batch)[source]
on_loss_end(batch)[source]
on_step_begin(batch)[source]
on_step_end(batch)[source]
class ecnet.callbacks.LRDecayLinear(init_lr, decay_rate, optimizer)[source]

Bases: Callback

Parameters:
on_epoch_begin(epoch)[source]
Return type:

bool

Parameters:

epoch (int)

Training halted if:

new learing rate == 0.0

class ecnet.callbacks.Validator(loader, model, eval_iter, patience)[source]

Bases: Callback

Parameters:
  • eval_iter (int)

  • patience (int)

on_epoch_end(epoch)[source]
Return type:

bool

Parameters:

epoch (int)

Training halted if:

number of epochs since last lowest valid. MAE > specified patience

on_train_end()[source]

After training, recall weights when lowest valid. MAE occurred

Return type:

bool