diff options
| author | jules@lens <julescarbon@gmail.com> | 2018-04-24 20:19:24 +0200 |
|---|---|---|
| committer | jules@lens <julescarbon@gmail.com> | 2018-04-24 20:19:24 +0200 |
| commit | 83e91e0a8effcd20466e56b6ecc3e349bbfa5e0e (patch) | |
| tree | 377977c1068fa2411ac6b0e7c6da4aa97873ae8b /Code/loss_functions.py | |
| parent | 9b0d10f357871231bbec06c610363588812216e1 (diff) | |
Diffstat (limited to 'Code/loss_functions.py')
| -rw-r--r-- | Code/loss_functions.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Code/loss_functions.py b/Code/loss_functions.py index 994d226..0d33b49 100644 --- a/Code/loss_functions.py +++ b/Code/loss_functions.py @@ -61,7 +61,7 @@ def lp_loss(gen_frames, gt_frames, l_num): scale_losses.append(tf.reduce_sum(tf.abs(gen_frames[i] - gt_frames[i])**l_num)) # condense into one tensor and avg - return tf.reduce_mean(tf.pack(scale_losses)) + return tf.reduce_mean(tf.stack(scale_losses)) def gdl_loss(gen_frames, gt_frames, alpha): @@ -80,8 +80,8 @@ def gdl_loss(gen_frames, gt_frames, alpha): # create filters [-1, 1] and [[1],[-1]] for diffing to the left and down respectively. pos = tf.constant(np.identity(3), dtype=tf.float32) neg = -1 * pos - filter_x = tf.expand_dims(tf.pack([neg, pos]), 0) # [-1, 1] - filter_y = tf.pack([tf.expand_dims(pos, 0), tf.expand_dims(neg, 0)]) # [[1],[-1]] + filter_x = tf.expand_dims(tf.stack([neg, pos]), 0) # [-1, 1] + filter_y = tf.stack([tf.expand_dims(pos, 0), tf.expand_dims(neg, 0)]) # [[1],[-1]] strides = [1, 1, 1, 1] # stride of (1, 1) padding = 'SAME' @@ -96,7 +96,7 @@ def gdl_loss(gen_frames, gt_frames, alpha): scale_losses.append(tf.reduce_sum((grad_diff_x ** alpha + grad_diff_y ** alpha))) # condense into one tensor and avg - return tf.reduce_mean(tf.pack(scale_losses)) + return tf.reduce_mean(tf.stack(scale_losses)) def adv_loss(preds, labels): @@ -115,4 +115,4 @@ def adv_loss(preds, labels): scale_losses.append(loss) # condense into one tensor and avg - return tf.reduce_mean(tf.pack(scale_losses)) + return tf.reduce_mean(tf.stack(scale_losses)) |
