[libfann] 101/242: use real number of hidden neurons in init_weight

Christian Kastner chrisk-guest at moszumanska.debian.org
Sat Oct 4 21:10:24 UTC 2014


This is an automated email from the git hooks/post-receive script.

chrisk-guest pushed a commit to tag Version2_0_0
in repository libfann.

commit 5a795e00bfeb8d90c65048a4c3c4d201cb2bef63
Author: Steffen Nissen <lukesky at diku.dk>
Date:   Thu Mar 18 14:42:51 2004 +0000

    use real number of hidden neurons in init_weight
---
 src/fann.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/fann.c b/src/fann.c
index 7551173..4eb0046 100644
--- a/src/fann.c
+++ b/src/fann.c
@@ -451,9 +451,9 @@ fann_type* fann_run(struct fann *ann, fann_type *input)
 				case FANN_SIGMOID_SYMMETRIC:
 				case FANN_SIGMOID_SYMMETRIC_STEPWISE:
 					if(layer_it == last_layer-1){
-						neuron_it->value = (fann_type)fann_stepwise(o1, o2, o3, o4, o5, o6, ro1, ro2, ro3, ro4, ro5, ro6, neuron_value, multiplier);
+						neuron_it->value = (fann_type)fann_stepwise(o1, o2, o3, o4, o5, o6, ro1, ro2, ro3, ro4, ro5, ro6, neuron_value);
 					}else{
-						neuron_it->value = (fann_type)fann_stepwise(h1, h2, h3, h4, h5, h6, rh1, rh2, rh3, rh4, rh5, rh6, neuron_value, multiplier);
+						neuron_it->value = (fann_type)fann_stepwise(h1, h2, h3, h4, h5, h6, rh1, rh2, rh3, rh4, rh5, rh6, neuron_value);
 					}
 					break;
 #else
@@ -472,9 +472,9 @@ fann_type* fann_run(struct fann *ann, fann_type *input)
 				case FANN_SIGMOID_STEPWISE:
 				case FANN_SIGMOID_SYMMETRIC_STEPWISE:
 					if(layer_it == last_layer-1){
-						neuron_it->value = (fann_type)fann_stepwise(o1, o2, o3, o4, o5, o6, ro1, ro2, ro3, ro4, ro5, ro6, neuron_value, 1);
+						neuron_it->value = (fann_type)fann_stepwise(o1, o2, o3, o4, o5, o6, ro1, ro2, ro3, ro4, ro5, ro6, neuron_value);
 					}else{
-						neuron_it->value = (fann_type)fann_stepwise(h1, h2, h3, h4, h5, h6, rh1, rh2, rh3, rh4, rh5, rh6, neuron_value, 1);
+						neuron_it->value = (fann_type)fann_stepwise(h1, h2, h3, h4, h5, h6, rh1, rh2, rh3, rh4, rh5, rh6, neuron_value);
 					}
 					break;
 #endif
@@ -544,7 +544,7 @@ void fann_init_weights(struct fann *ann, struct fann_train_data *train_data)
 	}
 
 	num_hidden_neurons = ann->total_neurons - (ann->num_input + ann->num_output + (ann->last_layer - ann->first_layer));
-	scale_factor = powf((float)(0.7f * (float)(ann->total_neurons - (ann->num_input + ann->num_output))),
+	scale_factor = powf((float)(0.7f * (float)num_hidden_neurons),
 				  (float)(1.0f / (float)ann->num_input)) / (float)(largest_inp - smallest_inp);
 
 #ifdef DEBUG

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/libfann.git



More information about the debian-science-commits mailing list