[python-fann2] 05/06: Add patch Add-an-example.patch

Christian Kastner ckk at moszumanska.debian.org
Tue Sep 29 19:31:35 UTC 2015


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

ckk pushed a commit to branch master
in repository python-fann2.

commit 4ee651bfcdcaf5444675e41674957fd1dc729d15
Author: Christian Kastner <ckk at kvr.at>
Date:   Tue Sep 29 13:53:23 2015 +0200

    Add patch Add-an-example.patch
---
 debian/patches/Add-an-example.patch | 60 +++++++++++++++++++++++++++++++++++++
 debian/patches/series               |  1 +
 2 files changed, 61 insertions(+)

diff --git a/debian/patches/Add-an-example.patch b/debian/patches/Add-an-example.patch
new file mode 100644
index 0000000..f2119a5
--- /dev/null
+++ b/debian/patches/Add-an-example.patch
@@ -0,0 +1,60 @@
+From: Christian Kastner <ckk at kvr.at>
+Date: Tue, 29 Sep 2015 13:49:26 +0200
+Subject: Add an example
+
+Add one of Vincenzo Di Massa's (the original author of the bindings) code
+examples.
+
+Taken from the original FANN source.
+
+Last-Update: 2015-09-29
+---
+ examples/simple_train.py | 22 ++++++++++++++++++++++
+ examples/xor.data        |  9 +++++++++
+ 2 files changed, 31 insertions(+)
+ create mode 100644 examples/simple_train.py
+ create mode 100644 examples/xor.data
+
+diff --git a/examples/simple_train.py b/examples/simple_train.py
+new file mode 100644
+index 0000000..cc197d7
+--- /dev/null
++++ b/examples/simple_train.py
+@@ -0,0 +1,22 @@
++#!/usr/bin/python
++from fann2 import libfann
++
++connection_rate = 1
++learning_rate = 0.7
++num_input = 2
++num_neurons_hidden = 4
++num_output = 1
++
++desired_error = 0.0001
++max_iterations = 100000
++iterations_between_reports = 1000
++
++ann = libfann.neural_net()
++ann.create_sparse_array(connection_rate, (num_input, num_neurons_hidden, num_output))
++ann.set_learning_rate(learning_rate)
++ann.set_activation_function_output(libfann.SIGMOID_SYMMETRIC_STEPWISE)
++
++ann.train_on_file("xor.data", max_iterations, iterations_between_reports, desired_error)
++
++ann.save("xor_float.net")
++
+diff --git a/examples/xor.data b/examples/xor.data
+new file mode 100644
+index 0000000..e831fc6
+--- /dev/null
++++ b/examples/xor.data
+@@ -0,0 +1,9 @@
++4 2 1
++-1 -1
++-1
++-1 1
++1
++1 -1
++1
++1 1
++-1
diff --git a/debian/patches/series b/debian/patches/series
index 759f5ee..4977804 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 Improve-SWIG-invocation.patch
+Add-an-example.patch

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



More information about the debian-science-commits mailing list