web-traffic-forecasting
web-traffic-forecasting copied to clipboard
sequence smape loss function
zero_loss = 2.0*tf.ones_like(smape) nonzero_loss = smape smape = tf.where(tf.logical_or(tf.equal(y, 0.0), tf.equal(y_hat, 0.0)), zero_loss, nonzero_loss)
There is 'or' condition. What if y !=0.0 and y_hat=0.0. Sequence smape will still give value of zero loss.
It should be 'and' condition.
I think he mean that when y or y_hat equal 0, use the loss(nonzero_loss) is not reasonable,so he give a comparable big loss 1 .