在http://deeplearning.net/tutorial/SdA.html#sda上的 Stacked DenoisingAutoencoders 教程中,pretraining_functions 返回代表每个 dA 层的训练函数的函数列表。但我不明白为什么它为所有 dA 层提供相同的输入 ( train_set_x
)。实际上,每个 dA 层的输入应该是除第一个 dA 层之外的下一层的输出。谁能告诉我为什么这些代码是正确的?
pretrain_fns = []
for dA in self.dA_layers:
# get the cost and the updates list
cost, updates = dA.get_cost_updates(corruption_level, learning_rate)
# compile the theano function
fn = theano.function(inputs=[index,
theano.Param(corruption_level, default=0.2),
theano.Param(learning_rate, default=0.1)],
outputs=cost,
updates=updates,
givens={self.x: train_set_x[batch_begin:batch_end]})
# append `fn` to the list of functions
pretrain_fns.append(fn)