fann_scale_train_data
(PECL fann >= 1.0.0)
fann_scale_train_data — Scales the inputs and outputs in the training data to the specified range
説明
Scales the inputs and outputs in the training data to the specified range.
パラメータ
train_data
-
ニューラルネットワークトレーニングリソース。
new_min
-
New minimum after scaling inputs and outputs in training data.
new_max
-
New maximum after scaling inputs and outputs in training data.
参考
- fann_scale_output_train_data() - Scales the outputs in the training data to the specified range
- fann_scale_input_train_data() - Scales the inputs in the training data to the specified range
+add a note
User Contributed Notes 1 note
geekgirl dot joy at gmail dot com ¶
3 years ago
<?php
// How to scale an existing unscaled training file and save it
$path = 'TrainingData' . DIRECTORY_SEPARATOR;
// Read raw (un-scaled) training data from file
$train_data = fann_read_train_from_file($path . "Training.data");
// Scale to a range of -1 to 1
fann_scale_train_data($train_data, -1, 1);
// Save the new scaled traning data as a file
fann_save_train($train_data, $path . 'ScaledTraining.data');