(a, b, precision, batch_size)
return uPu/scale_factor
Math:  out = (action - mlp_out)'*precision*(action-mlp_out)
                    = (u-uhat)'*A*(u-uhat)
Math:  out = (action - mlp_out)'*precision*(action-mlp_out)
                    = (u-uhat)'*A*(u-uhat)
Math : out = ( action - mlp_out ) * precision * ( action - mlp_out ) = ( u - uhat ) * A * ( u - uhat )
def euclidean_loss_layer(a, b, precision, batch_size):
    """ Math:  out = (action - mlp_out)'*precision*(action-mlp_out)
                    = (u-uhat)'*A*(u-uhat)"""
    scale_factor = tf.constant(2*batch_size, dtype='float')
    uP = batched_matrix_vector_multiply(a-b, precision)
    uPu = tf.reduce_sum(uP*(a-b))  # this last dot product is then summed, so we just the sum all at once.
    return uPu/scale_factor
def euclidean_loss_layer ( a , b , precision , batch_size ) : scale_factor = tf . constant ( 2 * batch_size , dtype = 'float' ) uP = batched_matrix_vector_multiply ( a - b , precision ) uPu = tf . reduce_sum ( uP * ( a - b ) ) # this last dot product is then summed, so we just the sum all at once. return uPu / scale_factor