note 123294 added to function.fann-train-on-file
| From: | geekgirljoy at gmail dot com | Date: | Thu, 01 Nov 2018 17:11:54 +0000 |
| Subject: | note 123294 added to function.fann-train-on-file | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-209577@lists.php.net to get a copy of this message | ||
Training File (xor.data):
4 2 1
-1 -1
-1
-1 1
1
1 -1
1
1 1
-1
<?php
$num_input = 2;
$num_output = 1;
$num_layers = 3;
$num_neurons_hidden = 3;
$desired_error = 0.001;
$max_epochs = 500000;
$epochs_between_reports = 1000;
$training_data = dirname(__FILE__) . "/xor.data"; // training data file
$ann_save_file = dirname(__FILE__) . "/xor_float.net"; // training data file
// Create ANN object using
$ann = fann_create_standard($num_layers, $num_input, $num_neurons_hidden, $num_output);
if ($ann) {
// Configure the ANN Activation Function
fann_set_activation_function_hidden($ann, FANN_SIGMOID_SYMMETRIC);
fann_set_activation_function_output($ann, FANN_SIGMOID_SYMMETRIC);
// Try to train using fann_train_on_file()
if (fann_train_on_file($ann, $training_data, $max_epochs, $epochs_between_reports,
$desired_error)){
echo 'xor trained.' . PHP_EOL);
}
// Try to save
if (fann_save($ann, $ann_save_file)){
echo 'xor saved.' . PHP_EOL);
}
// Destroy the $ann object
fann_destroy($ann);
}
?>
----
Server IP: 208.43.231.9
Probable Submitter: 172.119.3.190
----
Manual Page -- http://php.net/manual/en/function.fann-train-on-file.php
Edit -- https://master.php.net/note/edit/123294
Del: integrated -- https://master.php.net/note/delete/123294/integrated
Del: useless -- https://master.php.net/note/delete/123294/useless
Del: bad code -- https://master.php.net/note/delete/123294/bad+code
Del: spam -- https://master.php.net/note/delete/123294/spam
Del: non-english -- https://master.php.net/note/delete/123294/non-english
Del: in docs -- https://master.php.net/note/delete/123294/in+docs
Del: other reasons-- https://master.php.net/note/delete/123294
Reject -- https://master.php.net/note/reject/123294
Search -- https://master.php.net/manage/user-notes.php