(PECL fann >= 1.0.0)
fann_set_callback — 設(shè)置訓(xùn)練期間使用的回調(diào)函數(shù)。
$ann, collable $callback): bool設(shè)置訓(xùn)練期間使用的回調(diào)函數(shù)。 這意味著它被fann_train_on_data() 或 fann_train_on_file()調(diào)用。
ann神經(jīng)網(wǎng)絡(luò) 資源。
callback提供的回調(diào)函數(shù)接受以下參數(shù):
ann - 神經(jīng)網(wǎng)絡(luò) resourcetrain - 訓(xùn)練數(shù)據(jù) resource
或者 當(dāng)被 fann_train_on_file() 為 nullmax_epochs - 訓(xùn)練將進(jìn)行的最大周期數(shù)。epochs_between_reports - 在調(diào)用該函數(shù)之前訓(xùn)練進(jìn)行的最大周期數(shù)。desired_error - 期望的 fann_get_MSE() 或者
fann_get_bit_fail(), 取決于fann_set_train_stop_function()函數(shù)選擇的停止函數(shù)。epochs - The current epoch
回調(diào)將會(huì)返回 true. 如果返回 false, 表明訓(xùn)練將會(huì)終止。
成功時(shí)返回 true,其它情況下返回 false。