chenyilun95/tf-cpn

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

Opened this issue · 0 comments

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 ?