函式名:fann_set_sarprop_step_error_threshold_factor()
適用版本:FANN >= 2.2.0
用法:fann_set_sarprop_step_error_threshold_factor(resource $ann, float $sarprop_step_error_threshold_factor) : bool
此函式用於設定SARProp演演演算法的誤差閾值因子。SARProp(SARProp - 鞍點避免反向傳播演演演算法)是一種用於神經網路訓練的演演演算法,它透過避免陷入鞍點來提高訓練效果。
引數:
- $ann:神經網路資源(由fann_create_standard()或fann_create_from_file()等函式建立)
- $sarprop_step_error_threshold_factor:誤差閾值因子(浮點數型別)
返回值:設定成功返回true,否則返回false。
示例:
$ann = fann_create_standard(2, 2, 1); // 建立一個具有2個輸入層、2個隱藏層和1個輸出層的神經網路
// 設定SARProp演演演算法的誤差閾值因子為0.1
if (fann_set_sarprop_step_error_threshold_factor($ann, 0.1)) {
echo "SARProp step error threshold factor set successfully.";
} else {
echo "Failed to set SARProp step error threshold factor.";
}
fann_destroy($ann); // 銷燬神經網路資源
注意:在呼叫此函式之前,您需要先建立一個神經網路資源(例如使用fann_create_standard()函式)。確保在使用完神經網路資源後呼叫fann_destroy()函式來釋放資源。