Upgrade to Pro — share decks privately, control downloads, hide ads and more …

深層学習は金融市場をシミュレーションすることができるか?

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.

 深層学習は金融市場をシミュレーションすることができるか?

2017年5月11日 GMOエンジニアトークにて公開

Avatar for GMO次世代

GMO次世代

May 16, 2017
Tweet

More Decks by GMO次世代

Other Decks in Technology

Transcript

  1. 出展:Bloomberg/How a $26 Billion Hedge Fund Lures the Beautiful Minds

    AIを使ったヘッジファンド だけ利益を上げている 伝統的手法のヘッジファンドは 大きな損失を被っている 2016年:ヘッジファンド業界の明暗 黒字 赤字
  2. 40 •DCGANの仕組みの図 D G 画 像 数 値 画像を生成 (出力:配列)

    D(x) 入力画像が 実物である確率(0~1.0) Discriminator Generator -1.0 ~ 1.0
  3. 46 •Discriminatorの実装 [参考] https://github.com/carpedm20/DCGAN-tensorflow def discriminator(self, image, reuse=False): with tf.variable_scope("discriminator")

    as scope: if reuse: scope.reuse_variables() h0 = lrelu(conv2d(image, self.df_dim, name='d_h0_conv')) h1 = lrelu(self.d_bn1(conv2d(h0, self.df_dim*2, name='d_h1_conv'))) h2 = lrelu(self.d_bn2(conv2d(h1, self.df_dim*4, name='d_h2_conv'))) h3 = lrelu(self.d_bn3(conv2d(h2, self.df_dim*8, name='d_h3_conv'))) h4 = linear(tf.reshape(h3, [self.batch_size, -1]), 1, 'd_h3_lin') return tf.nn.sigmoid(h4), h4 画像データ(配列) 判定結果(=確率:0~1.0)
  4. 47 •Generatorの実装 [参考] https://github.com/carpedm20/DCGAN-tensorflow def generator(self, z): with tf.variable_scope(“generator”) as

    scope: s_h, s_w = self.output_height, self.output_width s_h2, s_w2 = conv_out_size_same(s_h, 2), conv_out_size_same(s_w, 2) s_h4, s_w4 = conv_out_size_same(s_h2, 2), conv_out_size_same(s_w2, 2) s_h8, s_w8 = conv_out_size_same(s_h4, 2), conv_out_size_same(s_w4, 2) s_h16, s_w16 = conv_out_size_same(s_h8, 2), conv_out_size_same(s_w8, 2) ・・・中略・・・ h4, self.h4_w, self.h4_b = deconv2d( h3, [self.batch_size, s_h, s_w, self.c_dim], name='g_h4', with_w=True) return tf.nn.tanh(h4) ノイズベクトル 生成された画像
  5. 48 •Train(学習処理)の実装 def train(self, config): data = glob(os.path.join("./data", config.dataset, self.input_fname_pattern))

    d_optim = tf.train.AdamOptimizer(config.learning_rate, beta1=config.beta1) ¥ .minimize(self.d_loss, var_list=self.d_vars) g_optim = tf.train.AdamOptimizer(config.learning_rate, beta1=config.beta1) ¥ .minimize(self.g_loss, var_list=self.g_vars) ・・・中略・・・ _, summary_str = self.sess.run([d_optim, self.d_sum], feed_dict={ self.inputs: batch_images, self.z: batch_z }) self.writer.add_summary(summary_str, counter) _, summary_str = self.sess.run([g_optim, self.g_sum], feed_dict={ self.z: batch_z }) self.writer.add_summary(summary_str, counter) [参考] https://github.com/carpedm20/DCGAN-tensorflow Discriminatorの最適化処理の定義 Generatorの最適化処理の定義 Discriminatorの最適化 Generatorの最適化
  6. 50 •学習データ  外国為替市場・ドル円相場の値動き  2001年1月1日~2015年12月31日  1つのチャート=100日分の値動き  全部で約3700枚のチャート

     各チャートの仕様  サイズ=100 × 100 px、PNG画像  横1px = 1日、縦1px=0.5%の値動き  各日の終値をプロット
  7. 52 2012.09.06,78.39700,79.01700,78.37300,78.86500,44305,0 2012.09.07,78.86400,79.01300,78.01100,78.23700,47756,0 2012.09.10,78.24600,78.32400,78.18000,78.26000,33419,0 2012.09.11,78.26000,78.26700,77.69600,77.79600,42421,0 2012.09.12,77.79600,77.95900,77.73400,77.83200,50431,0 2012.09.13,77.83400,77.86400,77.13500,77.48300,52831,0 2012.09.14,77.48000,78.38700,77.48000,78.38300,57885,0 2012.09.17,78.35500,78.91800,78.16000,78.71800,47303,0 ・・・中略・・・

    2013.01.16,88.81800,88.84900,87.79000,88.56800,111439,0 2013.01.17,88.56700,90.10500,88.12900,89.95300,120314,0 2013.01.18,89.95200,90.18200,89.63200,90.08300,105490,0 2013.01.21,90.14800,90.22800,89.33600,89.81300,91509,0 2013.01.22,89.81400,90.11800,88.36400,88.75200,117091,0 2013.01.23,88.75100,88.78900,88.05600,88.53800,106533,0 2013.01.24,88.53500,90.53100,88.41600,90.42000,111112,0 2013.01.25,90.42200,91.19200,90.28500,90.87700,106284,0 このような数値の羅列 (=時系列データ)が...
  8. 53 こうなります! 100px 100px ±0% +12.5% +25.0% -12.5% -25.0% 変

    化 率 50日 100日 経過日数 アベノミクス相場 スタート!
  9. 62 •Generatorが創造したチャート(抜粋) ±0% +12.5% +25.0% -12.5% -25.0% 50日 100日 経過日数

    変 化 率 ±0% +12.5% +25.0% -12.5% -25.0% 変 化 率 50日 100日 経過日数 ※ノイズ補正処理を実施しています。
  10. 71 •Discriminatorの判定能力をテストする D 画 像 D(x) 入力画像が 実物である確率 Discriminator 入力した画像がニセモノであれば、

    Discriminatorの出力は0に近くなる はずである! 実物 :1.0 に近い ニセモノ:0 に近い
  11. 75  実物チャートの識別  正解率:約98%(※)  ニセモノチャートの識別  50枚中50枚全て正解 深層学習

    (CNN:畳み込みネットワーク) の本領発揮 ※100回実施して得られた正解率の平均値