Skip to content

Commit

Permalink
Sparse penalty fixed for Sigmoids
Browse files Browse the repository at this point in the history
  • Loading branch information
Jan Melchior authored and Jan Melchior committed Feb 12, 2018
1 parent 5e2e0f6 commit b4dd6e8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pydeep/ae/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -491,7 +491,7 @@ def __get_sparse_penalty_gradient_part(self, h, desired_sparseness):
-type: numpy array [1, hidden dim]
'''
mean_h = numx.atleast_2d(numx.mean(h, axis=0))
if self.hidden_activation_function == Sigmoid or isinstance(self.hidden_activation_function, list):
if self.hidden_activation_function == Sigmoid or isinstance(self.hidden_activation_function, Sigmoid):
min_value = 1e-10
max_value = 1.0 - min_value
mean_h = numx.clip(mean_h, min_value, max_value)
Expand Down

0 comments on commit b4dd6e8

Please sign in to comment.