Arquivos
Joy Harvel 18a9742978 Adding Examples
Added AND, NAND, NOR, NOT, OR, XNOR example training data. Added OCR
Example. Added Pathfinder Example. Updated README.md to reflect
additional examples.
2016-08-18 02:49:18 -07:00

14 linhas
454 B
PHP

<?php
$train_file = (dirname(__FILE__) . "/xor_float.net");
if (!is_file($train_file))
die("The file xor_float.net has not been created! Please run simple_train.php to generate it" . PHP_EOL);
$ann = fann_create_from_file($train_file);
if ($ann) {
$input = array(-1, 1);
$calc_out = fann_run($ann, $input);
printf("xor test (%f,%f) -> %f\n", $input[0], $input[1], $calc_out[0]);
fann_destroy($ann);
} else {
die("Invalid file format" . PHP_EOL);
}