I have created a custom log loss in Tensorflow. Though the below code is working but giving strange results like 80.06,75.04, etc
def log_loss_metric(y_true,y_pred):#,num_labels=3): y_true = tf.cast(y_true, 'int64') y_pred = tf.cast(y_pred, 'float64') y_true = tf.one_hot(y_true,depth=3,dtype='float64')# num_classes log_loss = (1/-(len(y_pred))) * (tf.reduce_sum(tf.multiply(y_true , tf.math.log(y_pred)))) #log_loss = tf.cast(log_loss,tf.float32) return log_loss