LoginSignup
0
1

More than 5 years have passed since last update.

TensorFlow | ADDA > 線形方程式を解き直してみた (solverをQMRからBi-CGStabに変更) > ほぼ同じ結果

Last updated at Posted at 2017-09-16
動作環境
GeForce GTX 1070 (8GB)
ASRock Z170M Pro4S [Intel Z170chipset]
Ubuntu 16.04 LTS desktop amd64
TensorFlow v1.2.1
cuDNN v5.1 for Linux
CUDA v8.0
Python 3.5.2
IPython 6.0.0 -- An enhanced Interactive Python.
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
GNU bash, version 4.3.48(1)-release (x86_64-pc-linux-gnu)

学習コードv0.1 http://qiita.com/7of9/items/5819f36e78cc4290614e

http://qiita.com/7of9/items/8cf6182f8086a419f9fe
の続き。

概要

This article is related to ADDA (light scattering simulator based on the discrete dipole approximation).

  • TFRecordsを読込んで学習する
  • input: 5 nodes
  • output: 6 nodes
  • サンプル数: 223,872
  • 学習データ: ADDAにより計算した値
    • #input
    • x,y,z: dipole position
    • refractive index: real and imaginary part
    • #output
    • initial values for linear equation solution for (x,y,z),(real,imaginary)

5次元関数の補間を学習させようとしている。
(5次元の回帰問題というのだろうか?)

変更点

http://qiita.com/7of9/items/032b224a4094df58e5b2
にて気づいたのがiterative solverのbreakdown (参照: manual.pdf p39)。

breakdownというのはsolverの誤差減少が進まなくなる症状のようだ。
Bi-CGやQMR, QMR2というsolverを用いた時、breakdownが生じる場合があるとのこと。
(CGNRやCSYMはbreakdownしにくい?)

ADDAのデフォルトsolverはQMR。
QMRでnumber of iterationを見ると確かにbreakdownしているような兆候がある。

そのため、breakdownしていなさそうなBi-CGStabにsolverを変更し、その結果をTensorFlowで学習させた。

結果

A:type B:original[回] C:TF学習[回] D:C/B
Bi-CGStab 26 21 0.846

(originalの初期誤差:1.0, TF学習を用いた場合の初期誤差:0.06008)

QMRの結果とほとんど変わらず。

RE_000 = 6.0084932894E-02
RE_001 = 2.2219480098E-02  + 
RE_002 = 1.3024803445E-02  + 
RE_003 = 6.7950270565E-03  + 
RE_004 = 1.6579624353E-02  - 
RE_005 = 3.2195123056E-03  + 
RE_006 = 1.8954598531E-03  + 
RE_007 = 2.0297016676E-03  - 
RE_008 = 1.0293947020E-03  + 
RE_009 = 7.9445808838E-04  + 
RE_010 = 9.7065385626E-04  - 
RE_011 = 8.0464080288E-04  -+
RE_012 = 3.0441618705E-04  + 
RE_013 = 2.7334021124E-04  + 
RE_014 = 9.6562247371E-05  + 
RE_015 = 5.8637230384E-05  + 
RE_016 = 4.0160684625E-05  + 
RE_017 = 3.8796530660E-05  + 
RE_018 = 3.8270488935E-05  + 
RE_019 = 6.4025491347E-05  - 
RE_020 = 1.0453903490E-05  + 
RE_021 = 9.9663182590E-06  + 

初期誤差を1E-05あたりまで抑えないと自分が希望しているほどの効率化にはなりそうにない。
初期誤差が1E-05になるようなNeural network学習のパラメータとハイパーパラメータは見つかっていない。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1