Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何实现tensorflow余弦衰减_Tensorflow - Fatal编程技术网

如何实现tensorflow余弦衰减

如何实现tensorflow余弦衰减,tensorflow,Tensorflow,当我调用tensorflow中的余弦衰减函数时,它显示了以下错误: ”将Adam(lr=lr\u decaded\u fn)更改为Adam(learning\u rate=lr\u decaded\u fn) tensorflow v2中的Adam优化器调用需要详细说明学习率,它不接受参数为“lr”。请参阅此问题: decay_steps = 1000 lr_decayed_fn = tf.keras.experimental.CosineDecay(initial_learning_r

当我调用tensorflow中的余弦衰减函数时,它显示了以下错误:

”将
Adam(lr=lr\u decaded\u fn)
更改为
Adam(learning\u rate=lr\u decaded\u fn)

tensorflow v2中的Adam优化器调用需要详细说明学习率,它不接受参数为“lr”。请参阅此问题:

  decay_steps = 1000
  lr_decayed_fn = tf.keras.experimental.CosineDecay(initial_learning_rate=0.01, decay_steps=1000)

  model.compile(optimizer=Adam(lr=lr_decayed_fn), loss=dice_coef_loss, metrics=[dice_coef])