diff --git a/paddleslim/common/RL_controller/LSTM/LSTM_Controller.py b/paddleslim/common/RL_controller/LSTM/LSTM_Controller.py index 30dd2907e23b81ce4eebdd5721113a1e2e4531f5..521c6f4b7e5002de1982fa3561b3fdf1c8cf49c0 100644 --- a/paddleslim/common/RL_controller/LSTM/LSTM_Controller.py +++ b/paddleslim/common/RL_controller/LSTM/LSTM_Controller.py @@ -193,8 +193,7 @@ class LSTM(RLBaseController): fluid.layers.assign(self.baseline - (1.0 - self.decay) * (self.baseline - self.rewards), self.baseline) - self.loss = -1.0 * self.sample_log_probs * ( - self.rewards - self.baseline) + self.loss = self.sample_log_probs * (self.rewards - self.baseline) fluid.clip.set_gradient_clip( clip=fluid.clip.GradientClipByGlobalNorm(clip_norm=5.0)) optimizer = fluid.optimizer.Adam(learning_rate=1e-3)