자습서 Stacked DenoisingAutoencoders에서 http://deeplearning.net/tutorial/SdA.html#sda에있는 pretraining_functions는 각 dA 레이어의 열차 기능을 나타내는 함수 목록을 반환합니다. 하지만 왜 모든 dA 레이어에 동일한 입력 (train_set_x
)을 제공하는지 이해할 수 없습니다. 실제로, 각 dA 층의 입력은 첫 번째 dA 층을 제외한 아래의 층의 출력이어야합니다. 아무도 왜이 코드가 올바른지 말해 줄 수 있습니까? 각 은닉층의 입력 이후Stacked DenoisingAutoencoders의 Theano 구현 - 왜 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)
감사합니다.하지만 왜 theano가 입력을 다음 계층으로 전파 할 수 있는지 이해하지 못합니다. 함수에 특정 매개 변수 만 제공하기 때문입니다. 각 레이어의 정의는 맞지만 train_set_x는주기 동안 변경되지 않았습니다. –
@love_carrot 그래프를 인쇄 해보고 어떻게 흐르게하는지 보면 두 번째 입력에 대해 처리 된 한 레이어의 입력이 표시됩니다. – Shai