牛牛在线工具

fann_get_sarprop_temperature()

收录 8868 个 PHP 函数,含用途说明与用法示例。

fann_get_sarprop_temperature()

获取Self-Adaptive Resilient Backpropagation (SARPROP) 训练算法中当前温度参数的值

函数名称:fann_get_sarprop_temperature() 适用版本:FANN >= 2.4.0 函数说明:fann_get_sarprop_temperature() 函数用于获取Self-Adaptive Resilient Backpropagation (SARPROP) 训练算法中当前温度参数的值。 用法: float fann_get_sarprop_temperature ( resource $ann ) 参数: $ann:神经网络资源对象(由 fann_create_standard() 或 fann_create_sparse() 等函数创建)。 返回值: 返回当前 SARPROP 算法中温度参数(浮点数)的值。 示例: $ann = fann_create_standard(2, 2, 1); fann_set_training_algorithm($ann, FANN_TRAIN_SARPROP); // 设置并获取 SARPROP 温度参数 fann_set_sarprop_temperature($ann, 0.25); $temperature = fann_get_sarprop_temperature($ann); echo "当前 SARPROP 温度参数为:" . $temperature; fann_destroy($ann); 以上示例中,我们首先创建了一个拥有 2 个输入节点、2 个隐藏节点和 1 个输出节点的神经网络 $ann。然后我们使用 fann_set_training_algorithm() 函数设置训练算法为 SARPROP。接下来,我们使用 fann_set_sarprop_temperature() 函数设置 SARPROP 算法的温度参数为 0.25,并使用 fann_get_sarprop_temperature() 函数获取该温度参数的值,并将其输出到屏幕上。最后,我们销毁了神经网络资源对象。 请注意,要使用 fann_set_sarprop_temperature() 和 fann_get_sarprop_temperature() 函数,你需要在编译 PHP 时启用 FANN 扩展,并且 FANN 版本需大于等于 2.4.0。