Skip to content

Commit

Permalink
Merge branch 'master' into english
Browse files Browse the repository at this point in the history
Update from master.
  • Loading branch information
nbwuzhe committed Apr 19, 2020
2 parents ea3e238 + e6d6a27 commit 7e560ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
.DS_store
.ipynb_checkpoints
.ipynb_checkpoints/*
data/keras_model/
data/demomodule/
data/autograph/
2 changes: 1 addition & 1 deletion 3-1,低阶API示范.md
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ class DNNModel(tf.Module):
@tf.function(input_signature=[tf.TensorSpec(shape = [None,1], dtype = tf.float32),
tf.TensorSpec(shape = [None,1], dtype = tf.float32)])
def loss_func(self,y_true,y_pred):
#将预测值限制在1e-7以上, 1-e-7以下,避免log(0)错误
#将预测值限制在 1e-7 以上, 1 - 1e-7 以下,避免log(0)错误
eps = 1e-7
y_pred = tf.clip_by_value(y_pred,eps,1.0-eps)
bce = - y_true*tf.math.log(y_pred) - (1-y_true)*tf.math.log(1-y_pred)
Expand Down

0 comments on commit 7e560ab

Please sign in to comment.