chenyilun95 / tf-cpn

Cascaded Pyramid Network for Multi-Person Pose Estimation (CVPR 2018)
MIT License
792 stars 197 forks source link

global_loss += tf.reduce_mean(tf.square(global_out - global_label)) / len(labels); global_loss /= 2;.so damn hard to understand #81

Open gcl1991 opened 5 years ago

gcl1991 commented 5 years ago
global_loss = 0.
for i, (global_out, label) in enumerate(zip(global_outs, labels)):
    global_label = label * tf.to_float(tf.greater(tf.reshape(valids, (-1, 1, 1, cfg.nr_skeleton)), 1.1))
    global_loss += tf.reduce_mean(tf.square(global_out - global_label)) / len(labels)
global_loss /= 2.

QAQ can somebody help me why / len(labels) and global_loss /= 2 ?