def create_critic_network(self, state_size,action_dim):
print("Now we build the model")
S = Input(shape=[state_size])
A = Input(shape=[action_dim],name='action2')
w = Dense(HIDDEN1_UNITS, init='he_uniform',activation='relu')(S)
h = merge([w,A],mode='concat')
h3 = Dense(HIDDEN2_UNITS, init='he_uniform',activation='relu')(h)
V = Dense(action_dim,init=lambda shape, name: uniform(shape, scale=3e-3, name=name),activation='linear')(h3)
model = Model(input=[S,A],output=V)
adam = Adam(lr=self.LEARNING_RATE)
model.compile(loss='mse', optimizer=adam)
return model, A, S
评论列表
文章目录