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')
## Original Version
w1 = Dense(HIDDEN1_UNITS)(S)
w1 = LeakyReLU()(w1)
h1 = Dense(HIDDEN2_UNITS)(w1)
h1 = LeakyReLU()(h1)
a1 = Dense(HIDDEN2_UNITS)(A)
a1 = LeakyReLU()(a1)
h2 = layers.add([h1, a1])
h3 = Dense(HIDDEN2_UNITS)(h2)
h3 = LeakyReLU()(h3)
h3 = Dense(HIDDEN2_UNITS)(h3)
h3 = LeakyReLU()(h3)
h3 = Dense(HIDDEN1_UNITS)(h3)
h3 = LeakyReLU()(h3)
V = Dense(action_dim,activation='linear')(h3)
model = Model(inputs=[S,A],outputs=V)
adam = Adam(lr=self.LEARNING_RATE)
model.compile(loss='mse', optimizer=adam)
return model, A, S
CriticNetwork.py 文件源码
python
阅读 22
收藏 0
点赞 0
评论 0
评论列表
文章目录