[libfann] 112/242: slightly altered examples

Christian Kastner chrisk-guest at moszumanska.debian.org
Sat Oct 4 21:10:26 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 eb076dc687e1ff19a4a6b2fdb306f5ecdf7f7f92
Author: Steffen Nissen <lukesky at diku.dk>
Date:   Tue Mar 30 21:44:31 2004 +0000

    slightly altered examples
---
 examples/Makefile   | 4 ++--
 examples/mushroom.c | 3 +++
 examples/robot.c    | 5 +----
 3 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/examples/Makefile b/examples/Makefile
index e5f24a7..5ffb141 100644
--- a/examples/Makefile
+++ b/examples/Makefile
@@ -1,7 +1,7 @@
 # This makefile is on purpose not made with configure, to show how to use the library
 # The make file requires that the fann library is installed (see ../README)
 
-TARGETS = xor_train xor_test xor_test_fixed simple_train steepness_train simple_test 
+TARGETS = xor_train xor_test xor_test_fixed simple_train steepness_train simple_test
 DEBUG_TARGETS = xor_train_debug xor_test_debug xor_test_fixed_debug
 
 all: $(TARGETS)
@@ -45,7 +45,7 @@ rundebugtest: $(DEBUG_TARGETS)
 
 debug: $(DEBUG_TARGETS)
 
-%_debug: %.c Makefile
+%_debug: %.c Makefile ../src/*c ../src/include/*h
 	gcc -O -ggdb -lm -DDEBUG -I../src/ -I../src/include/ ../src/floatfann.c $< -o $@
 
 %_fixed_debug: %.c Makefile
diff --git a/examples/mushroom.c b/examples/mushroom.c
index 16de9ce..769f8d2 100644
--- a/examples/mushroom.c
+++ b/examples/mushroom.c
@@ -54,6 +54,9 @@ int main()
 
 	printf("Training network.\n");
 
+	fann_set_activation_function_hidden(ann, FANN_SIGMOID_SYMMETRIC_STEPWISE);
+	fann_set_activation_function_output(ann, FANN_SIGMOID_STEPWISE);
+
 	fann_train_on_data(ann, train_data, max_iterations, iterations_between_reports, desired_error);
 	
 	/*fann_train_on_data_callback(ann, data, max_iterations, iterations_between_reports, desired_error, print_callback);*/
diff --git a/examples/robot.c b/examples/robot.c
index bf2efbc..ad73af8 100644
--- a/examples/robot.c
+++ b/examples/robot.c
@@ -34,7 +34,7 @@ int main()
 	const float learning_rate = (const float)0.7;
 	const unsigned int num_layers = 3;
 	const unsigned int num_neurons_hidden = 96;
-	const float desired_error = (const float)0.0003;
+	const float desired_error = (const float)0.001;
 	const unsigned int max_iterations = 300000;
 	const unsigned int iterations_between_reports = 10;
 	struct fann *ann;
@@ -52,9 +52,6 @@ int main()
 		num_neurons_hidden,
 		train_data->num_output);
 
-	fann_set_activation_function_hidden(ann, FANN_SIGMOID);
-	fann_set_activation_function_output(ann, FANN_SIGMOID);
-	
 	printf("Training network.\n");
 
 	fann_train_on_data(ann, train_data, max_iterations, iterations_between_reports, desired_error);

-- 
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