RL_tutorial

Similar documents

放射線専門医認定試験(2009・20回)/HOHS‐05(基礎二次)

プログラム

日本内科学会雑誌第101巻第12号

日本内科学会雑誌第98巻第4号

日本内科学会雑誌第97巻第7号

日本内科学会雑誌第98巻第3号

listings-ext

104


プログラム 3日目:11月16日(日曜日)

0428_HP用.pdf

30



P1〜14/稲 〃


Python Speed Learning

Ł\”ƒ-2005

第90回日本感染症学会学術講演会抄録(I)

PYTHON 資料 電脳梁山泊烏賊塾 PYTHON 入門 ゲームプログラミング スプライトの衝突判定 スプライトの衝突判定 スプライトの衝突判定の例として インベーダーゲームのコードを 下記に示す PYTHON3 #coding: utf-8 import pygame from pygame.lo

日本内科学会雑誌第102巻第4号

本文/扉1

プログラム


平成20年5月 協会創立50年の歩み 海の安全と環境保全を目指して 友國八郎 海上保安庁 長官 岩崎貞二 日本船主協会 会長 前川弘幸 JF全国漁業協同組合連合会 代表理事会長 服部郁弘 日本船長協会 会長 森本靖之 日本船舶機関士協会 会長 大内博文 航海訓練所 練習船船長 竹本孝弘 第二管区海上保安本部長 梅田宜弘

Program

aphp37-11_プロ1/ky869543540410005590


日本内科学会雑誌第96巻第11号

Œ{Ł¶/1ŒÊ −ªfiª„¾ [ 1…y†[…W ]

4

研究紀要 第5号

第86回日本感染症学会総会学術集会後抄録(II)

橡82-93協力員原稿>授業

17. (1) 18. (1) 19. (1) 20. (1) 21. (1) (3) 22. (1) (3) 23. (1) (3) (1) (3) 25. (1) (3) 26. (1) 27. (1) (3) 28. (1) 29. (1) 2

ジェネリック医薬品販売会社(田辺製薬販売株式会社)の設立に伴う包装変更のご案内


06地図目録.pwd

PowerPoint Presentation

プログラム

cards.gif from Tkinter import * root = Tk() c0 = Canvas(root, width = 400, height = 300) c0.pack() image_data = PhotoImage(file = c1.gif ) c0.create_i


:56 1 (Forward kinematics) (Global frame) G r = (X, Y, Z) (Local frame) L r = (x, y, z) 1 X Y, Z X Y, Z 1 ( ) ( ) 1.2 (Joint rotati

244

from Tkinter import * root = Tk() c0 = Canvas(root, width = 400, height = 300) c0.pack() image_data = PhotoImage(file = c1.gif ) c0.create_image(200,

In [5]: soup.tbody Out[5]: <tbody> <tr> <th><label for=""> </label></th> <td> </td> <td><input checked="checked" class="input-label-horizontal" id="se

Python Speed Learning


IPSJ SIG Technical Report Vol.2016-GI-35 No /3/9 StarCraft AI Deep Q-Network StarCraft: BroodWar Blizzard Entertainment AI Competition AI Convo

¥×¥í¥°¥é¥ß¥ó¥°±é½¬I Exercise on Programming I [1zh] ` `%%%`#`&12_`__~~~ alse

324

デュアルウェア講習会課題 5 会津大学講習会 簡単な IoT を作成 2018 The University of Aizu

離散数理工学 第 2回 数え上げの基礎:漸化式の立て方

8-7th

日本内科学会雑誌第102巻第10号


2015 I ( TA)

jigp60-★WEB用★/ky494773452500058730

プログラム

Visual Python, Numpy, Matplotlib

Anaconda (2019/7/3)


PowerPoint プレゼンテーション

離散数理工学 第 2回 数え上げの基礎:漸化式の立て方

listings-ext

19 3!! (+) (>) (++) (+=) for while 3.1!! (20, 20) (1)(Blocks1.java) import javax.swing.japplet; import java.awt.graphics;

基礎から学ぶトラヒック理論 サンプルページ この本の定価 判型などは, 以下の URL からご覧いただけます. このサンプルページの内容は, 初版 1 刷発行時のものです.

第85 回日本感染症学会総会学術集会後抄録(III)


‘îŁñ›È−wfiÁŁÊ”À„±I --Tensorflow‡ð”g‡Á‡½fl»ŁÊ›ð’Í--

日歯雑誌(H19・5月号)済/P6‐16 クリニカル  柿木 5

O1-1 O1-2 O1-3 O1-4 O1-5 O1-6

スライド 1

1 6/13 2 6/20 3 6/27 4 7/4 5 7/11 6 7/18 N 7 7/25 Warshall-Floyd, Bellman-Ford, Dijkstra TSP DP, 8/1 2 / 36

PowerPoint Presentation

lifedesign_contest_No3

or a 3-1a (0 b ) : max: a b a > b result a result b ( ) result Python : def max(a, b): if a > b: result = a else: result = b ret

9 rbenv rbenv ruby 9.1 rbenv rbenv rbenv ruby ruby-build ruby 9.2 rbenv macos.bash_profile ~/.bash_profile ~/.bash_profile.bak $ touch ~/.bash_profile

: Shift-Return evaluate 2.3 Sage? Shift-Return abs 2 abs? 2: abs 3: fac

RHEA key

CuPy とは何か?

piyo0705B.rtfd

第86回日本感染症学会総会学術集会後抄録(I)

untitled

PowerPoint Presentation

Minsky の電力消費量の調査 (1) ディープラーニングデモプログラム (mnist) の実行デモプログラム 添付 1 CPU 実行 シングル GPU 実行 2GPU 実行での計算時間と電力消費量を比較した 〇計算時間 CPU 実行 シングル GPU 実行複数 GPU 実行 今回は 2GPU 計

Visual Python, Numpy, Matplotlib

1. A0 A B A0 A : A1,...,A5 B : B1,...,B

アンリツ株式会社様

Java演習(4) -- 変数と型 --

基礎数学I

永和システムマネジメント SP 安井力 東京支社 Python 勉強会実習資料 2005/12/28 この資料の使い方最初から順に試してください 初心者は 書かれたとおり入力して ほかにも似た例を試してみてください 初級者は 書かれたとおり入力して なぜそれで動くのか調べてください 中級者は 設問か

EnSight 10.1の新機能

0302TH0130.indd


Emacs Ruby..

Python C/C++ IPMU IRAF

1 matplotlib matplotlib Python matplotlib numpy matplotlib Installing A 2 pyplot matplotlib 1 matplotlib.pyplot matplotlib.pyplot plt import import nu

Transcription:

)! " = $ % & ' "(& &*+ = ' " + %' "(- + %. ' "(. + γ γ=0! " = $ " γ=0.9! " = $ " + 0.9$ " + 0.81$ "+, +

! " #, % #! " #, % # + (( + #,- +. max 2 3! " #,-, % 4! " #, % # ) α

! " #, % ' ( )(#, %)! "#," %,," ' (, ) +, -., ( + 0 -. 0 (+ 1 -. 1 (, ) ) )

! " #, % #! " #, % # + (( + #,- +. max 2 3! " #,-, % 4! " #, % # )

! " #, % #! " #, % # + (( + #,- +. max 2 3! " #,-, % 4! " #, % # ) " #$% + '((* #$%, argmax 1 2( * #$%, 3; 5 #, 5 # 6 )

! ", $ & ' + ) max! " '-., $! ", $ & ' + )& '*+ + ), max!(" '*,, $)

1. 2. 3. 4. 5. 6.

git clone https://github.com/openai/gym.git cd gym // pip install e. // pip install e.[all]

import gym env = gym.make( CartPole-v0 ) env.reset() // env.render() //

import gym env = gym.make( CartPole-v0 ) env.reset() // for _ in range(1000): env.render() action = env.action_space.sample() // env.step(action) //

import chainer import chainer.functions as F import chainer.links as L import chainerrl import gym import numpy as np

env = gym.make('cartpole-v0 ) print("observation space : {}".format(env.observation_space)) print("action space : {}".format(env.action_space)) obs = env.reset() env.render() print( observation : {}.format(obs)) observation space : Box(4,) action space : Discrete(2) observation : [-0.0169323-0.0251642-0.039872 0.0498410]

class QFunction(chainer.Chain): def init (self, obs_size, n_actions, n_hidden_channels=50): # For Python 2.* super(qfunction, self). init ( # For Python 3.* super(self). init ( l0=l.linear(obs_size, n_hidden_channels), l1=l.linear(n_hidden_channels,n_hidden_channels), l2=l.linear(n_hidden_channels, n_actions)) def call (self, x): h = F.tanh(self.l0(x)) h = F.tanh(self.l1(h)) return chainerrl.action_value.discreteactionvalue(self.l2(h)) obs_size = env.observation_space.shape[0] n_actions = env.action_space.n q_func = QFunction(obs_size, n_actions) # GPU q_func.to_gpu(0)

# optimizer = chainer.optimizers.adam(eps=1e-2) optimizer.setup(q_func) # gamma = 0.95 # epsilon greedy explorer = chainerrl.explorers.constantepsilongreedy( epsilon=0.3, random_action_func=env.action_space.sample) # experience replay replay_buffer = chainerrl.replay_buffer.replaybuffer(capacity = 10**6) phi = lambda x:x.astype(np.float32, copy=false) agent = chainerrl.agents.dqn( q_func, optimizer, replay_buffer, gamma, explorer, replay_start_size=500, update_interval=1, target_update_interval=100, phi=phi)

for i in range(1, 200 + 1): obs = env.reset() reward = 0 done = False R = 0 t = 0 while not done and t < 200: env.render() action = agent.act_and_train(obs.astype(np.float32), reward) obs, reward, done, _ = env.step(action) R += reward t += 1 agent.stop_episode_and_train(obs, reward, done) # agent.save( filename )

for i in range(10): obs = env.reset() done = False R = 0 t = 0 while not done and t < 200: env.render() action = agent.act(obs.astype(np.float32)) obs, r, done, _ = env.step(action) R += r t += 1 print('test episode:', i, 'R:', R) agent.stop_episode()

1.

1. 2.

1. 2. 3.