查詢

fann_get_cascade_min_cand_epochs()函式—用法及示例

「 獲取級聯訓練演演演算法中的候選訓練週期的最小值 」


函式名:fann_get_cascade_min_cand_epochs()

適用版本:FANN >= 2.1.0

函式說明:該函式用於獲取級聯訓練演演演算法中的候選訓練週期的最小值。級聯訓練是一種神經網路訓練演演演算法,用於增加網路的複雜性和準確性。

用法:

int fann_get_cascade_min_cand_epochs(resource $ann)

引數:

  • $ann:神經網路資源,透過fann_create_standard等函式建立。

返回值: 返回一個整數值,表示級聯訓練演演演算法中的候選訓練週期的最小值。

示例:

<?php
// 建立一個神經網路
$num_input = 2;
$num_output = 1;
$ann = fann_create_standard(3, $num_input, 4, $num_output);

// 設定級聯訓練演演演算法的候選訓練週期最小值為100
fann_set_cascade_min_cand_epochs($ann, 100);

// 獲取級聯訓練演演演算法的候選訓練週期最小值
$min_cand_epochs = fann_get_cascade_min_cand_epochs($ann);
echo "級聯訓練演演演算法的候選訓練週期最小值為:$min_cand_epochs";

// 銷燬神經網路
fann_destroy($ann);
?>

在上面的示例中,我們首先建立了一個包含3個層次的神經網路,其中輸入層有2個神經元,輸出層有1個神經元。然後,我們使用fann_set_cascade_min_cand_epochs()函式將級聯訓練演演演算法的候選訓練週期最小值設定為100。最後,使用fann_get_cascade_min_cand_epochs()函式獲取並輸出了最小值。

補充糾錯
熱門PHP函式
分享連結