From 309f96b8f5fbd13bbd967cc6adafcfa89d8eace8 Mon Sep 17 00:00:00 2001 From: AntreasAntoniou Date: Fri, 24 Nov 2017 14:00:14 +0000 Subject: [PATCH] Fix bug that rendered StochasticLayerWithParameters un-updatable --- mlp/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mlp/models.py b/mlp/models.py index b2be888..63d034f 100644 --- a/mlp/models.py +++ b/mlp/models.py @@ -131,7 +131,7 @@ class MultipleLayerModel(object): inputs = activations[-i - 2] outputs = activations[-i - 1] 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( inputs, grads_wrt_outputs)[::-1] grads_wrt_outputs = grads_wrt_inputs