查詢

fann_get_cascade_max_out_epochs()函式—用法及示例

「 獲取級聯訓練演演演算法中每個級聯輸出的最大週期數 」


函式名稱:fann_get_cascade_max_out_epochs() 適用版本:FANN >= 2.2.0

函式描述:用於獲取級聯訓練演演演算法中每個級聯輸出的最大週期數。

用法: int fann_get_cascade_max_out_epochs(resource $ann)

引數:

  • $ann:神經網路資源

返回值: 返回最大輸出週期數作為整數。

示例:

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

// 設定級聯訓練引數
fann_set_cascade_activation_functions($ann, FANN_SIGMOID_SYMMETRIC);
fann_set_cascade_activation_steepnesses($ann, 0.5);
fann_set_cascade_num_candidate_groups($ann, 5);
fann_set_cascade_output_change_fraction($ann, 0.01);
fann_set_cascade_output_stagnation_epochs($ann, 12);
fann_set_cascade_candidate_change_fraction($ann, 0.01);
fann_set_cascade_candidate_stagnation_epochs($ann, 12);
fann_set_cascade_weight_multiplier($ann, 0.4);
fann_set_cascade_max_out_epochs($ann, 100); // 設定最大輸出週期數

// 獲取最大輸出週期數
$maxOutEpochs = fann_get_cascade_max_out_epochs($ann);
echo "最大輸出週期數:" . $maxOutEpochs; // 輸出:最大輸出週期數:100

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

注意:此示例假設已經正確安裝FANN擴充套件並將其載入到PHP中。

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