且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在Keras中创建自定义图层以获取和操纵渐变

更新时间:2023-11-17 23:30:40

tf.custom_gradient 是在此处使用的***工具.它使您可以在调用站点上定义渐变函数,具有比覆盖图更好的界面,并且可以很好地执行.

tf.custom_gradient is the best tool to use here. It lets you define the gradient function at the call site, has a nicer interface than the override map, and works well with eager execution.