查詢

fann_get_sarprop_step_error_threshold_factor()函式—用法及示例

「 獲取 SARProp 演演演算法中的步長錯誤閾值因子 」


函式名稱:fann_get_sarprop_step_error_threshold_factor()

函式描述:用於獲取 SARProp 演演演算法中的步長錯誤閾值因子。SARProp 是一種神經網路的訓練演演演算法。

版本要求:該函式適用於 FANN 擴充套件版本 2.2.0 或更新版本。

語法:float fann_get_sarprop_step_error_threshold_factor(resource $ann)

引數:

  • $ann:神經網路資源物件。

返回值: 返回一個浮點數,表示當前 SARProp 演演演算法的步長錯誤閾值因子。

示例:

$ann = fann_create_standard(3, 2, 3, 1); // 建立一個具有 3 層的標準神經網路
// 設定神經網路的一些屬性
fann_set_training_algorithm($ann, FANN_TRAIN_SARPROP);
fann_set_sarprop_step_error_threshold_factor($ann, 0.1);

$factor = fann_get_sarprop_step_error_threshold_factor($ann);
echo "當前 SARProp 演演演算法的步長錯誤閾值因子為:".$factor;

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

輸出結果: 當前 SARProp 演演演算法的步長錯誤閾值因子為:0.1

以上示例建立了一個具有 3 層的標準神經網路,並將其訓練演演演算法設定為 SARProp。然後,使用 fann_set_sarprop_step_error_threshold_factor() 函式將步長錯誤閾值因子設定為 0.1。最後,使用 fann_get_sarprop_step_error_threshold_factor() 函式獲取當前步長錯誤閾值因子,並將其輸出。請注意,示例中的程式碼均為簡化版,並未包含完整的神經網路訓練過程。

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