title: How to write a custom loss function in Tensorflow?
body: <p>I am new to <code>tensorflow</code>. I want to write my own custom loss function. Is there any tutorial about this? For example, the hinge loss or a sum_of_square_loss(though this is already in tf)?
  Can I do it directly in python or I have to write the cpp code?</p>