Momentum Evaluation (ME)#

(hivenas.core.nas.momentum_eval)

Calculates and incentivizes the stability of convergence.

class MomentumAugmentation(monitor='val_sparse_categorical_accuracy')[source]#

Bases: Callback

Calculates the momentum’s moving average of the parent model

monitor#

the optimizer metric type to monitor and calculate momentums on

Type

str

get_momentum(epoch, acc)[source]#

Calculates the momentums based on the given accuracies and epochs

\[μm(ε) = \frac{αm(ε) − αm(ε − 1)}{αm(ε − 1) − αm(ε − 2)} \quad \forall \; ε \ge 2\]
Parameters
  • epoch (int) – current epoch

  • acc (float) – current epoch’s accuracy

Returns

a tuple consisting of the (current accuracy, current momentum)

Return type

(float, float)

on_epoch_end(epoch, logs=None)[source]#

Called by Keras backend after each epoch during .fit() & .evaluate()

Parameters
  • epoch (int) – current epoch

  • logs (dict, optional) – contains all the monitors (or metrics) used by the optimizer in the training and evaluation contexts