StevenLiuWen / ano_pred_cvpr2018

Official implementation of Paper Future Frame Prediction for Anomaly Detection -- A New Baseline, CVPR 2018
435 stars 126 forks source link

In gradient_loss, how do convert 4-D filters to 2-D matrix #13

Closed RoronoaZoro1665 closed 4 years ago

RoronoaZoro1665 commented 5 years ago

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]] filter_x like follow [[[[-1. -0. -0.] [-0. -1. -0.] [-0. -0. -1.]] [[ 1. 0. 0.] [ 0. 1. 0.] [ 0. 0. 1.]]]]

and how to get Operator [-1, 1] from 4-D filter_x ?