tensorflow2.0自定义层方法
1.用函数的方法调用定义好的层 layer = tf.keras.layers.Dense(100) layer = tf.keras.layers.Dense(100, input_shape=(None, 5)) # 使用函数的方法调上面的layer layer(tf.zeros([10, 5])) 2.定义一个无参数的函数层(激活层) # tf.nn.softplus : log(1+e^x) customized_softplus = keras.layers.Lambda(lambda x : tf.nn.softplus(x)) print(customized_softplus
下载地址
用户评论