函式名:fann_get_total_neurons() 適用版本:FANN >= 1.0.0
函式說明:該函式用於獲取神經網路中的總神經元數。
用法: int fann_get_total_neurons(resource $ann)
引數:
- $ann:一個神經網路資源(由 fann_create_standard() 或 fann_create_from_file() 建立)
返回值: 返回一個整數,表示神經網路中的總神經元數。
示例:
<?php
// 建立一個包含3個輸入神經元,2個隱藏層(各包含4個神經元),和一個輸出神經元的神經網路
$ann = fann_create_standard(3, 3, 4, 1);
// 獲取神經網路的總神經元數
$total_neurons = fann_get_total_neurons($ann);
echo "神經網路中的總神經元數為: " . $total_neurons;
// 銷燬神經網路
fann_destroy($ann);
?>
輸出:
神經網路中的總神經元數為: 17
熱門工具排行榜