[libfann] 196/242: More documentations and minor changes.

Christian Kastner chrisk-guest at moszumanska.debian.org
Sat Oct 4 21:10:43 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 dccd98e1c0f8155e18d40cb08a1602941e5b8f5c
Author: Steffen Nissen <lukesky at diku.dk>
Date:   Mon Sep 26 22:35:34 2005 +0000

    More documentations and minor changes.
---
 .cdtproject              |   7 +++
 .project                 |   9 ++-
 src/fann_train.c         |  15 +----
 src/include/fann_data.h  |   6 +-
 src/include/fann_train.h | 156 ++++++++++++++++++++++++++++++++++++++++-------
 5 files changed, 154 insertions(+), 39 deletions(-)

diff --git a/.cdtproject b/.cdtproject
index 21f18cd..e394b0f 100644
--- a/.cdtproject
+++ b/.cdtproject
@@ -55,6 +55,13 @@
 </item>
 <item id="org.eclipse.cdt.make.core.buildtargets">
 <buildTargets>
+<target name="Documentation" targetID="org.eclipse.cdt.make.MakeTargetBuilder" path="natural_docs">
+<buildCommand>./NaturalDocs</buildCommand>
+<buildArguments/>
+<buildTarget/>
+<stopOnError>false</stopOnError>
+<useDefaultCommand>true</useDefaultCommand>
+</target>
 <target name="all" targetID="org.eclipse.cdt.make.MakeTargetBuilder" path="">
 <buildCommand>make</buildCommand>
 <buildArguments/>
diff --git a/.project b/.project
index 0b61b46..dc32650 100644
--- a/.project
+++ b/.project
@@ -7,7 +7,6 @@
 	<buildSpec>
 		<buildCommand>
 			<name>org.eclipse.cdt.make.core.makeBuilder</name>
-			<triggers>clean,full,incremental,</triggers>
 			<arguments>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.build.arguments</key>
@@ -19,7 +18,7 @@
 				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.enableAutoBuild</key>
-					<value>false</value>
+					<value>true</value>
 				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.environment</key>
@@ -38,6 +37,10 @@
 					<value>true</value>
 				</dictionary>
 				<dictionary>
+					<key>org.eclipse.cdt.make.core.build.location</key>
+					<value>/fann/examples</value>
+				</dictionary>
+				<dictionary>
 					<key>org.eclipse.cdt.make.core.build.target.clean</key>
 					<value>clean</value>
 				</dictionary>
@@ -63,7 +66,7 @@
 				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.build.target.auto</key>
-					<value>all</value>
+					<value>compiletest</value>
 				</dictionary>
 				<dictionary>
 					<key>org.eclipse.cdt.make.core.stopOnError</key>
diff --git a/src/fann_train.c b/src/fann_train.c
index 4b1b428..9861c9e 100644
--- a/src/fann_train.c
+++ b/src/fann_train.c
@@ -171,14 +171,6 @@ FANN_EXTERNAL fann_type *FANN_API fann_test(struct fann *ann, fann_type * input,
 }
 
 /* get the mean square error.
-   (obsolete will be removed at some point, use fann_get_MSE)
- */
-FANN_EXTERNAL float FANN_API fann_get_error(struct fann *ann)
-{
-	return fann_get_MSE(ann);
-}
-
-/* get the mean square error.
  */
 FANN_EXTERNAL float FANN_API fann_get_MSE(struct fann *ann)
 {
@@ -192,12 +184,9 @@ FANN_EXTERNAL float FANN_API fann_get_MSE(struct fann *ann)
 	}
 }
 
-/* reset the mean square error.
-   (obsolete will be removed at some point, use fann_reset_MSE)
- */
-FANN_EXTERNAL void FANN_API fann_reset_error(struct fann *ann)
+FANN_EXTERNAL unsigned int fann_get_bit_fail(struct fann *ann)
 {
-	fann_reset_MSE(ann);
+	return ann->num_bit_fail;	
 }
 
 /* reset the mean square error.
diff --git a/src/include/fann_data.h b/src/include/fann_data.h
index 888efc1..452b300 100644
--- a/src/include/fann_data.h
+++ b/src/include/fann_data.h
@@ -35,7 +35,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 
 /* Enum: fann_train_enum
 	The Training algorithms used when training on <struct fann_train_data> with functions like
-	<fann_train_on_data> or <fann_train_on_file>.
+	<fann_train_on_data> or <fann_train_on_file>. The incremental training looks alters the weights
+	after each time it is presented an input pattern, while batch only alters the weights once after
+	it has been presented to all the patterns.
 
 	FANN_TRAIN_INCREMENTAL - Standard backpropagation incremental or online training
 	FANN_TRAIN_BATCH - Standard backpropagation batch training
@@ -239,7 +241,7 @@ static char const *const FANN_ERRORFUNC_NAMES[] = {
 	Stop criteria used during training.
 
 	FANN_STOPFUNC_MSE - Stop criteria is Mean Square Error (MSE) value.
-	FANN_STOPFUNC_BIT - Stop criteria is number of bits that fail. The number of bits mean the
+	FANN_STOPFUNC_BIT - Stop criteria is number of bits that fail. The number of bits; means the
 		number of output neurons which differ more than the bit fail limit 
 		(see <fann_get_bit_fail_limit>, <fann_set_bit_fail_limit>). 
 		The bits are counted in all of the training data, so this number can be higher than
diff --git a/src/include/fann_train.h b/src/include/fann_train.h
index a30524e..1f5095d 100644
--- a/src/include/fann_train.h
+++ b/src/include/fann_train.h
@@ -20,7 +20,23 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #ifndef __fann_train_h__
 #define __fann_train_h__
 
-/* Section: FANN Training */
+/* Section: FANN Training 
+ 
+ 	There are many different ways of training neural networks and the FANN library supports
+ 	a number of different approaches. 
+ 	
+ 	Two fundementally different approaches are the most commonly used:
+ 	
+ 		Fixed topology training - The size and topology of the ANN is determined in advance
+ 			and the training alters the weights in order to minimize the difference between
+ 			the desired output values and the actual output values. This kind of training is 
+ 			supported by <fann_train_on_data>.
+ 			
+ 		Evolving topology training - The training start out with an empty ANN, only consisting
+ 			of input and output neurons. Hidden neurons and connections is the added during training,
+ 			in order to reach the same goal as for fixed topology training. This kind of training
+ 			is supported by <FANN Cascade Training>.
+ */
 
 /* Struct: struct fann_train_data
 	Structure used to store data, for use with training.
@@ -28,6 +44,9 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 	The data inside this structure should never be manipulated directly, but should use some 
 	of the supplied functions in <Training Data>.
 	
+	The training data structure is very usefull for storing data during training and testing of a
+	neural network.
+   
 	See also:
 	<fann_read_train_from_file>, <fann_train_on_data>, <fann_destroy_train>
 */
@@ -50,7 +69,20 @@ struct fann_train_data
 
 #ifndef FIXEDFANN
 /* Function: fann_train
+
    Train one iteration with a set of inputs, and a set of desired outputs.
+   This training is always incremental training (see <fann_train_enum>), since
+   only one pattern is presented.
+   
+   Parameters:
+   	ann - The neural network structure
+   	input - an array of inputs. This array must be exactly <fann_get_num_input> long.
+   	desired_output - an array of desired outputs. This array must be exactly <fann_get_num_output> long.
+   	
+   	See also:
+   		<fann_train_on_data>, <fann_train_epoch>
+   	
+   	This function appears in FANN >= 1.0.0.
  */ 
 FANN_EXTERNAL void FANN_API fann_train(struct fann *ann, fann_type * input,
 									   fann_type * desired_output);
@@ -61,42 +93,88 @@ FANN_EXTERNAL void FANN_API fann_train(struct fann *ann, fann_type * input,
    Test with a set of inputs, and a set of desired outputs.
    This operation updates the mean square error, but does not
    change the network in any way.
+   
+   See also:
+   		<fann_test_data>, <fann_train>
+   
+   This function appears in FANN >= 1.0.0.
 */ 
-	FANN_EXTERNAL fann_type * FANN_API fann_test(struct fann *ann, fann_type * input,
+FANN_EXTERNAL fann_type * FANN_API fann_test(struct fann *ann, fann_type * input,
 												 fann_type * desired_output);
 
 /* Function: fann_get_MSE
    Reads the mean square error from the network.
+   
+   Reads the mean square error from the network. This value is calculated during 
+   training or testing, and can therefore sometimes be a bit off if the weights 
+   have been changed since the last calculation of the value.
+   
+   See also:
+   	<fann_test_data>
+
+	This function appears in FANN >= 1.1.0.
  */ 
 FANN_EXTERNAL float FANN_API fann_get_MSE(struct fann *ann);
 
+/* Function: fann_get_bit_fail
+	
+	The number of fail bits; means the number of output neurons which differ more 
+	than the bit fail limit (see <fann_get_bit_fail_limit>, <fann_set_bit_fail_limit>). 
+	The bits are counted in all of the training data, so this number can be higher than
+	the number of training data.
+	
+	This value is reset by <fann_reset_MSE> and updated by all the same functions which also
+	updates the MSE value (e.g. <fann_test_data>, <fann_train_epoch>)
+	
+	See also:
+		<fann_stopfunc_enum>, <fann_get_MSE>
+
+	This function appears in FANN >= 2.0.0
+*/
+FANN_EXTERNAL unsigned int fann_get_bit_fail(struct fann *ann);
 
 /* Function: fann_reset_MSE
    Resets the mean square error from the network.
+   
+   This function also resets the number of bits that fail.
+   
+   See also:
+   	<fann_get_MSE>, <fann_get_bit_fail_limit>
+   
+    This function appears in FANN >= 1.1.0
  */ 
 FANN_EXTERNAL void FANN_API fann_reset_MSE(struct fann *ann);
 
 /* Group: Training Data */
 
 /* Function: fann_read_train_from_file
-   Reads a file that stores training data, in the format:
-   num_train_data num_input num_output\n
-   inputdata seperated by space\n
-   outputdata seperated by space\n
-
-   .
-   .
-   .
+   Reads a file that stores training data.
    
-   inputdata seperated by space\n
-   outputdata seperated by space\n
+   The file must be formatted like:
+   >num_train_data num_input num_output
+   >inputdata seperated by space
+   >outputdata seperated by space
+   >
+   >.
+   >.
+   >.
+   >
+   >inputdata seperated by space
+   >outputdata seperated by space
+   
+   See also:
+   	<fann_train_on_data>, <fann_destroy_train>, <fann_save_train>
+
+    This function appears in FANN >= 1.0.0
 */ 
 FANN_EXTERNAL struct fann_train_data *FANN_API fann_read_train_from_file(char *filename);
 
 
 /* Function: fann_destroy_train
-   Destructs the training data
+   Destructs the training data and properly deallocates all of the associated data.
    Be sure to call this function after finished using the training data.
+
+    This function appears in FANN >= 1.0.0
  */ 
 FANN_EXTERNAL void FANN_API fann_destroy_train(struct fann_train_data *train_data);
 
@@ -105,23 +183,57 @@ FANN_EXTERNAL void FANN_API fann_destroy_train(struct fann_train_data *train_dat
 	
 /* Function: fann_train_epoch
    Train one epoch with a set of training data.
+   
+    Train one epoch with the training data stored in data. One epoch is where all of 
+    the training data is considered exactly once.
+
+	This function returns the MSE error as it is calculated either before or during 
+	the actual training. This is not the actual MSE after the training epoch, but since 
+	calculating this will require to go through the entire training set once more, it is 
+	more than adequate to use this value during training.
+
+	The training algorithm used by this function is chosen by the <fann_set_training_algorithm> 
+	function.
+	
+	See also:
+		<fann_train_on_data>, <fann_test_data>
+		
+	This function appears in FANN >= 1.2.0.
  */ 
 FANN_EXTERNAL float FANN_API fann_train_epoch(struct fann *ann, struct fann_train_data *data);
 
-
 /* Function: fann_test_data
-   Test a set of training data and calculate the MSE
+  
+   Test a set of training data and calculates the MSE for the training data. 
+   
+   This function updates the MSE and the bit fail values.
+   
+   See also:
+ 	<fann_test>, <fann_get_MSE>, <fann_get_bit_fail>
+
+	This function appears in FANN >= 1.2.0.
  */ 
 FANN_EXTERNAL float FANN_API fann_test_data(struct fann *ann, struct fann_train_data *data);
 
 
 /* Function: fann_train_on_data
 
-   Trains on an entire dataset, for a maximum of max_epochs
-   epochs or until mean square error is lower than desired_error.
-   Reports about the progress is given every
-   epochs_between_reports epochs.
-   If epochs_between_reports is zero, no reports are given.
+   Trains on an entire dataset, for a period of time. 
+   
+   This training uses the training algorithm chosen by <fann_set_training_algorithm>,
+   and the parameters set for these training algorithms.
+   
+   Parameters:
+   		ann - The neural network
+   		data - The data, which should be used during training
+   		max_epochs - The maximum number of epochs the training should continue
+   		epochs_between_reports - The number of epochs between printing a status report to stdout.
+   			A value of zero means no reports should be printed.
+   		desired_error - The desired <fann_get_MSE> or <fann_get_bit_fail>, depending on which stop function
+   			is chosen by <fann_set_train_stop_function>.
+
+	See also:
+		<fann_train_on_data_callback>, <fann_train_on_file>, <fann_train_epoch>, <Parameters>
 */ 
 FANN_EXTERNAL void FANN_API fann_train_on_data(struct fann *ann, struct fann_train_data *data,
 											   unsigned int max_epochs,
@@ -130,7 +242,9 @@ FANN_EXTERNAL void FANN_API fann_train_on_data(struct fann *ann, struct fann_tra
 
 
 /* Function: fann_train_on_data_callback
-   
+
+	TODO - callback definition should be changed.
+	   
    Same as fann_train_on_data, but a callback function is given,
    which can be used to print out reports. (effective for gui programming).
    If the callback returns -1, then the training is terminated, otherwise

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