Skip to content

Commit

Permalink
fix dynamic model cannot track PRelu weights gradients problem (#982)
Browse files Browse the repository at this point in the history
  • Loading branch information
1FengL authored and zsdonghao committed May 26, 2019
1 parent 3106a71 commit 6b7f1f8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tensorlayer/layers/activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ def build(self, inputs_shape):
def forward(self, inputs):

pos = tf.nn.relu(inputs)
self.alpha_var_constrained = tf.nn.sigmoid(self.alpha_var, name="constraining_alpha_var_in_0_1")
neg = -self.alpha_var_constrained * tf.nn.relu(-inputs)

return pos + neg
Expand Down

0 comments on commit 6b7f1f8

Please sign in to comment.