【问题标题】:How to use PReLU in conv2d layer如何在 conv2d 层中使用 PReLU
【发布时间】:2021-03-23 13:22:48
【问题描述】:

我正在尝试在下面的代码行中使用 PReLU 激活函数,请告诉我该怎么做。

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)

【问题讨论】:

    标签: python tensorflow keras deep-learning conv-neural-network


    【解决方案1】:

    您可以将其作为层传递,如下所示:

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

    docs中所述

    【讨论】:

    • 我尝试过但收到此错误“ValueError: Attempt to convert a value (None) with an unsupported type () to a Tensor.” @nicolas-gervais
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-09-05
    • 2019-02-09
    • 2019-11-06
    • 2023-02-06
    • 2017-02-19
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多