Fix bug that rendered StochasticLayerWithParameters un-updatable

This commit is contained in:
AntreasAntoniou 2017-11-24 14:00:14 +00:00
parent d48cb9214c
commit 309f96b8f5

View File

@ -131,7 +131,7 @@ class MultipleLayerModel(object):
inputs = activations[-i - 2] inputs = activations[-i - 2]
outputs = activations[-i - 1] outputs = activations[-i - 1]
grads_wrt_inputs = layer.bprop(inputs, outputs, grads_wrt_outputs) grads_wrt_inputs = layer.bprop(inputs, outputs, grads_wrt_outputs)
if isinstance(layer, LayerWithParameters): if isinstance(layer, LayerWithParameters) or isinstance(layer, StochasticLayerWithParameters):
grads_wrt_params += layer.grads_wrt_params( grads_wrt_params += layer.grads_wrt_params(
inputs, grads_wrt_outputs)[::-1] inputs, grads_wrt_outputs)[::-1]
grads_wrt_outputs = grads_wrt_inputs grads_wrt_outputs = grads_wrt_inputs