2
自定义TensorFlow Keras优化器
假设我想编写一个符合tf.kerasAPI 的自定义优化器类(使用TensorFlow版本> = 2.0)。我对文档记录的执行方式与实现中的执行方式感到困惑。 有关tf.keras.optimizers.Optimizer 状态的文档, ### Write a customized optimizer. If you intend to create your own optimization algorithm, simply inherit from this class and override the following methods: - resource_apply_dense (update variable given gradient tensor is dense) - resource_apply_sparse (update variable given gradient tensor is sparse) - create_slots …