Files
DRLwithTL-drone/network/loss_functions.py
Anwar, Malik Aqeel d4e1f1136c Initial Commit
2019-10-14 18:15:33 -04:00

16 lines
370 B
Python

# Author: Aqeel Anwar(ICSRL)
# Created: 2/22/2019, 4:57 PM
# Email: aqeel.anwar@gatech.edu
import numpy as np
import tensorflow as tf
def huber_loss(X,Y):
err = X-Y
loss = tf.where(tf.abs(err) < 1.0, 0.5 * tf.square(err), tf.abs(err) - 0.5)
loss = tf.reduce_sum(loss)
return loss
def mse_loss(X,Y):
err=X-Y
return tf.reduce_sum(tf.square(err))