I'm trying to reproduce part of this paper with TensorFlow, the problem is that the authors use SGD with weight decay, cutting the learning rate to 1/10 every 30 epochs.
TensorFlow documentation says that
when applying a decay to the learning rate, be sure to manually apply the decay to the weight_decay as well
So I tried with
schedule = keras.optimizers.schedules.ExponentialDecay(initial_learning_rate = 0.003,
decay_rate = 0.1,
decay_steps = steps_per_epoch*30,
staircase = True
)
optimizer = tfa.optimizers.SGDW(learning_rate = schedule,
weight_decay = schedule,
momentum = 0.9
)
(steps_per_epoch previously initialized)
As I would with Keras SGD, this however doesn't work and raises a "TypeError: Expected float32" for the decay_weight parameter. What's the correct way to achieve the target behaviour?