PHPマニュアル/PEARマニュアル | ユーザフォーラムで議論/質問 | マニュアル検索 | ハイライト | ハイライトオフ | ポータル | php spot

fann_create_train_from_callback - Creates the training data struct from a user supplied function | JavaScript入門&応用&リファレンスなら「JavaScriptist」

  

fann_create_train_from_callback

(PECL fann >= 1.0.0)

fann_create_train_from_callbackCreates the training data struct from a user supplied function

説明

resource fann_create_train_from_callback ( int $num_data , int $num_input , int $num_output , callable $user_function )

Creates the training data struct from a user supplied function. As the training data are numerable (data 1, data 2...), the user must write a function that receives the number of the training data set (input, output) and returns the set.

パラメータ

num_data

The number of training data

num_input

The number of inputs per training data

num_output

The number of ouputs per training data

user_function

The user supplied function with following parameters:

  • num - The number of the training data set
  • num_input - The number of inputs per training data
  • num_output - The number of ouputs per training data

The function should return an associative array with keys input and output and two array values of input and output.

返り値

成功した場合にニューラルネットワークトレーニングリソース、エラー時に FALSE を返します。

例1 fann_create_train_from_callback() example

<?php
function create_train_callback($num_data$num_input$num_output) {
    return array(
        
"input" => array_fill(0$num_input1),
        
"output" => array_fill(0$num_output1),
    );
}

$num_data 3;
$num_input 2;
$num_output 1;
$train_data fann_create_train_from_callback($num_data$num_input$num_output"create_train_callback");
if (
$train_data) {
    
// Do something with $train_data
}
?>

参考


忘却曲線を使ってこの関数を確実に記憶に残す

フォーラムで「fann_create_train_from_callback - Creates the training data struct from a user supplied function」について話す
各種マニュアル: PHPマニュアル | PEARマニュアル | Smarty(英語)マニュアル | PHP-GTKマニュアル | fann_create_train_from_callback - Creates the training data struct from a user supplied function」をGoogle検索
copyright © 1997-2024 PHP ドキュメント作成グループ(ライセンス). provided by php spot. マニュアル: