diff options
author | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-11-09 06:47:44 +0400 |
---|---|---|
committer | Jean-Marc Valin <jmvalin@jmvalin.ca> | 2013-11-09 06:47:44 +0400 |
commit | a599ccd2172c159cb690a8b446bb4b3986d594fb (patch) | |
tree | 3452ffebe01bff5441b58de6b08faae29192fc75 /src | |
parent | 5174817d3627fe740d3903b341dafa7109d44be8 (diff) |
stupid uninitialized variable in the mlp training caught by cppcheck
Diffstat (limited to 'src')
-rw-r--r-- | src/mlp_train.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/mlp_train.c b/src/mlp_train.c index 2e9568ba..769f503d 100644 --- a/src/mlp_train.c +++ b/src/mlp_train.c @@ -121,8 +121,6 @@ double compute_gradient(MLPTrain *net, float *inputs, float *outputs, int nbSamp double netOut[MAX_NEURONS]; double error[MAX_NEURONS]; - for (i=0;i<outDim;i++) - error_rate[i] = 0; topo = net->topo; inDim = net->topo[0]; hiddenDim = net->topo[1]; @@ -135,6 +133,8 @@ double compute_gradient(MLPTrain *net, float *inputs, float *outputs, int nbSamp memset(W1_grad, 0, W1_size*sizeof(double)); for (i=0;i<outDim;i++) netOut[i] = outputs[i]; + for (i=0;i<outDim;i++) + error_rate[i] = 0; for (s=0;s<nbSamples;s++) { float *in, *out; |