[Google Colab]
Google Colabを使える状態にする
ローカル側
Google Driveとローカルが同期されるようにする。
Google のバックアップと同期.app

Google Colab側
ドライブをマウントする

GPUを有効にする


chainerをインストール
chainerをインストールする。
念のためGPUが有効であることも確認しておく。

python-shogiとpydlshogiをインストール

これでGoogle Colabを使える状態になった。
Google Colabを使う
ローカル側
.pyファイルの編集等は全てローカル側で行う。
Colab側
ローカル側で行った編集を反映させる必要がある。反映させるにはランタイムを再起動すれば良い。

学習実行
画像は第7章の学習時の画像。

pydlshogiは毎回(ランタイム再起動ごと?)インストールする必要が有るかもしれない。python-shogiはたまに(?)インストールする必要が有るかもしれない。
GPUはCPUの25倍高速
第7章で出てくる評価インターバル100の学習を実施し1評価インターバルの平均時間をCPUとGPUで比較した。結果はCPUは100秒、GPUは4秒。GPUはCPUの25倍高速ということがわかった。
CPU(iMac 3.1GHz 6コア第10世代Intel Core i5プロセッサ)
平均100秒

GPU(Colab)
平均4秒

コメント