Its a confusing question? how to use is just using the name of the loss function in the command, I think what you want to know is when to use a specific loss functions. I will just give you a hint on the abstract level. Loss is dependent on the task at hand, for instance, cross-entropy is vastly used for image recognition problem and has been successful but when you deal with constrained environment or you define your own function with respect to the bounded constraints hinge loss performs better, but ofcourse you have to check it empirically. The mean square loss is mostly used for regression and image denoising networks but sometimes it is also used for detection when you need to compute the overlap. KL divergence is better when you want to reduce the similarity of the data distributions and it is mostly used with transfer learning approaches to make the data distribution of source and target domain closer to each other. The others such as consineh or cosine_proximity are also used for same purposes as of KL divergence. Ofcourse you can use them with problems other than the aforementioned ones but the ones which are mentioned are mainly the first choice for specific tasks.