SINGA-116 Fix a bug in InnerProductLayer caused by weight matrix sharing

Fix a bug in reporting loss of rbm layers.
The loss was averaged over batchsize * batchsize, which should be over 
batchsize.
Updated the counter from counter_ += batchszie to counter_ += 1.


Project: http://git-wip-us.apache.org/repos/asf/incubator-singa/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-singa/commit/0cb6cc22
Tree: http://git-wip-us.apache.org/repos/asf/incubator-singa/tree/0cb6cc22
Diff: http://git-wip-us.apache.org/repos/asf/incubator-singa/diff/0cb6cc22

Branch: refs/heads/master
Commit: 0cb6cc222d00c0759dec41c18c80d9cb8b6befae
Parents: cf6ef82
Author: Wei Wang <[email protected]>
Authored: Mon Dec 28 11:54:14 2015 +0800
Committer: Wei Wang <[email protected]>
Committed: Mon Dec 28 11:54:14 2015 +0800

----------------------------------------------------------------------
 src/neuralnet/neuron_layer/rbm.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-singa/blob/0cb6cc22/src/neuralnet/neuron_layer/rbm.cc
----------------------------------------------------------------------
diff --git a/src/neuralnet/neuron_layer/rbm.cc 
b/src/neuralnet/neuron_layer/rbm.cc
index 92c2371..67d0922 100644
--- a/src/neuralnet/neuron_layer/rbm.cc
+++ b/src/neuralnet/neuron_layer/rbm.cc
@@ -114,7 +114,7 @@ void RBMVisLayer::ComputeFeature(int flag, const 
vector<Layer*>& srclayers) {
     }
     first_gibbs_ = false;
   }
-  counter_ += batchsize_;
+  counter_ += 1;
 }
 
 void RBMVisLayer::ComputeGradient(int flag, const vector<Layer*>& srclayers) {

Reply via email to