简体   繁体   中英

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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