Hi,
I need to linearly decay weight loss in pyTorch.This is the way I calculate my loss function
loss_A = criterion_id(G(real_A), real_A)
loss_B = criterion_id(F(real_B), real_B)

loss_id = (loss_A + loss_B) / 2

loss_ = lambda_ * loss_id


For example, the value of lambda_ is 10 and I want after some number of epochs lets assume 50, linearly decay the lambda_ value towards a small number like 1e-5.