【问题标题】:keras-rl model with multiple outputs具有多个输出的 keras-rl 模型
【发布时间】:2022-01-08 22:29:20
【问题描述】:

我想用需要有两个输出的 keras 构建强化学习模型。可以像 Keras 库那样做吗?甚至可行吗?

这就是我想做的事

inp = Input(shape=(input_layer_size, ))
x = Dense(hidden_layer_size, activation="relu")(inp)
for i in range(nb_hidden_layer):
    x = Dense(hidden_layer_size, activation="relu")(x)
a1 = Dense(1, activation='sigmoid')(x)
a2 = Dense(1, activation='sigmoid')(x)

【问题讨论】:

标签: python tensorflow keras reinforcement-learning


【解决方案1】:

是的,有可能,只需使用:

model = Model(inp, [a1,a2])

并注意输出的顺序,以免弄错。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-06-27
    • 2019-08-09
    • 2023-02-09
    • 2021-03-24
    • 2020-02-29
    • 2021-08-13
    • 1970-01-01
    • 2021-04-06
    相关资源
    最近更新 更多