首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用keras的带有LSTM的A3C

使用keras的带有LSTM的A3C
EN

Stack Overflow用户
提问于 2018-03-30 16:09:06
回答 1查看 835关注 0票数 0

我正在尝试使用keras实现一个带有LSTM的A3C模型,我开始使用这个不带LSTM的A3C版本:"https://github.com/coreylynch/async-rl",并尝试只修改网络代码,但我很难编译整个模型:

我是不是漏掉了什么?

这是我的模型:

代码语言:javascript
复制
state = tf.placeholder("float", [None, agent_history_length, resized_width, resized_height])

vision_model = Sequential()
vision_model.add(Conv2D(activation="relu", filters=16, kernel_size=(8, 8), name="conv1", padding="same", strides=(4, 4),input_shape=(agent_history_length,resized_width, resized_height)))
vision_model.add(Conv2D(activation="relu", filters=32, kernel_size=(4, 4), name="conv2", padding="same", strides=(2, 2)))
vision_model.add(Flatten())
vision_model.add(Dense(activation="relu", units=256, name="h1"))

# Now let's get a tensor with the output of our vision model:

state_input = Input(shape=(1,agent_history_length,resized_width,resized_height))

encoded_frame_sequence = TimeDistributed(vision_model)(state_input)
encoded_video = LSTM(256)(encoded_frame_sequence)  # the output will be a vector

action_probs = Dense(activation="softmax", units=4, name="p")(encoded_video)
state_value = Dense(activation="linear", units=1, name="v")(encoded_video)

policy_network = Model(inputs=state_input, outputs=action_probs)
value_network = Model(inputs=state_input, outputs=state_value)

p_params = policy_network.trainable_weights
v_params = value_network.trainable_weights

policy_network.summary()
value_network.summary()

p_out = policy_network(state_input)
v_out = value_network(state_input)
EN

回答 1

Stack Overflow用户

发布于 2018-07-08 19:22:35

keras-rl样例库不支持超过2D的输入形状!

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/49570785

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档