July 2019
Intermediate to advanced
512 pages
19h 39m
English
We know that margin loss is given as follows:

Compute the maximum value in the left and maximum value in the right:
max_left = tf.square(tf.maximum(0.,0.9 - v_length))max_right = tf.square(tf.maximum(0., v_length - 0.1))
Set
to
:
T_k = ylambda_ = 0.5L_k = T_k * max_left + lambda_ * (1 - T_k) * max_right
The total margin loss is computed as follows:
margin_loss = tf.reduce_mean(tf.reduce_sum(L_k, axis=1))
Read now
Unlock full access