Skip to content
eiichiromomma edited this page Aug 17, 2014 · 1 revision

(FANN) fann_create_*

fann_create_standard

BP法のニューラルネットワークを構築する。

FANN_EXTERNAL struct fann *FANN_API fann_create_standard(
  unsigned int num_layers,
  ...
)

出力層を除く各層にはバイアスニューロンが存在し、次の層の全ニューロンと接続する。 ネットワークの実行中はバイアスニューロンは1を出している。

層数と各層のニューロン数を設定する。 struct fannを捨てるにはfann_destroy関数を使う。

パラメータ

  • num_layers
    • 層数
  • ...
    • 各レイヤが何層かを示す整数、入力層、中間層、出力層の順

返り値

新たに作成されたstruct fannポインタ

// Creating an ANN with 2 input neurons, 1 output neuron,
// and two hidden neurons with 8 and 9 neurons
// 2入力、1出力で、中間層は8個、9個の2層
struct fann *ann = fann_create_standard(4, 2, 8, 9, 1);

fann_create_shortcut

標準的なネットワーク(但し接続せずにショートカット状態)を作成する。

FANN_EXTERNAL struct fann *FANN_API fann_create_shortcut(
    unsigned  int  num_layers,
       ...
)

ショートカット接続は層をスキップしている。ちなみに完全接続のショートカットネットワークは入力と出力が繋ったものである。

引数

fann_create_standardと同様

fann_create_from_file

ニューラルネットワークをfann_saveで保存されたファイルから作成。

  FANN_EXTERNAL struct fann *FANN_API fann_create_from_file(
      const  char  * configuration_file
  )
Clone this wiki locally