【发布时间】:2019-02-21 01:28:05
【问题描述】:
在下面的 Python 代码中,(x) 是什么意思?
Dropout(0.8)(x)
【问题讨论】:
在下面的 Python 代码中,(x) 是什么意思?
Dropout(0.8)(x)
【问题讨论】:
(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。
【讨论】: