【问题标题】:In Dropout(0.8)(x), what is (x) meant for? [closed]在 Dropout(0.8)(x) 中,(x) 是什么意思? [关闭]
【发布时间】:2019-02-21 01:28:05
【问题描述】:

在下面的 Python 代码中,(x) 是什么意思?

Dropout(0.8)(x)

【问题讨论】:

    标签: python keras


    【解决方案1】:

    (x) 使用前面的函数引用(由Dropout(0.8) 返回)以x 作为参数进行函数调用。

    例如:

    def Dropout(a):
        def func(b):
            return a + b
        return func
    x = 0.2
    print(Dropout(0.8)(x))
    

    将输出1.0

    【讨论】:

      猜你喜欢
      • 2020-03-18
      • 2021-08-02
      • 2015-03-24
      • 2015-12-30
      • 2020-10-02
      • 2011-05-27
      • 2018-05-03
      • 1970-01-01
      • 2018-08-18
      相关资源
      最近更新 更多