Created
April 5, 2020 12:53
-
-
Save emrectn/ec03e058a3db08cd4bd0465fc1a7b197 to your computer and use it in GitHub Desktop.
Revisions
-
emrectn created this gist
Apr 5, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,6 @@ def compute_grads(cfg): with tf.GradientTape() as tape: all_loss = compute_loss(**cfg) # Compute gradients wrt input image total_loss = all_loss[0] return tape.gradient(total_loss, cfg['init_image']), all_loss