fann_read_train_from_file

(PECL fann >= 1.0.0)

fann_read_train_from_file读取存储训练数据的文件。

说明

resource fann_read_train_from_file ( string $filename )

读取存储训练数据的文件。

参数

filename

输入文件的格式如下:

num_train_data num_input num_output
inputdata seperated by space
outputdata seperated by space

.
.
.

inputdata seperated by space
outputdata seperated by space

返回值

Returns a train data resource on success, or FALSE on error.

范例

Example #1 fann_read_train_from_file() 函数的使用范例:

<?php
$train_data 
fann_read_train_from_file("xor.data");
if (
$train_data) {
    
// Do something with $train_data for XOR function
}
?>

xor.data 文件的内容:

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

参见

User Contributed Notes

Ray.Paseur sometimes uses Gmail 04-Mar-2017 05:40
An explanation of the values used in xor.data is available here:
http://php.net/manual/en/fann.examples-1.php#117242