ruby-fann 1.4.1 → 2.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/ext/ruby_fann/fann_augment.h +25 -25
- data/ext/ruby_fann/fann_train.h +268 -268
- data/ext/ruby_fann/ruby_fann.c +301 -298
- data/lib/ruby_fann/version.rb +3 -3
- metadata +7 -5
data/ext/ruby_fann/fann_train.h
CHANGED
@@ -20,18 +20,18 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
20
20
|
#ifndef __fann_train_h__
|
21
21
|
#define __fann_train_h__
|
22
22
|
|
23
|
-
/* Section: FANN Training
|
24
|
-
|
23
|
+
/* Section: FANN Training
|
24
|
+
|
25
25
|
There are many different ways of training neural networks and the FANN library supports
|
26
|
-
a number of different approaches.
|
27
|
-
|
26
|
+
a number of different approaches.
|
27
|
+
|
28
28
|
Two fundementally different approaches are the most commonly used:
|
29
|
-
|
29
|
+
|
30
30
|
Fixed topology training - The size and topology of the ANN is determined in advance
|
31
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
|
32
|
+
the desired output values and the actual output values. This kind of training is
|
33
33
|
supported by <fann_train_on_data>.
|
34
|
-
|
34
|
+
|
35
35
|
Evolving topology training - The training start out with an empty ANN, only consisting
|
36
36
|
of input and output neurons. Hidden neurons and connections is the added during training,
|
37
37
|
in order to reach the same goal as for fixed topology training. This kind of training
|
@@ -40,13 +40,13 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|
40
40
|
|
41
41
|
/* Struct: struct fann_train_data
|
42
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
|
43
|
+
|
44
|
+
The data inside this structure should never be manipulated directly, but should use some
|
45
45
|
of the supplied functions in <Training Data Manipulation>.
|
46
|
-
|
46
|
+
|
47
47
|
The training data structure is very usefull for storing data during training and testing of a
|
48
48
|
neural network.
|
49
|
-
|
49
|
+
|
50
50
|
See also:
|
51
51
|
<fann_read_train_from_file>, <fann_train_on_data>, <fann_destroy_train>
|
52
52
|
*/
|
@@ -56,9 +56,9 @@ struct fann_train_data
|
|
56
56
|
FILE *error_log;
|
57
57
|
char *errstr;
|
58
58
|
|
59
|
-
unsigned
|
60
|
-
unsigned
|
61
|
-
unsigned
|
59
|
+
unsigned long num_data;
|
60
|
+
unsigned long num_input;
|
61
|
+
unsigned long num_output;
|
62
62
|
fann_type **input;
|
63
63
|
fann_type **output;
|
64
64
|
};
|
@@ -73,59 +73,59 @@ struct fann_train_data
|
|
73
73
|
Train one iteration with a set of inputs, and a set of desired outputs.
|
74
74
|
This training is always incremental training (see <fann_train_enum>), since
|
75
75
|
only one pattern is presented.
|
76
|
-
|
76
|
+
|
77
77
|
Parameters:
|
78
78
|
ann - The neural network structure
|
79
79
|
input - an array of inputs. This array must be exactly <fann_get_num_input> long.
|
80
80
|
desired_output - an array of desired outputs. This array must be exactly <fann_get_num_output> long.
|
81
|
-
|
81
|
+
|
82
82
|
See also:
|
83
83
|
<fann_train_on_data>, <fann_train_epoch>
|
84
|
-
|
84
|
+
|
85
85
|
This function appears in FANN >= 1.0.0.
|
86
|
-
*/
|
86
|
+
*/
|
87
87
|
FANN_EXTERNAL void FANN_API fann_train(struct fann *ann, fann_type * input,
|
88
88
|
fann_type * desired_output);
|
89
89
|
|
90
90
|
#endif /* NOT FIXEDFANN */
|
91
|
-
|
91
|
+
|
92
92
|
/* Function: fann_test
|
93
93
|
Test with a set of inputs, and a set of desired outputs.
|
94
94
|
This operation updates the mean square error, but does not
|
95
95
|
change the network in any way.
|
96
|
-
|
96
|
+
|
97
97
|
See also:
|
98
98
|
<fann_test_data>, <fann_train>
|
99
|
-
|
99
|
+
|
100
100
|
This function appears in FANN >= 1.0.0.
|
101
|
-
*/
|
101
|
+
*/
|
102
102
|
FANN_EXTERNAL fann_type * FANN_API fann_test(struct fann *ann, fann_type * input,
|
103
103
|
fann_type * desired_output);
|
104
104
|
|
105
105
|
/* Function: fann_get_MSE
|
106
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
|
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
110
|
have been changed since the last calculation of the value.
|
111
|
-
|
111
|
+
|
112
112
|
See also:
|
113
113
|
<fann_test_data>
|
114
114
|
|
115
115
|
This function appears in FANN >= 1.1.0.
|
116
|
-
*/
|
116
|
+
*/
|
117
117
|
FANN_EXTERNAL float FANN_API fann_get_MSE(struct fann *ann);
|
118
118
|
|
119
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>).
|
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
123
|
The bits are counted in all of the training data, so this number can be higher than
|
124
124
|
the number of training data.
|
125
|
-
|
125
|
+
|
126
126
|
This value is reset by <fann_reset_MSE> and updated by all the same functions which also
|
127
127
|
updates the MSE value (e.g. <fann_test_data>, <fann_train_epoch>)
|
128
|
-
|
128
|
+
|
129
129
|
See also:
|
130
130
|
<fann_stopfunc_enum>, <fann_get_MSE>
|
131
131
|
|
@@ -135,27 +135,27 @@ FANN_EXTERNAL unsigned int FANN_API fann_get_bit_fail(struct fann *ann);
|
|
135
135
|
|
136
136
|
/* Function: fann_reset_MSE
|
137
137
|
Resets the mean square error from the network.
|
138
|
-
|
138
|
+
|
139
139
|
This function also resets the number of bits that fail.
|
140
|
-
|
140
|
+
|
141
141
|
See also:
|
142
142
|
<fann_get_MSE>, <fann_get_bit_fail_limit>
|
143
|
-
|
143
|
+
|
144
144
|
This function appears in FANN >= 1.1.0
|
145
|
-
*/
|
145
|
+
*/
|
146
146
|
FANN_EXTERNAL void FANN_API fann_reset_MSE(struct fann *ann);
|
147
147
|
|
148
148
|
/* Group: Training Data Training */
|
149
149
|
|
150
150
|
#ifndef FIXEDFANN
|
151
|
-
|
151
|
+
|
152
152
|
/* Function: fann_train_on_data
|
153
153
|
|
154
|
-
Trains on an entire dataset, for a period of time.
|
155
|
-
|
154
|
+
Trains on an entire dataset, for a period of time.
|
155
|
+
|
156
156
|
This training uses the training algorithm chosen by <fann_set_training_algorithm>,
|
157
157
|
and the parameters set for these training algorithms.
|
158
|
-
|
158
|
+
|
159
159
|
Parameters:
|
160
160
|
ann - The neural network
|
161
161
|
data - The data, which should be used during training
|
@@ -165,28 +165,28 @@ FANN_EXTERNAL void FANN_API fann_reset_MSE(struct fann *ann);
|
|
165
165
|
desired_error - The desired <fann_get_MSE> or <fann_get_bit_fail>, depending on which stop function
|
166
166
|
is chosen by <fann_set_train_stop_function>.
|
167
167
|
|
168
|
-
Instead of printing out reports every epochs_between_reports, a callback function can be called
|
168
|
+
Instead of printing out reports every epochs_between_reports, a callback function can be called
|
169
169
|
(see <fann_set_callback>).
|
170
|
-
|
170
|
+
|
171
171
|
See also:
|
172
172
|
<fann_train_on_file>, <fann_train_epoch>, <Parameters>
|
173
173
|
|
174
174
|
This function appears in FANN >= 1.0.0.
|
175
|
-
*/
|
175
|
+
*/
|
176
176
|
FANN_EXTERNAL void FANN_API fann_train_on_data(struct fann *ann, struct fann_train_data *data,
|
177
177
|
unsigned int max_epochs,
|
178
178
|
unsigned int epochs_between_reports,
|
179
179
|
float desired_error);
|
180
180
|
|
181
181
|
/* Function: fann_train_on_file
|
182
|
-
|
182
|
+
|
183
183
|
Does the same as <fann_train_on_data>, but reads the training data directly from a file.
|
184
|
-
|
184
|
+
|
185
185
|
See also:
|
186
186
|
<fann_train_on_data>
|
187
187
|
|
188
188
|
This function appears in FANN >= 1.0.0.
|
189
|
-
*/
|
189
|
+
*/
|
190
190
|
FANN_EXTERNAL void FANN_API fann_train_on_file(struct fann *ann, const char *filename,
|
191
191
|
unsigned int max_epochs,
|
192
192
|
unsigned int epochs_between_reports,
|
@@ -194,44 +194,44 @@ FANN_EXTERNAL void FANN_API fann_train_on_file(struct fann *ann, const char *fil
|
|
194
194
|
|
195
195
|
/* Function: fann_train_epoch
|
196
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
|
197
|
+
|
198
|
+
Train one epoch with the training data stored in data. One epoch is where all of
|
199
199
|
the training data is considered exactly once.
|
200
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
|
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
204
|
more than adequate to use this value during training.
|
205
205
|
|
206
|
-
The training algorithm used by this function is chosen by the <fann_set_training_algorithm>
|
206
|
+
The training algorithm used by this function is chosen by the <fann_set_training_algorithm>
|
207
207
|
function.
|
208
|
-
|
208
|
+
|
209
209
|
See also:
|
210
210
|
<fann_train_on_data>, <fann_test_data>
|
211
|
-
|
211
|
+
|
212
212
|
This function appears in FANN >= 1.2.0.
|
213
|
-
*/
|
213
|
+
*/
|
214
214
|
FANN_EXTERNAL float FANN_API fann_train_epoch(struct fann *ann, struct fann_train_data *data);
|
215
215
|
#endif /* NOT FIXEDFANN */
|
216
216
|
|
217
217
|
/* Function: fann_test_data
|
218
|
-
|
219
|
-
Test a set of training data and calculates the MSE for the training data.
|
220
|
-
|
218
|
+
|
219
|
+
Test a set of training data and calculates the MSE for the training data.
|
220
|
+
|
221
221
|
This function updates the MSE and the bit fail values.
|
222
|
-
|
222
|
+
|
223
223
|
See also:
|
224
224
|
<fann_test>, <fann_get_MSE>, <fann_get_bit_fail>
|
225
225
|
|
226
226
|
This function appears in FANN >= 1.2.0.
|
227
|
-
*/
|
227
|
+
*/
|
228
228
|
FANN_EXTERNAL float FANN_API fann_test_data(struct fann *ann, struct fann_train_data *data);
|
229
229
|
|
230
230
|
/* Group: Training Data Manipulation */
|
231
231
|
|
232
232
|
/* Function: fann_read_train_from_file
|
233
233
|
Reads a file that stores training data.
|
234
|
-
|
234
|
+
|
235
235
|
The file must be formatted like:
|
236
236
|
>num_train_data num_input num_output
|
237
237
|
>inputdata seperated by space
|
@@ -243,24 +243,24 @@ FANN_EXTERNAL float FANN_API fann_test_data(struct fann *ann, struct fann_train_
|
|
243
243
|
>
|
244
244
|
>inputdata seperated by space
|
245
245
|
>outputdata seperated by space
|
246
|
-
|
246
|
+
|
247
247
|
See also:
|
248
248
|
<fann_train_on_data>, <fann_destroy_train>, <fann_save_train>
|
249
249
|
|
250
250
|
This function appears in FANN >= 1.0.0
|
251
|
-
*/
|
251
|
+
*/
|
252
252
|
FANN_EXTERNAL struct fann_train_data *FANN_API fann_read_train_from_file(const char *filename);
|
253
253
|
|
254
254
|
|
255
255
|
/* Function: fann_create_train
|
256
256
|
Creates an empty training data struct.
|
257
|
-
|
257
|
+
|
258
258
|
See also:
|
259
259
|
<fann_read_train_from_file>, <fann_train_on_data>, <fann_destroy_train>,
|
260
260
|
<fann_save_train>
|
261
261
|
|
262
262
|
This function appears in FANN >= 2.2.0
|
263
|
-
*/
|
263
|
+
*/
|
264
264
|
FANN_EXTERNAL struct fann_train_data * FANN_API fann_create_train(unsigned int num_data, unsigned int num_input, unsigned int num_output);
|
265
265
|
|
266
266
|
/* Function: fann_create_train_from_callback
|
@@ -281,13 +281,13 @@ FANN_EXTERNAL struct fann_train_data * FANN_API fann_create_train(unsigned int n
|
|
281
281
|
num_output - The number of ouputs per training data
|
282
282
|
input - The set of inputs
|
283
283
|
output - The set of desired outputs
|
284
|
-
|
284
|
+
|
285
285
|
See also:
|
286
286
|
<fann_read_train_from_file>, <fann_train_on_data>, <fann_destroy_train>,
|
287
287
|
<fann_save_train>
|
288
288
|
|
289
289
|
This function appears in FANN >= 2.1.0
|
290
|
-
*/
|
290
|
+
*/
|
291
291
|
FANN_EXTERNAL struct fann_train_data * FANN_API fann_create_train_from_callback(unsigned int num_data,
|
292
292
|
unsigned int num_input,
|
293
293
|
unsigned int num_output,
|
@@ -302,28 +302,28 @@ FANN_EXTERNAL struct fann_train_data * FANN_API fann_create_train_from_callback(
|
|
302
302
|
Be sure to call this function after finished using the training data.
|
303
303
|
|
304
304
|
This function appears in FANN >= 1.0.0
|
305
|
-
*/
|
305
|
+
*/
|
306
306
|
FANN_EXTERNAL void FANN_API fann_destroy_train(struct fann_train_data *train_data);
|
307
307
|
|
308
308
|
|
309
309
|
/* Function: fann_shuffle_train_data
|
310
|
-
|
311
|
-
Shuffles training data, randomizing the order.
|
310
|
+
|
311
|
+
Shuffles training data, randomizing the order.
|
312
312
|
This is recommended for incremental training, while it have no influence during batch training.
|
313
|
-
|
313
|
+
|
314
314
|
This function appears in FANN >= 1.1.0.
|
315
|
-
*/
|
315
|
+
*/
|
316
316
|
FANN_EXTERNAL void FANN_API fann_shuffle_train_data(struct fann_train_data *train_data);
|
317
317
|
|
318
318
|
#ifndef FIXEDFANN
|
319
319
|
/* Function: fann_scale_train
|
320
320
|
|
321
321
|
Scale input and output data based on previously calculated parameters.
|
322
|
-
|
322
|
+
|
323
323
|
Parameters:
|
324
324
|
ann - ann for which were calculated trained parameters before
|
325
325
|
data - training data that needs to be scaled
|
326
|
-
|
326
|
+
|
327
327
|
See also:
|
328
328
|
<fann_descale_train>, <fann_set_scaling_params>
|
329
329
|
|
@@ -334,11 +334,11 @@ FANN_EXTERNAL void FANN_API fann_scale_train( struct fann *ann, struct fann_trai
|
|
334
334
|
/* Function: fann_descale_train
|
335
335
|
|
336
336
|
Descale input and output data based on previously calculated parameters.
|
337
|
-
|
337
|
+
|
338
338
|
Parameters:
|
339
339
|
ann - ann for which were calculated trained parameters before
|
340
340
|
data - training data that needs to be descaled
|
341
|
-
|
341
|
+
|
342
342
|
See also:
|
343
343
|
<fann_scale_train>, <fann_set_scaling_params>
|
344
344
|
|
@@ -349,13 +349,13 @@ FANN_EXTERNAL void FANN_API fann_descale_train( struct fann *ann, struct fann_tr
|
|
349
349
|
/* Function: fann_set_input_scaling_params
|
350
350
|
|
351
351
|
Calculate input scaling parameters for future use based on training data.
|
352
|
-
|
352
|
+
|
353
353
|
Parameters:
|
354
354
|
ann - ann for wgich parameters needs to be calculated
|
355
355
|
data - training data that will be used to calculate scaling parameters
|
356
356
|
new_input_min - desired lower bound in input data after scaling (not strictly followed)
|
357
357
|
new_input_max - desired upper bound in input data after scaling (not strictly followed)
|
358
|
-
|
358
|
+
|
359
359
|
See also:
|
360
360
|
<fann_set_output_scaling_params>
|
361
361
|
|
@@ -370,13 +370,13 @@ FANN_EXTERNAL int FANN_API fann_set_input_scaling_params(
|
|
370
370
|
/* Function: fann_set_output_scaling_params
|
371
371
|
|
372
372
|
Calculate output scaling parameters for future use based on training data.
|
373
|
-
|
373
|
+
|
374
374
|
Parameters:
|
375
375
|
ann - ann for wgich parameters needs to be calculated
|
376
376
|
data - training data that will be used to calculate scaling parameters
|
377
377
|
new_output_min - desired lower bound in input data after scaling (not strictly followed)
|
378
378
|
new_output_max - desired upper bound in input data after scaling (not strictly followed)
|
379
|
-
|
379
|
+
|
380
380
|
See also:
|
381
381
|
<fann_set_input_scaling_params>
|
382
382
|
|
@@ -399,7 +399,7 @@ FANN_EXTERNAL int FANN_API fann_set_output_scaling_params(
|
|
399
399
|
new_input_max - desired upper bound in input data after scaling (not strictly followed)
|
400
400
|
new_output_min - desired lower bound in input data after scaling (not strictly followed)
|
401
401
|
new_output_max - desired upper bound in input data after scaling (not strictly followed)
|
402
|
-
|
402
|
+
|
403
403
|
See also:
|
404
404
|
<fann_set_input_scaling_params>, <fann_set_output_scaling_params>
|
405
405
|
|
@@ -416,7 +416,7 @@ FANN_EXTERNAL int FANN_API fann_set_scaling_params(
|
|
416
416
|
/* Function: fann_clear_scaling_params
|
417
417
|
|
418
418
|
Clears scaling parameters.
|
419
|
-
|
419
|
+
|
420
420
|
Parameters:
|
421
421
|
ann - ann for which to clear scaling parameters
|
422
422
|
|
@@ -427,11 +427,11 @@ FANN_EXTERNAL int FANN_API fann_clear_scaling_params(struct fann *ann);
|
|
427
427
|
/* Function: fann_scale_input
|
428
428
|
|
429
429
|
Scale data in input vector before feed it to ann based on previously calculated parameters.
|
430
|
-
|
430
|
+
|
431
431
|
Parameters:
|
432
432
|
ann - for which scaling parameters were calculated
|
433
433
|
input_vector - input vector that will be scaled
|
434
|
-
|
434
|
+
|
435
435
|
See also:
|
436
436
|
<fann_descale_input>, <fann_scale_output>
|
437
437
|
|
@@ -442,11 +442,11 @@ FANN_EXTERNAL void FANN_API fann_scale_input( struct fann *ann, fann_type *input
|
|
442
442
|
/* Function: fann_scale_output
|
443
443
|
|
444
444
|
Scale data in output vector before feed it to ann based on previously calculated parameters.
|
445
|
-
|
445
|
+
|
446
446
|
Parameters:
|
447
447
|
ann - for which scaling parameters were calculated
|
448
448
|
output_vector - output vector that will be scaled
|
449
|
-
|
449
|
+
|
450
450
|
See also:
|
451
451
|
<fann_descale_output>, <fann_scale_input>
|
452
452
|
|
@@ -457,11 +457,11 @@ FANN_EXTERNAL void FANN_API fann_scale_output( struct fann *ann, fann_type *outp
|
|
457
457
|
/* Function: fann_descale_input
|
458
458
|
|
459
459
|
Scale data in input vector after get it from ann based on previously calculated parameters.
|
460
|
-
|
460
|
+
|
461
461
|
Parameters:
|
462
462
|
ann - for which scaling parameters were calculated
|
463
463
|
input_vector - input vector that will be descaled
|
464
|
-
|
464
|
+
|
465
465
|
See also:
|
466
466
|
<fann_scale_input>, <fann_descale_output>
|
467
467
|
|
@@ -472,11 +472,11 @@ FANN_EXTERNAL void FANN_API fann_descale_input( struct fann *ann, fann_type *inp
|
|
472
472
|
/* Function: fann_descale_output
|
473
473
|
|
474
474
|
Scale data in output vector after get it from ann based on previously calculated parameters.
|
475
|
-
|
475
|
+
|
476
476
|
Parameters:
|
477
477
|
ann - for which scaling parameters were calculated
|
478
478
|
output_vector - output vector that will be descaled
|
479
|
-
|
479
|
+
|
480
480
|
See also:
|
481
481
|
<fann_scale_output>, <fann_descale_input>
|
482
482
|
|
@@ -487,140 +487,140 @@ FANN_EXTERNAL void FANN_API fann_descale_output( struct fann *ann, fann_type *ou
|
|
487
487
|
#endif
|
488
488
|
|
489
489
|
/* Function: fann_scale_input_train_data
|
490
|
-
|
490
|
+
|
491
491
|
Scales the inputs in the training data to the specified range.
|
492
492
|
|
493
493
|
See also:
|
494
494
|
<fann_scale_output_train_data>, <fann_scale_train_data>
|
495
495
|
|
496
496
|
This function appears in FANN >= 2.0.0.
|
497
|
-
*/
|
497
|
+
*/
|
498
498
|
FANN_EXTERNAL void FANN_API fann_scale_input_train_data(struct fann_train_data *train_data,
|
499
499
|
fann_type new_min, fann_type new_max);
|
500
500
|
|
501
501
|
|
502
502
|
/* Function: fann_scale_output_train_data
|
503
|
-
|
503
|
+
|
504
504
|
Scales the outputs in the training data to the specified range.
|
505
505
|
|
506
506
|
See also:
|
507
507
|
<fann_scale_input_train_data>, <fann_scale_train_data>
|
508
508
|
|
509
509
|
This function appears in FANN >= 2.0.0.
|
510
|
-
*/
|
510
|
+
*/
|
511
511
|
FANN_EXTERNAL void FANN_API fann_scale_output_train_data(struct fann_train_data *train_data,
|
512
512
|
fann_type new_min, fann_type new_max);
|
513
513
|
|
514
514
|
|
515
515
|
/* Function: fann_scale_train_data
|
516
|
-
|
516
|
+
|
517
517
|
Scales the inputs and outputs in the training data to the specified range.
|
518
|
-
|
518
|
+
|
519
519
|
See also:
|
520
520
|
<fann_scale_output_train_data>, <fann_scale_input_train_data>
|
521
521
|
|
522
522
|
This function appears in FANN >= 2.0.0.
|
523
|
-
*/
|
523
|
+
*/
|
524
524
|
FANN_EXTERNAL void FANN_API fann_scale_train_data(struct fann_train_data *train_data,
|
525
525
|
fann_type new_min, fann_type new_max);
|
526
526
|
|
527
527
|
|
528
528
|
/* Function: fann_merge_train_data
|
529
|
-
|
529
|
+
|
530
530
|
Merges the data from *data1* and *data2* into a new <struct fann_train_data>.
|
531
|
-
|
531
|
+
|
532
532
|
This function appears in FANN >= 1.1.0.
|
533
|
-
*/
|
533
|
+
*/
|
534
534
|
FANN_EXTERNAL struct fann_train_data *FANN_API fann_merge_train_data(struct fann_train_data *data1,
|
535
535
|
struct fann_train_data *data2);
|
536
536
|
|
537
537
|
|
538
538
|
/* Function: fann_duplicate_train_data
|
539
|
-
|
539
|
+
|
540
540
|
Returns an exact copy of a <struct fann_train_data>.
|
541
541
|
|
542
542
|
This function appears in FANN >= 1.1.0.
|
543
|
-
*/
|
543
|
+
*/
|
544
544
|
FANN_EXTERNAL struct fann_train_data *FANN_API fann_duplicate_train_data(struct fann_train_data
|
545
545
|
*data);
|
546
|
-
|
546
|
+
|
547
547
|
/* Function: fann_subset_train_data
|
548
|
-
|
549
|
-
Returns an copy of a subset of the <struct fann_train_data>, starting at position *pos*
|
548
|
+
|
549
|
+
Returns an copy of a subset of the <struct fann_train_data>, starting at position *pos*
|
550
550
|
and *length* elements forward.
|
551
|
-
|
551
|
+
|
552
552
|
>fann_subset_train_data(train_data, 0, fann_length_train_data(train_data))
|
553
|
-
|
553
|
+
|
554
554
|
Will do the same as <fann_duplicate_train_data>.
|
555
|
-
|
555
|
+
|
556
556
|
See also:
|
557
557
|
<fann_length_train_data>
|
558
558
|
|
559
559
|
This function appears in FANN >= 2.0.0.
|
560
|
-
*/
|
560
|
+
*/
|
561
561
|
FANN_EXTERNAL struct fann_train_data *FANN_API fann_subset_train_data(struct fann_train_data
|
562
562
|
*data, unsigned int pos,
|
563
563
|
unsigned int length);
|
564
|
-
|
564
|
+
|
565
565
|
/* Function: fann_length_train_data
|
566
|
-
|
566
|
+
|
567
567
|
Returns the number of training patterns in the <struct fann_train_data>.
|
568
568
|
|
569
569
|
This function appears in FANN >= 2.0.0.
|
570
|
-
*/
|
570
|
+
*/
|
571
571
|
FANN_EXTERNAL unsigned int FANN_API fann_length_train_data(struct fann_train_data *data);
|
572
|
-
|
572
|
+
|
573
573
|
/* Function: fann_num_input_train_data
|
574
|
-
|
574
|
+
|
575
575
|
Returns the number of inputs in each of the training patterns in the <struct fann_train_data>.
|
576
|
-
|
576
|
+
|
577
577
|
See also:
|
578
578
|
<fann_num_train_data>, <fann_num_output_train_data>
|
579
579
|
|
580
580
|
This function appears in FANN >= 2.0.0.
|
581
|
-
*/
|
581
|
+
*/
|
582
582
|
FANN_EXTERNAL unsigned int FANN_API fann_num_input_train_data(struct fann_train_data *data);
|
583
|
-
|
583
|
+
|
584
584
|
/* Function: fann_num_output_train_data
|
585
|
-
|
585
|
+
|
586
586
|
Returns the number of outputs in each of the training patterns in the <struct fann_train_data>.
|
587
|
-
|
587
|
+
|
588
588
|
See also:
|
589
589
|
<fann_num_train_data>, <fann_num_input_train_data>
|
590
590
|
|
591
591
|
This function appears in FANN >= 2.0.0.
|
592
|
-
*/
|
592
|
+
*/
|
593
593
|
FANN_EXTERNAL unsigned int FANN_API fann_num_output_train_data(struct fann_train_data *data);
|
594
|
-
|
594
|
+
|
595
595
|
/* Function: fann_save_train
|
596
|
-
|
596
|
+
|
597
597
|
Save the training structure to a file, with the format as specified in <fann_read_train_from_file>
|
598
598
|
|
599
599
|
Return:
|
600
600
|
The function returns 0 on success and -1 on failure.
|
601
|
-
|
601
|
+
|
602
602
|
See also:
|
603
603
|
<fann_read_train_from_file>, <fann_save_train_to_fixed>
|
604
|
-
|
605
|
-
This function appears in FANN >= 1.0.0.
|
606
|
-
*/
|
604
|
+
|
605
|
+
This function appears in FANN >= 1.0.0.
|
606
|
+
*/
|
607
607
|
FANN_EXTERNAL int FANN_API fann_save_train(struct fann_train_data *data, const char *filename);
|
608
608
|
|
609
609
|
|
610
610
|
/* Function: fann_save_train_to_fixed
|
611
|
-
|
611
|
+
|
612
612
|
Saves the training structure to a fixed point data file.
|
613
|
-
|
613
|
+
|
614
614
|
This function is very usefull for testing the quality of a fixed point network.
|
615
|
-
|
615
|
+
|
616
616
|
Return:
|
617
617
|
The function returns 0 on success and -1 on failure.
|
618
|
-
|
618
|
+
|
619
619
|
See also:
|
620
620
|
<fann_save_train>
|
621
621
|
|
622
|
-
This function appears in FANN >= 1.0.0.
|
623
|
-
*/
|
622
|
+
This function appears in FANN >= 1.0.0.
|
623
|
+
*/
|
624
624
|
FANN_EXTERNAL int FANN_API fann_save_train_to_fixed(struct fann_train_data *data, const char *filename,
|
625
625
|
unsigned int decimal_point);
|
626
626
|
|
@@ -631,28 +631,28 @@ FANN_EXTERNAL int FANN_API fann_save_train_to_fixed(struct fann_train_data *data
|
|
631
631
|
|
632
632
|
Return the training algorithm as described by <fann_train_enum>. This training algorithm
|
633
633
|
is used by <fann_train_on_data> and associated functions.
|
634
|
-
|
634
|
+
|
635
635
|
Note that this algorithm is also used during <fann_cascadetrain_on_data>, although only
|
636
636
|
FANN_TRAIN_RPROP and FANN_TRAIN_QUICKPROP is allowed during cascade training.
|
637
|
-
|
637
|
+
|
638
638
|
The default training algorithm is FANN_TRAIN_RPROP.
|
639
|
-
|
639
|
+
|
640
640
|
See also:
|
641
641
|
<fann_set_training_algorithm>, <fann_train_enum>
|
642
642
|
|
643
|
-
This function appears in FANN >= 1.0.0.
|
644
|
-
*/
|
643
|
+
This function appears in FANN >= 1.0.0.
|
644
|
+
*/
|
645
645
|
FANN_EXTERNAL enum fann_train_enum FANN_API fann_get_training_algorithm(struct fann *ann);
|
646
646
|
|
647
647
|
|
648
648
|
/* Function: fann_set_training_algorithm
|
649
649
|
|
650
650
|
Set the training algorithm.
|
651
|
-
|
651
|
+
|
652
652
|
More info available in <fann_get_training_algorithm>
|
653
653
|
|
654
|
-
This function appears in FANN >= 1.0.0.
|
655
|
-
*/
|
654
|
+
This function appears in FANN >= 1.0.0.
|
655
|
+
*/
|
656
656
|
FANN_EXTERNAL void FANN_API fann_set_training_algorithm(struct fann *ann,
|
657
657
|
enum fann_train_enum training_algorithm);
|
658
658
|
|
@@ -660,47 +660,47 @@ FANN_EXTERNAL void FANN_API fann_set_training_algorithm(struct fann *ann,
|
|
660
660
|
/* Function: fann_get_learning_rate
|
661
661
|
|
662
662
|
Return the learning rate.
|
663
|
-
|
663
|
+
|
664
664
|
The learning rate is used to determine how aggressive training should be for some of the
|
665
665
|
training algorithms (FANN_TRAIN_INCREMENTAL, FANN_TRAIN_BATCH, FANN_TRAIN_QUICKPROP).
|
666
666
|
Do however note that it is not used in FANN_TRAIN_RPROP.
|
667
|
-
|
667
|
+
|
668
668
|
The default learning rate is 0.7.
|
669
|
-
|
669
|
+
|
670
670
|
See also:
|
671
671
|
<fann_set_learning_rate>, <fann_set_training_algorithm>
|
672
|
-
|
673
|
-
This function appears in FANN >= 1.0.0.
|
674
|
-
*/
|
672
|
+
|
673
|
+
This function appears in FANN >= 1.0.0.
|
674
|
+
*/
|
675
675
|
FANN_EXTERNAL float FANN_API fann_get_learning_rate(struct fann *ann);
|
676
676
|
|
677
677
|
|
678
678
|
/* Function: fann_set_learning_rate
|
679
679
|
|
680
680
|
Set the learning rate.
|
681
|
-
|
681
|
+
|
682
682
|
More info available in <fann_get_learning_rate>
|
683
683
|
|
684
|
-
This function appears in FANN >= 1.0.0.
|
685
|
-
*/
|
684
|
+
This function appears in FANN >= 1.0.0.
|
685
|
+
*/
|
686
686
|
FANN_EXTERNAL void FANN_API fann_set_learning_rate(struct fann *ann, float learning_rate);
|
687
687
|
|
688
688
|
/* Function: fann_get_learning_momentum
|
689
689
|
|
690
690
|
Get the learning momentum.
|
691
|
-
|
691
|
+
|
692
692
|
The learning momentum can be used to speed up FANN_TRAIN_INCREMENTAL training.
|
693
693
|
A too high momentum will however not benefit training. Setting momentum to 0 will
|
694
694
|
be the same as not using the momentum parameter. The recommended value of this parameter
|
695
695
|
is between 0.0 and 1.0.
|
696
696
|
|
697
697
|
The default momentum is 0.
|
698
|
-
|
698
|
+
|
699
699
|
See also:
|
700
700
|
<fann_set_learning_momentum>, <fann_set_training_algorithm>
|
701
701
|
|
702
|
-
This function appears in FANN >= 2.0.0.
|
703
|
-
*/
|
702
|
+
This function appears in FANN >= 2.0.0.
|
703
|
+
*/
|
704
704
|
FANN_EXTERNAL float FANN_API fann_get_learning_momentum(struct fann *ann);
|
705
705
|
|
706
706
|
|
@@ -710,56 +710,56 @@ FANN_EXTERNAL float FANN_API fann_get_learning_momentum(struct fann *ann);
|
|
710
710
|
|
711
711
|
More info available in <fann_get_learning_momentum>
|
712
712
|
|
713
|
-
This function appears in FANN >= 2.0.0.
|
714
|
-
*/
|
713
|
+
This function appears in FANN >= 2.0.0.
|
714
|
+
*/
|
715
715
|
FANN_EXTERNAL void FANN_API fann_set_learning_momentum(struct fann *ann, float learning_momentum);
|
716
716
|
|
717
717
|
|
718
718
|
/* Function: fann_get_activation_function
|
719
719
|
|
720
|
-
Get the activation function for neuron number *neuron* in layer number *layer*,
|
721
|
-
counting the input layer as layer 0.
|
722
|
-
|
720
|
+
Get the activation function for neuron number *neuron* in layer number *layer*,
|
721
|
+
counting the input layer as layer 0.
|
722
|
+
|
723
723
|
It is not possible to get activation functions for the neurons in the input layer.
|
724
|
-
|
724
|
+
|
725
725
|
Information about the individual activation functions is available at <fann_activationfunc_enum>.
|
726
726
|
|
727
727
|
Returns:
|
728
728
|
The activation function for the neuron or -1 if the neuron is not defined in the neural network.
|
729
|
-
|
729
|
+
|
730
730
|
See also:
|
731
731
|
<fann_set_activation_function_layer>, <fann_set_activation_function_hidden>,
|
732
732
|
<fann_set_activation_function_output>, <fann_set_activation_steepness>,
|
733
733
|
<fann_set_activation_function>
|
734
734
|
|
735
735
|
This function appears in FANN >= 2.1.0
|
736
|
-
*/
|
736
|
+
*/
|
737
737
|
FANN_EXTERNAL enum fann_activationfunc_enum FANN_API fann_get_activation_function(struct fann *ann,
|
738
738
|
int layer,
|
739
739
|
int neuron);
|
740
740
|
|
741
741
|
/* Function: fann_set_activation_function
|
742
742
|
|
743
|
-
Set the activation function for neuron number *neuron* in layer number *layer*,
|
744
|
-
counting the input layer as layer 0.
|
745
|
-
|
743
|
+
Set the activation function for neuron number *neuron* in layer number *layer*,
|
744
|
+
counting the input layer as layer 0.
|
745
|
+
|
746
746
|
It is not possible to set activation functions for the neurons in the input layer.
|
747
|
-
|
748
|
-
When choosing an activation function it is important to note that the activation
|
749
|
-
functions have different range. FANN_SIGMOID is e.g. in the 0 - 1 range while
|
747
|
+
|
748
|
+
When choosing an activation function it is important to note that the activation
|
749
|
+
functions have different range. FANN_SIGMOID is e.g. in the 0 - 1 range while
|
750
750
|
FANN_SIGMOID_SYMMETRIC is in the -1 - 1 range and FANN_LINEAR is unbound.
|
751
|
-
|
751
|
+
|
752
752
|
Information about the individual activation functions is available at <fann_activationfunc_enum>.
|
753
|
-
|
753
|
+
|
754
754
|
The default activation function is FANN_SIGMOID_STEPWISE.
|
755
|
-
|
755
|
+
|
756
756
|
See also:
|
757
757
|
<fann_set_activation_function_layer>, <fann_set_activation_function_hidden>,
|
758
758
|
<fann_set_activation_function_output>, <fann_set_activation_steepness>,
|
759
759
|
<fann_get_activation_function>
|
760
760
|
|
761
761
|
This function appears in FANN >= 2.0.0.
|
762
|
-
*/
|
762
|
+
*/
|
763
763
|
FANN_EXTERNAL void FANN_API fann_set_activation_function(struct fann *ann,
|
764
764
|
enum fann_activationfunc_enum
|
765
765
|
activation_function,
|
@@ -768,9 +768,9 @@ FANN_EXTERNAL void FANN_API fann_set_activation_function(struct fann *ann,
|
|
768
768
|
|
769
769
|
/* Function: fann_set_activation_function_layer
|
770
770
|
|
771
|
-
Set the activation function for all the neurons in the layer number *layer*,
|
772
|
-
counting the input layer as layer 0.
|
773
|
-
|
771
|
+
Set the activation function for all the neurons in the layer number *layer*,
|
772
|
+
counting the input layer as layer 0.
|
773
|
+
|
774
774
|
It is not possible to set activation functions for the neurons in the input layer.
|
775
775
|
|
776
776
|
See also:
|
@@ -778,7 +778,7 @@ FANN_EXTERNAL void FANN_API fann_set_activation_function(struct fann *ann,
|
|
778
778
|
<fann_set_activation_function_output>, <fann_set_activation_steepness_layer>
|
779
779
|
|
780
780
|
This function appears in FANN >= 2.0.0.
|
781
|
-
*/
|
781
|
+
*/
|
782
782
|
FANN_EXTERNAL void FANN_API fann_set_activation_function_layer(struct fann *ann,
|
783
783
|
enum fann_activationfunc_enum
|
784
784
|
activation_function,
|
@@ -793,7 +793,7 @@ FANN_EXTERNAL void FANN_API fann_set_activation_function_layer(struct fann *ann,
|
|
793
793
|
<fann_set_activation_function_output>, <fann_set_activation_steepness_hidden>
|
794
794
|
|
795
795
|
This function appears in FANN >= 1.0.0.
|
796
|
-
*/
|
796
|
+
*/
|
797
797
|
FANN_EXTERNAL void FANN_API fann_set_activation_function_hidden(struct fann *ann,
|
798
798
|
enum fann_activationfunc_enum
|
799
799
|
activation_function);
|
@@ -808,64 +808,64 @@ FANN_EXTERNAL void FANN_API fann_set_activation_function_hidden(struct fann *ann
|
|
808
808
|
<fann_set_activation_function_hidden>, <fann_set_activation_steepness_output>
|
809
809
|
|
810
810
|
This function appears in FANN >= 1.0.0.
|
811
|
-
*/
|
811
|
+
*/
|
812
812
|
FANN_EXTERNAL void FANN_API fann_set_activation_function_output(struct fann *ann,
|
813
813
|
enum fann_activationfunc_enum
|
814
814
|
activation_function);
|
815
815
|
|
816
816
|
/* Function: fann_get_activation_steepness
|
817
817
|
|
818
|
-
Get the activation steepness for neuron number *neuron* in layer number *layer*,
|
819
|
-
counting the input layer as layer 0.
|
820
|
-
|
818
|
+
Get the activation steepness for neuron number *neuron* in layer number *layer*,
|
819
|
+
counting the input layer as layer 0.
|
820
|
+
|
821
821
|
It is not possible to get activation steepness for the neurons in the input layer.
|
822
|
-
|
823
|
-
The steepness of an activation function says something about how fast the activation function
|
822
|
+
|
823
|
+
The steepness of an activation function says something about how fast the activation function
|
824
824
|
goes from the minimum to the maximum. A high value for the activation function will also
|
825
825
|
give a more agressive training.
|
826
|
-
|
827
|
-
When training neural networks where the output values should be at the extremes (usually 0 and 1,
|
826
|
+
|
827
|
+
When training neural networks where the output values should be at the extremes (usually 0 and 1,
|
828
828
|
depending on the activation function), a steep activation function can be used (e.g. 1.0).
|
829
|
-
|
829
|
+
|
830
830
|
The default activation steepness is 0.5.
|
831
|
-
|
831
|
+
|
832
832
|
Returns:
|
833
833
|
The activation steepness for the neuron or -1 if the neuron is not defined in the neural network.
|
834
|
-
|
834
|
+
|
835
835
|
See also:
|
836
836
|
<fann_set_activation_steepness_layer>, <fann_set_activation_steepness_hidden>,
|
837
837
|
<fann_set_activation_steepness_output>, <fann_set_activation_function>,
|
838
838
|
<fann_set_activation_steepness>
|
839
839
|
|
840
840
|
This function appears in FANN >= 2.1.0
|
841
|
-
*/
|
841
|
+
*/
|
842
842
|
FANN_EXTERNAL fann_type FANN_API fann_get_activation_steepness(struct fann *ann,
|
843
843
|
int layer,
|
844
844
|
int neuron);
|
845
845
|
|
846
846
|
/* Function: fann_set_activation_steepness
|
847
847
|
|
848
|
-
Set the activation steepness for neuron number *neuron* in layer number *layer*,
|
849
|
-
counting the input layer as layer 0.
|
850
|
-
|
848
|
+
Set the activation steepness for neuron number *neuron* in layer number *layer*,
|
849
|
+
counting the input layer as layer 0.
|
850
|
+
|
851
851
|
It is not possible to set activation steepness for the neurons in the input layer.
|
852
|
-
|
853
|
-
The steepness of an activation function says something about how fast the activation function
|
852
|
+
|
853
|
+
The steepness of an activation function says something about how fast the activation function
|
854
854
|
goes from the minimum to the maximum. A high value for the activation function will also
|
855
855
|
give a more agressive training.
|
856
|
-
|
857
|
-
When training neural networks where the output values should be at the extremes (usually 0 and 1,
|
856
|
+
|
857
|
+
When training neural networks where the output values should be at the extremes (usually 0 and 1,
|
858
858
|
depending on the activation function), a steep activation function can be used (e.g. 1.0).
|
859
|
-
|
859
|
+
|
860
860
|
The default activation steepness is 0.5.
|
861
|
-
|
861
|
+
|
862
862
|
See also:
|
863
863
|
<fann_set_activation_steepness_layer>, <fann_set_activation_steepness_hidden>,
|
864
864
|
<fann_set_activation_steepness_output>, <fann_set_activation_function>,
|
865
865
|
<fann_get_activation_steepness>
|
866
866
|
|
867
867
|
This function appears in FANN >= 2.0.0.
|
868
|
-
*/
|
868
|
+
*/
|
869
869
|
FANN_EXTERNAL void FANN_API fann_set_activation_steepness(struct fann *ann,
|
870
870
|
fann_type steepness,
|
871
871
|
int layer,
|
@@ -873,17 +873,17 @@ FANN_EXTERNAL void FANN_API fann_set_activation_steepness(struct fann *ann,
|
|
873
873
|
|
874
874
|
/* Function: fann_set_activation_steepness_layer
|
875
875
|
|
876
|
-
Set the activation steepness all of the neurons in layer number *layer*,
|
877
|
-
counting the input layer as layer 0.
|
878
|
-
|
876
|
+
Set the activation steepness all of the neurons in layer number *layer*,
|
877
|
+
counting the input layer as layer 0.
|
878
|
+
|
879
879
|
It is not possible to set activation steepness for the neurons in the input layer.
|
880
|
-
|
880
|
+
|
881
881
|
See also:
|
882
882
|
<fann_set_activation_steepness>, <fann_set_activation_steepness_hidden>,
|
883
883
|
<fann_set_activation_steepness_output>, <fann_set_activation_function_layer>
|
884
884
|
|
885
885
|
This function appears in FANN >= 2.0.0.
|
886
|
-
*/
|
886
|
+
*/
|
887
887
|
FANN_EXTERNAL void FANN_API fann_set_activation_steepness_layer(struct fann *ann,
|
888
888
|
fann_type steepness,
|
889
889
|
int layer);
|
@@ -897,7 +897,7 @@ FANN_EXTERNAL void FANN_API fann_set_activation_steepness_layer(struct fann *ann
|
|
897
897
|
<fann_set_activation_steepness_output>, <fann_set_activation_function_hidden>
|
898
898
|
|
899
899
|
This function appears in FANN >= 1.2.0.
|
900
|
-
*/
|
900
|
+
*/
|
901
901
|
FANN_EXTERNAL void FANN_API fann_set_activation_steepness_hidden(struct fann *ann,
|
902
902
|
fann_type steepness);
|
903
903
|
|
@@ -911,7 +911,7 @@ FANN_EXTERNAL void FANN_API fann_set_activation_steepness_hidden(struct fann *an
|
|
911
911
|
<fann_set_activation_steepness_hidden>, <fann_set_activation_function_output>
|
912
912
|
|
913
913
|
This function appears in FANN >= 1.2.0.
|
914
|
-
*/
|
914
|
+
*/
|
915
915
|
FANN_EXTERNAL void FANN_API fann_set_activation_steepness_output(struct fann *ann,
|
916
916
|
fann_type steepness);
|
917
917
|
|
@@ -921,46 +921,46 @@ FANN_EXTERNAL void FANN_API fann_set_activation_steepness_output(struct fann *an
|
|
921
921
|
Returns the error function used during training.
|
922
922
|
|
923
923
|
The error functions is described further in <fann_errorfunc_enum>
|
924
|
-
|
924
|
+
|
925
925
|
The default error function is FANN_ERRORFUNC_TANH
|
926
|
-
|
926
|
+
|
927
927
|
See also:
|
928
928
|
<fann_set_train_error_function>
|
929
|
-
|
929
|
+
|
930
930
|
This function appears in FANN >= 1.2.0.
|
931
|
-
*/
|
931
|
+
*/
|
932
932
|
FANN_EXTERNAL enum fann_errorfunc_enum FANN_API fann_get_train_error_function(struct fann *ann);
|
933
933
|
|
934
934
|
|
935
935
|
/* Function: fann_set_train_error_function
|
936
936
|
|
937
937
|
Set the error function used during training.
|
938
|
-
|
938
|
+
|
939
939
|
The error functions is described further in <fann_errorfunc_enum>
|
940
|
-
|
940
|
+
|
941
941
|
See also:
|
942
942
|
<fann_get_train_error_function>
|
943
|
-
|
943
|
+
|
944
944
|
This function appears in FANN >= 1.2.0.
|
945
|
-
*/
|
945
|
+
*/
|
946
946
|
FANN_EXTERNAL void FANN_API fann_set_train_error_function(struct fann *ann,
|
947
|
-
enum fann_errorfunc_enum
|
947
|
+
enum fann_errorfunc_enum
|
948
948
|
train_error_function);
|
949
949
|
|
950
950
|
|
951
951
|
/* Function: fann_get_train_stop_function
|
952
952
|
|
953
953
|
Returns the the stop function used during training.
|
954
|
-
|
954
|
+
|
955
955
|
The stop function is described further in <fann_stopfunc_enum>
|
956
|
-
|
956
|
+
|
957
957
|
The default stop function is FANN_STOPFUNC_MSE
|
958
|
-
|
958
|
+
|
959
959
|
See also:
|
960
960
|
<fann_get_train_stop_function>, <fann_get_bit_fail_limit>
|
961
|
-
|
961
|
+
|
962
962
|
This function appears in FANN >= 2.0.0.
|
963
|
-
*/
|
963
|
+
*/
|
964
964
|
FANN_EXTERNAL enum fann_stopfunc_enum FANN_API fann_get_train_stop_function(struct fann *ann);
|
965
965
|
|
966
966
|
|
@@ -969,14 +969,14 @@ FANN_EXTERNAL enum fann_stopfunc_enum FANN_API fann_get_train_stop_function(stru
|
|
969
969
|
Set the stop function used during training.
|
970
970
|
|
971
971
|
Returns the the stop function used during training.
|
972
|
-
|
972
|
+
|
973
973
|
The stop function is described further in <fann_stopfunc_enum>
|
974
|
-
|
974
|
+
|
975
975
|
See also:
|
976
976
|
<fann_get_train_stop_function>
|
977
|
-
|
977
|
+
|
978
978
|
This function appears in FANN >= 2.0.0.
|
979
|
-
*/
|
979
|
+
*/
|
980
980
|
FANN_EXTERNAL void FANN_API fann_set_train_stop_function(struct fann *ann,
|
981
981
|
enum fann_stopfunc_enum train_stop_function);
|
982
982
|
|
@@ -984,40 +984,40 @@ FANN_EXTERNAL void FANN_API fann_set_train_stop_function(struct fann *ann,
|
|
984
984
|
/* Function: fann_get_bit_fail_limit
|
985
985
|
|
986
986
|
Returns the bit fail limit used during training.
|
987
|
-
|
987
|
+
|
988
988
|
The bit fail limit is used during training where the <fann_stopfunc_enum> is set to FANN_STOPFUNC_BIT.
|
989
989
|
|
990
990
|
The limit is the maximum accepted difference between the desired output and the actual output during
|
991
991
|
training. Each output that diverges more than this limit is counted as an error bit.
|
992
992
|
This difference is divided by two when dealing with symmetric activation functions,
|
993
993
|
so that symmetric and not symmetric activation functions can use the same limit.
|
994
|
-
|
994
|
+
|
995
995
|
The default bit fail limit is 0.35.
|
996
|
-
|
996
|
+
|
997
997
|
See also:
|
998
998
|
<fann_set_bit_fail_limit>
|
999
|
-
|
999
|
+
|
1000
1000
|
This function appears in FANN >= 2.0.0.
|
1001
|
-
*/
|
1001
|
+
*/
|
1002
1002
|
FANN_EXTERNAL fann_type FANN_API fann_get_bit_fail_limit(struct fann *ann);
|
1003
1003
|
|
1004
1004
|
/* Function: fann_set_bit_fail_limit
|
1005
1005
|
|
1006
1006
|
Set the bit fail limit used during training.
|
1007
|
-
|
1007
|
+
|
1008
1008
|
See also:
|
1009
1009
|
<fann_get_bit_fail_limit>
|
1010
|
-
|
1010
|
+
|
1011
1011
|
This function appears in FANN >= 2.0.0.
|
1012
|
-
*/
|
1012
|
+
*/
|
1013
1013
|
FANN_EXTERNAL void FANN_API fann_set_bit_fail_limit(struct fann *ann, fann_type bit_fail_limit);
|
1014
1014
|
|
1015
1015
|
/* Function: fann_set_callback
|
1016
|
-
|
1016
|
+
|
1017
1017
|
Sets the callback function for use during training.
|
1018
|
-
|
1018
|
+
|
1019
1019
|
See <fann_callback_type> for more information about the callback function.
|
1020
|
-
|
1020
|
+
|
1021
1021
|
The default callback function simply prints out some status information.
|
1022
1022
|
|
1023
1023
|
This function appears in FANN >= 2.0.0.
|
@@ -1026,12 +1026,12 @@ FANN_EXTERNAL void FANN_API fann_set_callback(struct fann *ann, fann_callback_ty
|
|
1026
1026
|
|
1027
1027
|
/* Function: fann_get_quickprop_decay
|
1028
1028
|
|
1029
|
-
The decay is a small negative valued number which is the factor that the weights
|
1030
|
-
should become smaller in each iteration during quickprop training. This is used
|
1029
|
+
The decay is a small negative valued number which is the factor that the weights
|
1030
|
+
should become smaller in each iteration during quickprop training. This is used
|
1031
1031
|
to make sure that the weights do not become too high during training.
|
1032
|
-
|
1032
|
+
|
1033
1033
|
The default decay is -0.0001.
|
1034
|
-
|
1034
|
+
|
1035
1035
|
See also:
|
1036
1036
|
<fann_set_quickprop_decay>
|
1037
1037
|
|
@@ -1041,57 +1041,57 @@ FANN_EXTERNAL float FANN_API fann_get_quickprop_decay(struct fann *ann);
|
|
1041
1041
|
|
1042
1042
|
|
1043
1043
|
/* Function: fann_set_quickprop_decay
|
1044
|
-
|
1044
|
+
|
1045
1045
|
Sets the quickprop decay factor.
|
1046
|
-
|
1046
|
+
|
1047
1047
|
See also:
|
1048
1048
|
<fann_get_quickprop_decay>
|
1049
1049
|
|
1050
1050
|
This function appears in FANN >= 1.2.0.
|
1051
|
-
*/
|
1051
|
+
*/
|
1052
1052
|
FANN_EXTERNAL void FANN_API fann_set_quickprop_decay(struct fann *ann, float quickprop_decay);
|
1053
1053
|
|
1054
1054
|
|
1055
1055
|
/* Function: fann_get_quickprop_mu
|
1056
1056
|
|
1057
|
-
The mu factor is used to increase and decrease the step-size during quickprop training.
|
1058
|
-
The mu factor should always be above 1, since it would otherwise decrease the step-size
|
1057
|
+
The mu factor is used to increase and decrease the step-size during quickprop training.
|
1058
|
+
The mu factor should always be above 1, since it would otherwise decrease the step-size
|
1059
1059
|
when it was suppose to increase it.
|
1060
|
-
|
1061
|
-
The default mu factor is 1.75.
|
1062
|
-
|
1060
|
+
|
1061
|
+
The default mu factor is 1.75.
|
1062
|
+
|
1063
1063
|
See also:
|
1064
1064
|
<fann_set_quickprop_mu>
|
1065
1065
|
|
1066
1066
|
This function appears in FANN >= 1.2.0.
|
1067
|
-
*/
|
1067
|
+
*/
|
1068
1068
|
FANN_EXTERNAL float FANN_API fann_get_quickprop_mu(struct fann *ann);
|
1069
1069
|
|
1070
1070
|
|
1071
1071
|
/* Function: fann_set_quickprop_mu
|
1072
1072
|
|
1073
1073
|
Sets the quickprop mu factor.
|
1074
|
-
|
1074
|
+
|
1075
1075
|
See also:
|
1076
1076
|
<fann_get_quickprop_mu>
|
1077
1077
|
|
1078
1078
|
This function appears in FANN >= 1.2.0.
|
1079
|
-
*/
|
1079
|
+
*/
|
1080
1080
|
FANN_EXTERNAL void FANN_API fann_set_quickprop_mu(struct fann *ann, float quickprop_mu);
|
1081
1081
|
|
1082
1082
|
|
1083
1083
|
/* Function: fann_get_rprop_increase_factor
|
1084
1084
|
|
1085
|
-
The increase factor is a value larger than 1, which is used to
|
1085
|
+
The increase factor is a value larger than 1, which is used to
|
1086
1086
|
increase the step-size during RPROP training.
|
1087
1087
|
|
1088
1088
|
The default increase factor is 1.2.
|
1089
|
-
|
1089
|
+
|
1090
1090
|
See also:
|
1091
1091
|
<fann_set_rprop_increase_factor>
|
1092
1092
|
|
1093
1093
|
This function appears in FANN >= 1.2.0.
|
1094
|
-
*/
|
1094
|
+
*/
|
1095
1095
|
FANN_EXTERNAL float FANN_API fann_get_rprop_increase_factor(struct fann *ann);
|
1096
1096
|
|
1097
1097
|
|
@@ -1103,7 +1103,7 @@ FANN_EXTERNAL float FANN_API fann_get_rprop_increase_factor(struct fann *ann);
|
|
1103
1103
|
<fann_get_rprop_increase_factor>
|
1104
1104
|
|
1105
1105
|
This function appears in FANN >= 1.2.0.
|
1106
|
-
*/
|
1106
|
+
*/
|
1107
1107
|
FANN_EXTERNAL void FANN_API fann_set_rprop_increase_factor(struct fann *ann,
|
1108
1108
|
float rprop_increase_factor);
|
1109
1109
|
|
@@ -1118,7 +1118,7 @@ FANN_EXTERNAL void FANN_API fann_set_rprop_increase_factor(struct fann *ann,
|
|
1118
1118
|
<fann_set_rprop_decrease_factor>
|
1119
1119
|
|
1120
1120
|
This function appears in FANN >= 1.2.0.
|
1121
|
-
*/
|
1121
|
+
*/
|
1122
1122
|
FANN_EXTERNAL float FANN_API fann_get_rprop_decrease_factor(struct fann *ann);
|
1123
1123
|
|
1124
1124
|
|
@@ -1143,9 +1143,9 @@ FANN_EXTERNAL void FANN_API fann_set_rprop_decrease_factor(struct fann *ann,
|
|
1143
1143
|
|
1144
1144
|
See also:
|
1145
1145
|
<fann_set_rprop_delta_min>
|
1146
|
-
|
1146
|
+
|
1147
1147
|
This function appears in FANN >= 1.2.0.
|
1148
|
-
*/
|
1148
|
+
*/
|
1149
1149
|
FANN_EXTERNAL float FANN_API fann_get_rprop_delta_min(struct fann *ann);
|
1150
1150
|
|
1151
1151
|
|
@@ -1155,9 +1155,9 @@ FANN_EXTERNAL float FANN_API fann_get_rprop_delta_min(struct fann *ann);
|
|
1155
1155
|
|
1156
1156
|
See also:
|
1157
1157
|
<fann_get_rprop_delta_min>
|
1158
|
-
|
1158
|
+
|
1159
1159
|
This function appears in FANN >= 1.2.0.
|
1160
|
-
*/
|
1160
|
+
*/
|
1161
1161
|
FANN_EXTERNAL void FANN_API fann_set_rprop_delta_min(struct fann *ann, float rprop_delta_min);
|
1162
1162
|
|
1163
1163
|
|
@@ -1171,7 +1171,7 @@ FANN_EXTERNAL void FANN_API fann_set_rprop_delta_min(struct fann *ann, float rpr
|
|
1171
1171
|
<fann_set_rprop_delta_max>, <fann_get_rprop_delta_min>
|
1172
1172
|
|
1173
1173
|
This function appears in FANN >= 1.2.0.
|
1174
|
-
*/
|
1174
|
+
*/
|
1175
1175
|
FANN_EXTERNAL float FANN_API fann_get_rprop_delta_max(struct fann *ann);
|
1176
1176
|
|
1177
1177
|
|
@@ -1196,7 +1196,7 @@ FANN_EXTERNAL void FANN_API fann_set_rprop_delta_max(struct fann *ann, float rpr
|
|
1196
1196
|
<fann_set_rprop_delta_zero>, <fann_get_rprop_delta_min>, <fann_get_rprop_delta_max>
|
1197
1197
|
|
1198
1198
|
This function appears in FANN >= 2.1.0.
|
1199
|
-
*/
|
1199
|
+
*/
|
1200
1200
|
FANN_EXTERNAL float FANN_API fann_get_rprop_delta_zero(struct fann *ann);
|
1201
1201
|
|
1202
1202
|
|
@@ -1221,7 +1221,7 @@ FANN_EXTERNAL void FANN_API fann_set_rprop_delta_zero(struct fann *ann, float rp
|
|
1221
1221
|
<fann fann_set_sarprop_weight_decay_shift>
|
1222
1222
|
|
1223
1223
|
This function appears in FANN >= 2.1.0.
|
1224
|
-
*/
|
1224
|
+
*/
|
1225
1225
|
FANN_EXTERNAL float FANN_API fann_get_sarprop_weight_decay_shift(struct fann *ann);
|
1226
1226
|
|
1227
1227
|
/* Method: fann_set_sarprop_weight_decay_shift
|
@@ -1232,7 +1232,7 @@ FANN_EXTERNAL float FANN_API fann_get_sarprop_weight_decay_shift(struct fann *an
|
|
1232
1232
|
|
1233
1233
|
See also:
|
1234
1234
|
<fann_set_sarprop_weight_decay_shift>
|
1235
|
-
*/
|
1235
|
+
*/
|
1236
1236
|
FANN_EXTERNAL void FANN_API fann_set_sarprop_weight_decay_shift(struct fann *ann, float sarprop_weight_decay_shift);
|
1237
1237
|
|
1238
1238
|
/* Method: fann_get_sarprop_step_error_threshold_factor
|
@@ -1245,7 +1245,7 @@ FANN_EXTERNAL void FANN_API fann_set_sarprop_weight_decay_shift(struct fann *ann
|
|
1245
1245
|
<fann fann_get_sarprop_step_error_threshold_factor>
|
1246
1246
|
|
1247
1247
|
This function appears in FANN >= 2.1.0.
|
1248
|
-
*/
|
1248
|
+
*/
|
1249
1249
|
FANN_EXTERNAL float FANN_API fann_get_sarprop_step_error_threshold_factor(struct fann *ann);
|
1250
1250
|
|
1251
1251
|
/* Method: fann_set_sarprop_step_error_threshold_factor
|
@@ -1256,7 +1256,7 @@ FANN_EXTERNAL float FANN_API fann_get_sarprop_step_error_threshold_factor(struct
|
|
1256
1256
|
|
1257
1257
|
See also:
|
1258
1258
|
<fann_get_sarprop_step_error_threshold_factor>
|
1259
|
-
*/
|
1259
|
+
*/
|
1260
1260
|
FANN_EXTERNAL void FANN_API fann_set_sarprop_step_error_threshold_factor(struct fann *ann, float sarprop_step_error_threshold_factor);
|
1261
1261
|
|
1262
1262
|
/* Method: fann_get_sarprop_step_error_shift
|
@@ -1269,7 +1269,7 @@ FANN_EXTERNAL void FANN_API fann_set_sarprop_step_error_threshold_factor(struct
|
|
1269
1269
|
<fann_set_sarprop_step_error_shift>
|
1270
1270
|
|
1271
1271
|
This function appears in FANN >= 2.1.0.
|
1272
|
-
*/
|
1272
|
+
*/
|
1273
1273
|
FANN_EXTERNAL float FANN_API fann_get_sarprop_step_error_shift(struct fann *ann);
|
1274
1274
|
|
1275
1275
|
/* Method: fann_set_sarprop_step_error_shift
|
@@ -1280,7 +1280,7 @@ FANN_EXTERNAL float FANN_API fann_get_sarprop_step_error_shift(struct fann *ann)
|
|
1280
1280
|
|
1281
1281
|
See also:
|
1282
1282
|
<fann_get_sarprop_step_error_shift>
|
1283
|
-
*/
|
1283
|
+
*/
|
1284
1284
|
FANN_EXTERNAL void FANN_API fann_set_sarprop_step_error_shift(struct fann *ann, float sarprop_step_error_shift);
|
1285
1285
|
|
1286
1286
|
/* Method: fann_get_sarprop_temperature
|
@@ -1293,7 +1293,7 @@ FANN_EXTERNAL void FANN_API fann_set_sarprop_step_error_shift(struct fann *ann,
|
|
1293
1293
|
<fann_set_sarprop_temperature>
|
1294
1294
|
|
1295
1295
|
This function appears in FANN >= 2.1.0.
|
1296
|
-
*/
|
1296
|
+
*/
|
1297
1297
|
FANN_EXTERNAL float FANN_API fann_get_sarprop_temperature(struct fann *ann);
|
1298
1298
|
|
1299
1299
|
/* Method: fann_set_sarprop_temperature
|
@@ -1304,7 +1304,7 @@ FANN_EXTERNAL float FANN_API fann_get_sarprop_temperature(struct fann *ann);
|
|
1304
1304
|
|
1305
1305
|
See also:
|
1306
1306
|
<fann_get_sarprop_temperature>
|
1307
|
-
*/
|
1307
|
+
*/
|
1308
1308
|
FANN_EXTERNAL void FANN_API fann_set_sarprop_temperature(struct fann *ann, float sarprop_temperature);
|
1309
1309
|
|
1310
1310
|
#endif
|