Skip to content

Commit

Permalink
simplify eq
Browse files Browse the repository at this point in the history
rasbt committed Dec 4, 2019
1 parent a5ac3a8 commit eeb9a0c
Showing 2 changed files with 183 additions and 80 deletions.
257 changes: 179 additions & 78 deletions ch14/ch14_part1.ipynb

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions ch14/ch14_part1.py
Original file line number Diff line number Diff line change
@@ -278,7 +278,9 @@ def compute_z(x):


# verifying the computed gradient
tf.print((-2)*x*( y-(w*x+b) ))
#tf.print(-2*x * (-b - w*x + y))

tf.print(2*x * ((w*x + b) - y))


# ### Computing gradients with respect to non-trainable tensors
@@ -300,7 +302,7 @@ def compute_z(x):


# verifying the computed gradient
tf.print((-2)*w*( y-(w*x+b) ))
tf.print(2*w * ((w*x + b) - y))


# ### Keeping resources for multiple gradient computations

0 comments on commit eeb9a0c

Please sign in to comment.