Closed SmileTM closed 1 year ago
https://s-tm.cn/2019/09/22/Custom-layers/
Custom layers自定义成层只需要 继承tf.keras.layers.Layer 类即可: 12345678910111213141516class MyDense(tf.keras.layers.Layer): # init 可以进行所有与输入无关的初始化 def init(self,units =32): super(MyDense, self)._
https://s-tm.cn/2019/09/22/Custom-layers/
Custom layers自定义成层只需要 继承tf.keras.layers.Layer 类即可: 12345678910111213141516class MyDense(tf.keras.layers.Layer): # init 可以进行所有与输入无关的初始化 def init(self,units =32): super(MyDense, self)._