Slide 47
Slide 47 text
コードによる確認
47
● ノートブック「Chapter05/03_Walk_Game_Training.ipynb」を参照
○ 平均して20ステップ程度進めるエージェントが学習される
def build_model(self):
cnn_input = layers.Input(shape=(14, 14, 2))
cnn = layers.Conv2D(8, (5, 5), padding='same', use_bias=True,
activation='relu')(cnn_input)
cnn_flatten = layers.Flatten()(cnn)
action_input = layers.Input(shape=(4,))
combined = layers.concatenate([cnn_flatten, action_input])
hidden1 = layers.Dense(2048, activation='relu')(combined)
hidden2 = layers.Dense(1024, activation='relu')(hidden1)
q_value = layers.Dense(1)(hidden2)
model = models.Model(inputs=[cnn_input, action_input], outputs=q_value)
model.compile(loss='mse')
return model
##############
# #
# x #
#x x #
# x x x#
# *++ x#
# +++#
# ++ +++#
# ++x + #
# +++++++ #
# #
# x #
# x #
##############
Length: 21
ニューラルネットワークの定義