procoder35
procoder35

Reputation: 150

keras-rl model with multiple outputs

I want to build a reinforcement learning model with keras which needs to have two outputs. can it be done the same way that the Keras library does or is it even doable?

this is what I want to do

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)

Upvotes: 1

Views: 186

Answers (1)

Guinther Kovalski
Guinther Kovalski

Reputation: 1909

yes, it is possible, just use:

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

and pay attention to the order of your outputs to don't mistaken them.

Upvotes: 1

Related Questions