bukka / php-fann

PHP wrapper for FANN (Fast Artificial Neural Network Library)
Other
213 stars 35 forks source link

Not working in windows #37

Closed lablnet closed 6 years ago

lablnet commented 6 years ago

PHP fann extension not working My enviroment Operating system : Windows 10 x64 PHP version: 7.2.5 Apache version: 2.4.33 I used xampp server my test.php file

    <?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;

$ann = fann_create_standard($num_layers, $num_input, $num_neurons_hidden, $num_output);

if ($ann) {
    fann_set_activation_function_hidden($ann, FANN_SIGMOID_SYMMETRIC);
    fann_set_activation_function_output($ann, FANN_SIGMOID_SYMMETRIC);

    $filename = "xor.data";
    if (fann_train_on_file($ann, $filename, $max_epochs, $epochs_between_reports, $desired_error))
        fann_save($ann,"xor_float.net");
    fann_destroy($ann);
}

This code not show any error and the file xor_float.net not generated/created if i var_dump fann_save function var_dump(fann_save($ann,"xor_float.net")); its return bool(true) but file not created/generated my xor.data file

    4 2 1
-1 -1
-1
-1 1
1
1 -1
1
1 1
-1

I am not writing these files i got these file with php extension http://pecl.php.net/package/fann/1.1.1/windows help me to fix this so i will start go-thru php fann thank you so much

stackoverflow: => https://stackoverflow.com/questions/51552369/php-fann-extension-not-working