简体   繁体   English

如何在 conv2d 层中使用 PReLU

[英]How to use PReLU in conv2d layer

I'm trying to use PReLU activation function in the below code line, kindly let me know how to do it.我正在尝试在下面的代码行中使用 PReLU 激活 function,请告诉我该怎么做。

x = Conv2D(64, (3,3), padding='same', strides= (2,2), "activation = tf.keras.activations.sigmoid", name='layer1')(x)
x = MaxPooling2D(pool_size=(2,2))(x)

You can pass it as a layer, like this:您可以将其作为层传递,如下所示:

x = Conv2D(64, (3,3), padding='same', strides= (2,2))(x)
x = tf.keras.layers.PReLU()(x)
x = MaxPooling2D(pool_size=(2,2))(x)

As dscribed in the docs文档中所述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM