From 441578ccc3e6c68ab96724e72657c9aa457622cd Mon Sep 17 00:00:00 2001 From: Frank Seide Date: Sat, 13 Aug 2016 16:24:55 -0700 Subject: [PATCH] bug fix: BatchNormalization should mask gaps for packed sequences --- Source/ComputationNetworkLib/TrainingNodes.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/ComputationNetworkLib/TrainingNodes.h b/Source/ComputationNetworkLib/TrainingNodes.h index 0d777db49..eb5c6a638 100644 --- a/Source/ComputationNetworkLib/TrainingNodes.h +++ b/Source/ComputationNetworkLib/TrainingNodes.h @@ -1738,7 +1738,7 @@ public: { FrameRange fr(Input(0)->GetMBLayout()); - Matrix sliceInputValue = Input(0)->ValueFor(fr); + Matrix sliceInputValue = Input(0)->MaskedValueFor(fr); const Matrix& scale = Input(1)->Value(); const Matrix& bias = Input(2)->Value(); Matrix& runMean = Input(3)->Value(); @@ -1775,7 +1775,7 @@ public: if (inputIndex == 0) // derivative with respect to the input. { - auto sliceOutputGrad = GradientFor(fr); + auto sliceOutputGrad = MaskedGradientFor(fr); auto sliceInputValue = Input(0)->ValueFor(fr); const Matrix& scale = Input(1)->Value(); const Matrix& bias = Input(2)->Value();