nodchipのコンピューター将棋ブログ

コンピューター将棋ソフト「tanuki-」シリーズの実験結果を掲載しています。

tanuki- 2023-11-12 層数とnpsの調査

tanuki- 2023-11-12 層数とnpsの調査

実験内容

  • NNUE 評価関数において、層数を増やしていったときの nps を調査した。
    • ネットワークは halfkp_256x2-256{N} とした。
      • {N} は繰り返しを表す。
      • N は繰り返し回数を表す。
    • ネットワークパラメーターはやねうら王学習器を用いてランダムに初期化したものを使用した。

    実験結果

    halfkp_256x2-32-32

    ===========================

    Total time (ms) : 60008

    Nodes searched : 85565935

    Nodes_searched/second : 1425908

    ===========================

    halfkp_256x2-256{2}

    ===========================

    Total time (ms) : 60011

    Nodes searched : 42917293

    Nodes_searched/second : 715157

    ===========================

    halfkp_256x2-256{3}

    ===========================

    Total time (ms) : 60019

    Nodes searched : 35407826

    Nodes_searched/second : 589943

    ===========================

    halfkp_256x2-256{4}

    ===========================

    Total time (ms) : 60016

    Nodes searched : 31898061

    Nodes_searched/second : 531492

    ===========================

    halfkp_256x2-256{5}

    ===========================

    Total time (ms) : 60020

    Nodes searched : 27011362

    Nodes_searched/second : 450039

    ===========================

    halfkp_256x2-256{6}

    ===========================

    Total time (ms) : 60028

    Nodes searched : 23607215

    Nodes_searched/second : 393270

    ===========================

    halfkp_256x2-256{7}

    ===========================

    Total time (ms) : 60020

    Nodes searched : 21208948

    Nodes_searched/second : 353364

    ===========================

    halfkp_256x2-256{8}

    ===========================

    Total time (ms) : 60023

    Nodes searched : 19599295

    Nodes_searched/second : 326529

    ===========================

    halfkp_256x2-256{9}

    ===========================

    Total time (ms) : 60026

    Nodes searched : 17998055

    Nodes_searched/second : 299837

    ===========================

    halfkp_256x2-256{10}

    ===========================

    Total time (ms) : 60026

    Nodes searched : 16611812

    Nodes_searched/second : 276743

    ===========================

    halfkp_256x2-256{11}

    ===========================

    Total time (ms) : 60063

    Nodes searched : 14930093

    Nodes_searched/second : 248573

    ===========================

    halfkp_256x2-256{12}

    ===========================

    Total time (ms) : 60022

    Nodes searched : 14083537

    Nodes_searched/second : 234639

    ===========================

    halfkp_256x2-256{13}

    ===========================

    Total time (ms) : 60028

    Nodes searched : 12846397

    Nodes_searched/second : 214006

    ===========================

    halfkp_256x2-256{14}

    ===========================

    Total time (ms) : 60044

    Nodes searched : 11841153

    Nodes_searched/second : 197207

    ===========================

    halfkp_256x2-256{15}

    ===========================

    Total time (ms) : 60041

    Nodes searched : 10928828

    Nodes_searched/second : 182022

    ===========================

    halfkp_256x2-256{16}

    ===========================

    Total time (ms) : 60043

    Nodes searched : 9810342

    Nodes_searched/second : 163388

    ===========================

    halfkp_256x2-256{17}

    ===========================

    Total time (ms) : 60032

    Nodes searched : 9422553

    Nodes_searched/second : 156958

    ===========================

    halfkp_256x2-256{18}

    ===========================

    Total time (ms) : 60058

    Nodes searched : 8251718

    Nodes_searched/second : 137395

    ===========================

    halfkp_256x2-256{19}

    ===========================

    Total time (ms) : 60060

    Nodes searched : 7478564

    Nodes_searched/second : 124518

    ===========================

    隠れ層の層数 nps
    3 715157
    4 589943
    5 531492
    6 450039
    7 393270
    8 353364
    9 326529
    10 299837
    11 276743
    12 248573
    13 234639
    14 214006
    15 197207
    16 182022
    17 163388
    18 156958
    19 137395
    20 124518

    隠れ層の総数が増えていくほど、nps は下がっていった。

    nps の下がり方は、隠れ層の総数が増えていくほど小さくなっていった。

    考察

    隠れ層の層数が 15 層でも 20 万 nps 程度出ている。ふかうら王で GeForce RTX 4070 1 枚で第2回世界将棋AI電竜戦エキシビジョンバージョンのネットワークを使用して 3 万 nps 程度であることを考えると、有力な選択肢と言える。ただし、探索部のαβ法←→PUCTの違い、特徴量の halfkp←→画像の違い、ネットワークの Fully Connected←→ResNet の違い等、様々な相違点は考慮しなければならない。

    halfkp_256x2-32-32 で 140 万 nps という数字が出ていることを考えると、学習後は何割か速度が落ちると思う。それでも十分な nps が出ていると思う。

    まとめ

    NNUE 評価関数において、層数を増やしていったときの nps を調査した。ネットワークは halfkp_256x2-256{N} とした。ここで、{N} は繰り返しを表す。また、 N は繰り返し回数を表す。ネットワークパラメーターはやねうら王学習器を用いてランダムに初期化したものを使用した。

    結果、隠れ層の層数が 15 層でも 20 万 nps 程度出ている。ふかうら王で GeForce RTX 4070 1 枚で第2回世界将棋AI電竜戦エキシビジョンバージョンのネットワークを使用して 3 万 nps 程度であることを考えると、有力な選択肢と言える。