Skip to content

larq.optimizers

Bop

Bop(fp_optimizer, threshold=1e-05, gamma=0.01, name='Bop', **kwargs)
Binary optimizer (Bop).

Bop is a latent-free optimizer for Binarized Neural Networks (BNNs).

Example

optimizer = lq.optimizers.Bop(fp_optimizer=tf.keras.optimizers.Adam(0.01))

Arguments

  • fp_optimizer: a tf.keras.optimizers.Optimizer.
  • threshold: determines to whether to flip each weight.
  • gamma: the adaptivity rate.
  • name: name of the optimizer.

References

XavierLearningRateScaling

XavierLearningRateScaling(optimizer, model)
Optimizer wrapper for Xavier Learning Rate Scaling

Scale the weights learning rates respectively with the weights initialization

This is a wrapper and does not implement any optimization algorithm.

Example

optimizer = lq.optimizers.XavierLearningRateScaling(
    tf.keras.optimizers.Adam(0.01), model
)

Arguments

  • optimizer: A tf.keras.optimizers.Optimizer
  • model: A tf.keras.Model

References