]> ruin.nu Git - germs.git/blob - fann/src/include/fann_train.h
Make it possible to build statically against the included fann library.
[germs.git] / fann / src / include / fann_train.h
1 /*
2 Fast Artificial Neural Network Library (fann)
3 Copyright (C) 2003 Steffen Nissen (lukesky@diku.dk)
4
5 This library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
9
10 This library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 Lesser General Public License for more details.
14
15 You should have received a copy of the GNU Lesser General Public
16 License along with this library; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
18 */
19
20 #ifndef __fann_train_h__
21 #define __fann_train_h__
22
23 /* Section: FANN Training 
24  
25         There are many different ways of training neural networks and the FANN library supports
26         a number of different approaches. 
27         
28         Two fundementally different approaches are the most commonly used:
29         
30                 Fixed topology training - The size and topology of the ANN is determined in advance
31                         and the training alters the weights in order to minimize the difference between
32                         the desired output values and the actual output values. This kind of training is 
33                         supported by <fann_train_on_data>.
34                         
35                 Evolving topology training - The training start out with an empty ANN, only consisting
36                         of input and output neurons. Hidden neurons and connections is the added during training,
37                         in order to reach the same goal as for fixed topology training. This kind of training
38                         is supported by <FANN Cascade Training>.
39  */
40
41 /* Struct: struct fann_train_data
42         Structure used to store data, for use with training.
43         
44         The data inside this structure should never be manipulated directly, but should use some 
45         of the supplied functions in <Training Data Manipulation>.
46         
47         The training data structure is very usefull for storing data during training and testing of a
48         neural network.
49    
50         See also:
51         <fann_read_train_from_file>, <fann_train_on_data>, <fann_destroy_train>
52 */
53 struct fann_train_data
54 {
55         enum fann_errno_enum errno_f;
56         FILE *error_log;
57         char *errstr;
58
59         unsigned int num_data;
60         unsigned int num_input;
61         unsigned int num_output;
62         fann_type **input;
63         fann_type **output;
64 };
65
66 /* Section: FANN Training */
67
68 /* Group: Training */
69
70 #ifndef FIXEDFANN
71 /* Function: fann_train
72
73    Train one iteration with a set of inputs, and a set of desired outputs.
74    This training is always incremental training (see <fann_train_enum>), since
75    only one pattern is presented.
76    
77    Parameters:
78         ann - The neural network structure
79         input - an array of inputs. This array must be exactly <fann_get_num_input> long.
80         desired_output - an array of desired outputs. This array must be exactly <fann_get_num_output> long.
81         
82         See also:
83                 <fann_train_on_data>, <fann_train_epoch>
84         
85         This function appears in FANN >= 1.0.0.
86  */ 
87 FANN_EXTERNAL void FANN_API fann_train(struct fann *ann, fann_type * input,
88                                                                            fann_type * desired_output);
89
90 #endif  /* NOT FIXEDFANN */
91         
92 /* Function: fann_test
93    Test with a set of inputs, and a set of desired outputs.
94    This operation updates the mean square error, but does not
95    change the network in any way.
96    
97    See also:
98                 <fann_test_data>, <fann_train>
99    
100    This function appears in FANN >= 1.0.0.
101 */ 
102 FANN_EXTERNAL fann_type * FANN_API fann_test(struct fann *ann, fann_type * input,
103                                                                                                  fann_type * desired_output);
104
105 /* Function: fann_get_MSE
106    Reads the mean square error from the network.
107    
108    Reads the mean square error from the network. This value is calculated during 
109    training or testing, and can therefore sometimes be a bit off if the weights 
110    have been changed since the last calculation of the value.
111    
112    See also:
113         <fann_test_data>
114
115         This function appears in FANN >= 1.1.0.
116  */ 
117 FANN_EXTERNAL float FANN_API fann_get_MSE(struct fann *ann);
118
119 /* Function: fann_get_bit_fail
120         
121         The number of fail bits; means the number of output neurons which differ more 
122         than the bit fail limit (see <fann_get_bit_fail_limit>, <fann_set_bit_fail_limit>). 
123         The bits are counted in all of the training data, so this number can be higher than
124         the number of training data.
125         
126         This value is reset by <fann_reset_MSE> and updated by all the same functions which also
127         updates the MSE value (e.g. <fann_test_data>, <fann_train_epoch>)
128         
129         See also:
130                 <fann_stopfunc_enum>, <fann_get_MSE>
131
132         This function appears in FANN >= 2.0.0
133 */
134 FANN_EXTERNAL unsigned int fann_get_bit_fail(struct fann *ann);
135
136 /* Function: fann_reset_MSE
137    Resets the mean square error from the network.
138    
139    This function also resets the number of bits that fail.
140    
141    See also:
142         <fann_get_MSE>, <fann_get_bit_fail_limit>
143    
144     This function appears in FANN >= 1.1.0
145  */ 
146 FANN_EXTERNAL void FANN_API fann_reset_MSE(struct fann *ann);
147
148 /* Group: Training Data Training */
149
150 #ifndef FIXEDFANN
151         
152 /* Function: fann_train_on_data
153
154    Trains on an entire dataset, for a period of time. 
155    
156    This training uses the training algorithm chosen by <fann_set_training_algorithm>,
157    and the parameters set for these training algorithms.
158    
159    Parameters:
160                 ann - The neural network
161                 data - The data, which should be used during training
162                 max_epochs - The maximum number of epochs the training should continue
163                 epochs_between_reports - The number of epochs between printing a status report to stdout.
164                         A value of zero means no reports should be printed.
165                 desired_error - The desired <fann_get_MSE> or <fann_get_bit_fail>, depending on which stop function
166                         is chosen by <fann_set_train_stop_function>.
167
168         Instead of printing out reports every epochs_between_reports, a callback function can be called 
169         (see <fann_set_callback>).
170         
171         See also:
172                 <fann_train_on_file>, <fann_train_epoch>, <Parameters>
173
174         This function appears in FANN >= 1.0.0.
175 */ 
176 FANN_EXTERNAL void FANN_API fann_train_on_data(struct fann *ann, struct fann_train_data *data,
177                                                                                            unsigned int max_epochs,
178                                                                                            unsigned int epochs_between_reports,
179                                                                                            float desired_error);
180
181 /* Function: fann_train_on_file
182    
183    Does the same as <fann_train_on_data>, but reads the training data directly from a file.
184    
185    See also:
186                 <fann_train_on_data>
187
188         This function appears in FANN >= 1.0.0.
189 */ 
190 FANN_EXTERNAL void FANN_API fann_train_on_file(struct fann *ann, const char *filename,
191                                                                                            unsigned int max_epochs,
192                                                                                            unsigned int epochs_between_reports,
193                                                                                            float desired_error);
194
195 /* Function: fann_train_epoch
196    Train one epoch with a set of training data.
197    
198     Train one epoch with the training data stored in data. One epoch is where all of 
199     the training data is considered exactly once.
200
201         This function returns the MSE error as it is calculated either before or during 
202         the actual training. This is not the actual MSE after the training epoch, but since 
203         calculating this will require to go through the entire training set once more, it is 
204         more than adequate to use this value during training.
205
206         The training algorithm used by this function is chosen by the <fann_set_training_algorithm> 
207         function.
208         
209         See also:
210                 <fann_train_on_data>, <fann_test_data>
211                 
212         This function appears in FANN >= 1.2.0.
213  */ 
214 FANN_EXTERNAL float FANN_API fann_train_epoch(struct fann *ann, struct fann_train_data *data);
215 #endif  /* NOT FIXEDFANN */
216
217 /* Function: fann_test_data
218   
219    Test a set of training data and calculates the MSE for the training data. 
220    
221    This function updates the MSE and the bit fail values.
222    
223    See also:
224         <fann_test>, <fann_get_MSE>, <fann_get_bit_fail>
225
226         This function appears in FANN >= 1.2.0.
227  */ 
228 FANN_EXTERNAL float FANN_API fann_test_data(struct fann *ann, struct fann_train_data *data);
229
230 /* Group: Training Data Manipulation */
231
232 /* Function: fann_read_train_from_file
233    Reads a file that stores training data.
234    
235    The file must be formatted like:
236    >num_train_data num_input num_output
237    >inputdata seperated by space
238    >outputdata seperated by space
239    >
240    >.
241    >.
242    >.
243    >
244    >inputdata seperated by space
245    >outputdata seperated by space
246    
247    See also:
248         <fann_train_on_data>, <fann_destroy_train>, <fann_save_train>
249
250     This function appears in FANN >= 1.0.0
251 */ 
252 FANN_EXTERNAL struct fann_train_data *FANN_API fann_read_train_from_file(const char *filename);
253
254
255 /* Function: fann_destroy_train
256    Destructs the training data and properly deallocates all of the associated data.
257    Be sure to call this function after finished using the training data.
258
259     This function appears in FANN >= 1.0.0
260  */ 
261 FANN_EXTERNAL void FANN_API fann_destroy_train(struct fann_train_data *train_data);
262
263
264 /* Function: fann_shuffle_train_data
265    
266    Shuffles training data, randomizing the order. 
267    This is recommended for incremental training, while it have no influence during batch training.
268    
269    This function appears in FANN >= 1.1.0.
270  */ 
271 FANN_EXTERNAL void FANN_API fann_shuffle_train_data(struct fann_train_data *train_data);
272
273
274 /* Function: fann_scale_input_train_data
275    
276    Scales the inputs in the training data to the specified range.
277
278    See also:
279         <fann_scale_output_train_data>, <fann_scale_train_data>
280
281    This function appears in FANN >= 2.0.0.
282  */ 
283 FANN_EXTERNAL void FANN_API fann_scale_input_train_data(struct fann_train_data *train_data,
284                                                                                                                 fann_type new_min, fann_type new_max);
285
286
287 /* Function: fann_scale_output_train_data
288    
289    Scales the outputs in the training data to the specified range.
290
291    See also:
292         <fann_scale_input_train_data>, <fann_scale_train_data>
293
294    This function appears in FANN >= 2.0.0.
295  */ 
296 FANN_EXTERNAL void FANN_API fann_scale_output_train_data(struct fann_train_data *train_data,
297                                                                                                                  fann_type new_min, fann_type new_max);
298
299
300 /* Function: fann_scale_train_data
301    
302    Scales the inputs and outputs in the training data to the specified range.
303    
304    See also:
305         <fann_scale_output_train_data>, <fann_scale_input_train_data>
306
307    This function appears in FANN >= 2.0.0.
308  */ 
309 FANN_EXTERNAL void FANN_API fann_scale_train_data(struct fann_train_data *train_data,
310                                                                                                   fann_type new_min, fann_type new_max);
311
312
313 /* Function: fann_merge_train_data
314    
315    Merges the data from *data1* and *data2* into a new <struct fann_train_data>.
316    
317    This function appears in FANN >= 1.1.0.
318  */ 
319 FANN_EXTERNAL struct fann_train_data *FANN_API fann_merge_train_data(struct fann_train_data *data1,
320                                                                                                                                          struct fann_train_data *data2);
321
322
323 /* Function: fann_duplicate_train_data
324    
325    Returns an exact copy of a <struct fann_train_data>.
326
327    This function appears in FANN >= 1.1.0.
328  */ 
329 FANN_EXTERNAL struct fann_train_data *FANN_API fann_duplicate_train_data(struct fann_train_data
330                                                                                                                                                  *data);
331         
332 /* Function: fann_subset_train_data
333    
334    Returns an copy of a subset of the <struct fann_train_data>, starting at position *pos* 
335    and *length* elements forward.
336    
337    >fann_subset_train_data(train_data, 0, fann_length_train_data(train_data))
338    
339    Will do the same as <fann_duplicate_train_data>.
340    
341    See also:
342         <fann_length_train_data>
343
344    This function appears in FANN >= 2.0.0.
345  */ 
346 FANN_EXTERNAL struct fann_train_data *FANN_API fann_subset_train_data(struct fann_train_data
347                                                                                                                                                  *data, unsigned int pos,
348                                                                                                                                                  unsigned int length);
349         
350 /* Function: fann_length_train_data
351    
352    Returns the number of training patterns in the <struct fann_train_data>.
353
354    This function appears in FANN >= 2.0.0.
355  */ 
356 FANN_EXTERNAL unsigned int FANN_API fann_length_train_data(struct fann_train_data *data);
357         
358 /* Function: fann_num_input_train_data
359    
360    Returns the number of inputs in each of the training patterns in the <struct fann_train_data>.
361    
362    See also:
363         <fann_num_train_data>, <fann_num_output_train_data>
364
365    This function appears in FANN >= 2.0.0.
366  */ 
367 FANN_EXTERNAL unsigned int FANN_API fann_num_input_train_data(struct fann_train_data *data);
368         
369 /* Function: fann_num_output_train_data
370    
371    Returns the number of outputs in each of the training patterns in the <struct fann_train_data>.
372    
373    See also:
374         <fann_num_train_data>, <fann_num_input_train_data>
375
376    This function appears in FANN >= 2.0.0.
377  */ 
378 FANN_EXTERNAL unsigned int FANN_API fann_num_output_train_data(struct fann_train_data *data);
379         
380 /* Function: fann_save_train
381    
382    Save the training structure to a file, with the format as specified in <fann_read_train_from_file>
383
384    Return:
385    The function returns 0 on success and -1 on failure.
386       
387    See also:
388         <fann_read_train_from_file>, <fann_save_train_to_fixed>
389         
390    This function appears in FANN >= 1.0.0.      
391  */ 
392 FANN_EXTERNAL int FANN_API fann_save_train(struct fann_train_data *data, const char *filename);
393
394
395 /* Function: fann_save_train_to_fixed
396    
397    Saves the training structure to a fixed point data file.
398  
399    This function is very usefull for testing the quality of a fixed point network.
400    
401    Return:
402    The function returns 0 on success and -1 on failure.
403    
404    See also:
405         <fann_save_train>
406
407    This function appears in FANN >= 1.0.0.      
408  */ 
409 FANN_EXTERNAL int FANN_API fann_save_train_to_fixed(struct fann_train_data *data, const char *filename,
410                                                                                                          unsigned int decimal_point);
411
412
413 /* Group: Parameters */
414
415 /* Function: fann_get_training_algorithm
416
417    Return the training algorithm as described by <fann_train_enum>. This training algorithm
418    is used by <fann_train_on_data> and associated functions.
419    
420    Note that this algorithm is also used during <fann_cascadetrain_on_data>, although only
421    FANN_TRAIN_RPROP and FANN_TRAIN_QUICKPROP is allowed during cascade training.
422    
423    The default training algorithm is FANN_TRAIN_RPROP.
424    
425    See also:
426     <fann_set_training_algorithm>, <fann_train_enum>
427
428    This function appears in FANN >= 1.0.0.      
429  */ 
430 FANN_EXTERNAL enum fann_train_enum FANN_API fann_get_training_algorithm(struct fann *ann);
431
432
433 /* Function: fann_set_training_algorithm
434
435    Set the training algorithm.
436    
437    More info available in <fann_get_training_algorithm>
438
439    This function appears in FANN >= 1.0.0.      
440  */ 
441 FANN_EXTERNAL void FANN_API fann_set_training_algorithm(struct fann *ann,
442                                                                                                                 enum fann_train_enum training_algorithm);
443
444
445 /* Function: fann_get_learning_rate
446
447    Return the learning rate.
448    
449    The learning rate is used to determine how aggressive training should be for some of the
450    training algorithms (FANN_TRAIN_INCREMENTAL, FANN_TRAIN_BATCH, FANN_TRAIN_QUICKPROP).
451    Do however note that it is not used in FANN_TRAIN_RPROP.
452    
453    The default learning rate is 0.7.
454    
455    See also:
456         <fann_set_learning_rate>, <fann_set_training_algorithm>
457    
458    This function appears in FANN >= 1.0.0.      
459  */ 
460 FANN_EXTERNAL float FANN_API fann_get_learning_rate(struct fann *ann);
461
462
463 /* Function: fann_set_learning_rate
464
465    Set the learning rate.
466    
467    More info available in <fann_get_learning_rate>
468
469    This function appears in FANN >= 1.0.0.      
470  */ 
471 FANN_EXTERNAL void FANN_API fann_set_learning_rate(struct fann *ann, float learning_rate);
472
473 /* Function: fann_get_learning_momentum
474
475    Get the learning momentum.
476    
477    The learning momentum can be used to speed up FANN_TRAIN_INCREMENTAL training.
478    A too high momentum will however not benefit training. Setting momentum to 0 will
479    be the same as not using the momentum parameter. The recommended value of this parameter
480    is between 0.0 and 1.0.
481
482    The default momentum is 0.
483    
484    See also:
485    <fann_set_learning_momentum>, <fann_set_training_algorithm>
486
487    This function appears in FANN >= 2.0.0.      
488  */ 
489 FANN_EXTERNAL float FANN_API fann_get_learning_momentum(struct fann *ann);
490
491
492 /* Function: fann_set_learning_momentum
493
494    Set the learning momentum.
495
496    More info available in <fann_get_learning_momentum>
497
498    This function appears in FANN >= 2.0.0.      
499  */ 
500 FANN_EXTERNAL void FANN_API fann_set_learning_momentum(struct fann *ann, float learning_momentum);
501
502
503 /* Function: fann_set_activation_function
504
505    Set the activation function for neuron number *neuron* in layer number *layer*, 
506    counting the input layer as layer 0. 
507    
508    It is not possible to set activation functions for the neurons in the input layer.
509    
510    When choosing an activation function it is important to note that the activation 
511    functions have different range. FANN_SIGMOID is e.g. in the 0 - 1 range while 
512    FANN_SIGMOID_SYMMETRIC is in the -1 - 1 range and FANN_LINEAR is unbound.
513    
514    Information about the individual activation functions is available at <fann_activationfunc_enum>.
515    
516    The default activation function is FANN_SIGMOID_STEPWISE.
517    
518    See also:
519         <fann_set_activation_function_layer>, <fann_set_activation_function_hidden>,
520         <fann_set_activation_function_output>, <fann_set_activation_steepness>
521
522    This function appears in FANN >= 2.0.0.
523  */ 
524 FANN_EXTERNAL void FANN_API fann_set_activation_function(struct fann *ann,
525                                                                                                                                 enum fann_activationfunc_enum
526                                                                                                                                 activation_function,
527                                                                                                                                 int layer,
528                                                                                                                                 int neuron);
529
530 /* Function: fann_set_activation_function_layer
531
532    Set the activation function for all the neurons in the layer number *layer*, 
533    counting the input layer as layer 0. 
534    
535    It is not possible to set activation functions for the neurons in the input layer.
536
537    See also:
538         <fann_set_activation_function>, <fann_set_activation_function_hidden>,
539         <fann_set_activation_function_output>, <fann_set_activation_steepness_layer>
540
541    This function appears in FANN >= 2.0.0.
542  */ 
543 FANN_EXTERNAL void FANN_API fann_set_activation_function_layer(struct fann *ann,
544                                                                                                                                 enum fann_activationfunc_enum
545                                                                                                                                 activation_function,
546                                                                                                                                 int layer);
547
548 /* Function: fann_set_activation_function_hidden
549
550    Set the activation function for all of the hidden layers.
551
552    See also:
553         <fann_set_activation_function>, <fann_set_activation_function_layer>,
554         <fann_set_activation_function_output>, <fann_set_activation_steepness_hidden>
555
556    This function appears in FANN >= 1.0.0.
557  */ 
558 FANN_EXTERNAL void FANN_API fann_set_activation_function_hidden(struct fann *ann,
559                                                                                                                                 enum fann_activationfunc_enum
560                                                                                                                                 activation_function);
561
562
563 /* Function: fann_set_activation_function_output
564
565    Set the activation function for the output layer.
566
567    See also:
568         <fann_set_activation_function>, <fann_set_activation_function_layer>,
569         <fann_set_activation_function_hidden>, <fann_set_activation_steepness_output>
570
571    This function appears in FANN >= 1.0.0.
572  */ 
573 FANN_EXTERNAL void FANN_API fann_set_activation_function_output(struct fann *ann,
574                                                                                                                                 enum fann_activationfunc_enum
575                                                                                                                                 activation_function);
576
577 /* Function: fann_set_activation_steepness
578
579    Set the activation steepness for neuron number *neuron* in layer number *layer*, 
580    counting the input layer as layer 0. 
581    
582    It is not possible to set activation steepness for the neurons in the input layer.
583    
584    The steepness of an activation function says something about how fast the activation function 
585    goes from the minimum to the maximum. A high value for the activation function will also
586    give a more agressive training.
587    
588    When training neural networks where the output values should be at the extremes (usually 0 and 1, 
589    depending on the activation function), a steep activation function can be used (e.g. 1.0).
590    
591    The default activation steepness is 0.5.
592    
593    See also:
594         <fann_set_activation_steepness_layer>, <fann_set_activation_steepness_hidden>,
595         <fann_set_activation_steepness_output>, <fann_set_activation_function>
596
597    This function appears in FANN >= 2.0.0.
598  */ 
599 FANN_EXTERNAL void FANN_API fann_set_activation_steepness(struct fann *ann,
600                                                                                                                                 fann_type steepness,
601                                                                                                                                 int layer,
602                                                                                                                                 int neuron);
603
604 /* Function: fann_set_activation_steepness_layer
605
606    Set the activation steepness all of the neurons in layer number *layer*, 
607    counting the input layer as layer 0. 
608    
609    It is not possible to set activation steepness for the neurons in the input layer.
610    
611    See also:
612         <fann_set_activation_steepness>, <fann_set_activation_steepness_hidden>,
613         <fann_set_activation_steepness_output>, <fann_set_activation_function_layer>
614
615    This function appears in FANN >= 2.0.0.
616  */ 
617 FANN_EXTERNAL void FANN_API fann_set_activation_steepness_layer(struct fann *ann,
618                                                                                                                                 fann_type steepness,
619                                                                                                                                 int layer);
620
621 /* Function: fann_set_activation_steepness_hidden
622
623    Set the steepness of the activation steepness in all of the hidden layers.
624
625    See also:
626         <fann_set_activation_steepness>, <fann_set_activation_steepness_layer>,
627         <fann_set_activation_steepness_output>, <fann_set_activation_function_hidden>
628
629    This function appears in FANN >= 1.2.0.
630  */ 
631 FANN_EXTERNAL void FANN_API fann_set_activation_steepness_hidden(struct fann *ann,
632                                                                                                                                  fann_type steepness);
633
634
635 /* Function: fann_set_activation_steepness_output
636
637    Set the steepness of the activation steepness in the output layer.
638
639    See also:
640         <fann_set_activation_steepness>, <fann_set_activation_steepness_layer>,
641         <fann_set_activation_steepness_hidden>, <fann_set_activation_function_output>
642
643    This function appears in FANN >= 1.2.0.
644  */ 
645 FANN_EXTERNAL void FANN_API fann_set_activation_steepness_output(struct fann *ann,
646                                                                                                                                  fann_type steepness);
647
648
649 /* Function: fann_get_train_error_function
650
651    Returns the error function used during training.
652
653    The error functions is described further in <fann_errorfunc_enum>
654    
655    The default error function is FANN_ERRORFUNC_TANH
656    
657    See also:
658         <fann_set_train_error_function>
659       
660    This function appears in FANN >= 1.2.0.
661   */ 
662 FANN_EXTERNAL enum fann_errorfunc_enum FANN_API fann_get_train_error_function(struct fann *ann);
663
664
665 /* Function: fann_set_train_error_function
666
667    Set the error function used during training.
668    
669    The error functions is described further in <fann_errorfunc_enum>
670    
671    See also:
672         <fann_get_train_error_function>
673       
674    This function appears in FANN >= 1.2.0.
675  */ 
676 FANN_EXTERNAL void FANN_API fann_set_train_error_function(struct fann *ann,
677                                                                                                                   enum fann_errorfunc_enum 
678                                                                                                                   train_error_function);
679
680
681 /* Function: fann_get_train_stop_function
682
683    Returns the the stop function used during training.
684    
685    The stop function is described further in <fann_stopfunc_enum>
686    
687    The default stop function is FANN_STOPFUNC_MSE
688    
689    See also:
690         <fann_get_train_stop_function>, <fann_get_bit_fail_limit>
691       
692    This function appears in FANN >= 2.0.0.
693  */ 
694 FANN_EXTERNAL enum fann_stopfunc_enum FANN_API fann_get_train_stop_function(struct fann *ann);
695
696
697 /* Function: fann_set_train_stop_function
698
699    Set the stop function used during training.
700
701    Returns the the stop function used during training.
702    
703    The stop function is described further in <fann_stopfunc_enum>
704    
705    See also:
706         <fann_get_train_stop_function>
707       
708    This function appears in FANN >= 2.0.0.
709  */ 
710 FANN_EXTERNAL void FANN_API fann_set_train_stop_function(struct fann *ann,
711                                                                                                                  enum fann_stopfunc_enum train_stop_function);
712
713
714 /* Function: fann_get_bit_fail_limit
715
716    Returns the bit fail limit used during training.
717    
718    The bit fail limit is used during training where the <fann_stopfunc_enum> is set to FANN_STOPFUNC_BIT.
719
720    The limit is the maximum accepted difference between the desired output and the actual output during
721    training. Each output that diverges more than this limit is counted as an error bit.
722    This difference is divided by two when dealing with symmetric activation functions,
723    so that symmetric and not symmetric activation functions can use the same limit.
724    
725    The default bit fail limit is 0.35.
726    
727    See also:
728         <fann_set_bit_fail_limit>
729    
730    This function appears in FANN >= 2.0.0.
731  */ 
732 FANN_EXTERNAL fann_type FANN_API fann_get_bit_fail_limit(struct fann *ann);
733
734 /* Function: fann_set_bit_fail_limit
735
736    Set the bit fail limit used during training.
737   
738    See also:
739         <fann_get_bit_fail_limit>
740    
741    This function appears in FANN >= 2.0.0.
742  */ 
743 FANN_EXTERNAL void FANN_API fann_set_bit_fail_limit(struct fann *ann, fann_type bit_fail_limit);
744
745 /* Function: fann_set_callback
746    
747    Sets the callback function for use during training.
748         
749    See <fann_callback_type> for more information about the callback function.
750    
751    The default callback function simply prints out some status information.
752
753    This function appears in FANN >= 2.0.0.
754  */
755 FANN_EXTERNAL void FANN_API fann_set_callback(struct fann *ann, fann_callback_type callback);
756
757 /* Function: fann_get_quickprop_decay
758
759    The decay is a small negative valued number which is the factor that the weights 
760    should become smaller in each iteration during quickprop training. This is used 
761    to make sure that the weights do not become too high during training.
762    
763    The default decay is -0.0001.
764    
765    See also:
766         <fann_set_quickprop_decay>
767
768    This function appears in FANN >= 1.2.0.
769  */
770 FANN_EXTERNAL float FANN_API fann_get_quickprop_decay(struct fann *ann);
771
772
773 /* Function: fann_set_quickprop_decay
774    
775    Sets the quickprop decay factor.
776    
777    See also:
778         <fann_get_quickprop_decay>
779
780    This function appears in FANN >= 1.2.0.
781 */ 
782 FANN_EXTERNAL void FANN_API fann_set_quickprop_decay(struct fann *ann, float quickprop_decay);
783
784
785 /* Function: fann_get_quickprop_mu
786
787    The mu factor is used to increase and decrease the step-size during quickprop training. 
788    The mu factor should always be above 1, since it would otherwise decrease the step-size 
789    when it was suppose to increase it.
790    
791    The default mu factor is 1.75. 
792    
793    See also:
794         <fann_set_quickprop_mu>
795
796    This function appears in FANN >= 1.2.0.
797 */ 
798 FANN_EXTERNAL float FANN_API fann_get_quickprop_mu(struct fann *ann);
799
800
801 /* Function: fann_set_quickprop_mu
802
803     Sets the quickprop mu factor.
804    
805    See also:
806         <fann_get_quickprop_mu>
807
808    This function appears in FANN >= 1.2.0.
809 */ 
810 FANN_EXTERNAL void FANN_API fann_set_quickprop_mu(struct fann *ann, float quickprop_mu);
811
812
813 /* Function: fann_get_rprop_increase_factor
814
815    The increase factor is a value larger than 1, which is used to 
816    increase the step-size during RPROP training.
817
818    The default increase factor is 1.2.
819    
820    See also:
821         <fann_set_rprop_increase_factor>
822
823    This function appears in FANN >= 1.2.0.
824 */ 
825 FANN_EXTERNAL float FANN_API fann_get_rprop_increase_factor(struct fann *ann);
826
827
828 /* Function: fann_set_rprop_increase_factor
829
830    The increase factor used during RPROP training.
831
832    See also:
833         <fann_get_rprop_increase_factor>
834
835    This function appears in FANN >= 1.2.0.
836 */ 
837 FANN_EXTERNAL void FANN_API fann_set_rprop_increase_factor(struct fann *ann,
838                                                                                                                    float rprop_increase_factor);
839
840
841 /* Function: fann_get_rprop_decrease_factor
842
843    The decrease factor is a value smaller than 1, which is used to decrease the step-size during RPROP training.
844
845    The default decrease factor is 0.5.
846
847    See also:
848     <fann_set_rprop_decrease_factor>
849
850    This function appears in FANN >= 1.2.0.
851 */ 
852 FANN_EXTERNAL float FANN_API fann_get_rprop_decrease_factor(struct fann *ann);
853
854
855 /* Function: fann_set_rprop_decrease_factor
856
857    The decrease factor is a value smaller than 1, which is used to decrease the step-size during RPROP training.
858
859    See also:
860     <fann_get_rprop_decrease_factor>
861
862    This function appears in FANN >= 1.2.0.
863 */
864 FANN_EXTERNAL void FANN_API fann_set_rprop_decrease_factor(struct fann *ann,
865                                                                                                                    float rprop_decrease_factor);
866
867
868 /* Function: fann_get_rprop_delta_min
869
870    The minimum step-size is a small positive number determining how small the minimum step-size may be.
871
872    The default value delta min is 0.0.
873
874    See also:
875         <fann_set_rprop_delta_min>
876         
877    This function appears in FANN >= 1.2.0.
878 */ 
879 FANN_EXTERNAL float FANN_API fann_get_rprop_delta_min(struct fann *ann);
880
881
882 /* Function: fann_set_rprop_delta_min
883
884    The minimum step-size is a small positive number determining how small the minimum step-size may be.
885
886    See also:
887         <fann_get_rprop_delta_min>
888         
889    This function appears in FANN >= 1.2.0.
890 */ 
891 FANN_EXTERNAL void FANN_API fann_set_rprop_delta_min(struct fann *ann, float rprop_delta_min);
892
893
894 /* Function: fann_get_rprop_delta_max
895
896    The maximum step-size is a positive number determining how large the maximum step-size may be.
897
898    The default delta max is 50.0.
899
900    See also:
901         <fann_set_rprop_delta_max>, <fann_get_rprop_delta_min>
902
903    This function appears in FANN >= 1.2.0.
904 */ 
905 FANN_EXTERNAL float FANN_API fann_get_rprop_delta_max(struct fann *ann);
906
907
908 /* Function: fann_set_rprop_delta_max
909
910    The maximum step-size is a positive number determining how large the maximum step-size may be.
911
912    See also:
913         <fann_get_rprop_delta_max>, <fann_get_rprop_delta_min>
914
915    This function appears in FANN >= 1.2.0.
916 */
917 FANN_EXTERNAL void FANN_API fann_set_rprop_delta_max(struct fann *ann, float rprop_delta_max);
918
919 #endif