18a9742978
Added AND, NAND, NOR, NOT, OR, XNOR example training data. Added OCR Example. Added Pathfinder Example. Updated README.md to reflect additional examples.
14 linhas
454 B
PHP
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);
|
|
} |