English | 简体中文 | 繁體中文
查询

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函数
分享链接