adapt.utils.UpdateLambda

adapt.utils.UpdateLambda(lambda_init=0.0, lambda_max=1.0, max_steps=1000, gamma=1.0)[source]

Update Lambda trade-off

This Callback increases the lambda_ trade-off parameter at each batch.

The trade-off is increased from lambda_init to lambda_max in max_steps number of gradient steps according to the following formula:

lambda_ = A * [ 2/(1 + exp(-gamma * p)) - 1. ] + B

With p increasing from 0 to 1 and A, B two constants.

Parameters
lambda_initfloat (default=0.)

Initial trade-off

lambda_maxfloat (default=1.)

Trade-off after max_steps gradient updates.

max_stepsint (default=1000)

Number of gradient updates before getting lambda_max

gammafloat (default=1.)

Speed factor. High gamma will increase the speed of lambda_ increment.