title: Angular distance in Keras as metric
body: <p>I am using Keras to train my model and want to use angular distance between my predictions and hypothesis as my metric. The closest metric I have found so far is cosine proximity, not angular distance though. </p>
  
  <p>The problem I have with cosine proximity (or cosine distance) is that the cosine for small numbers are very similar. </p>
  
  <p>Looking at <a href="https://en.wikipedia.org/wiki/Cosine_similarity" rel="nofollow noreferrer">Wikipedia</a>, it is possible to calculate the angular distance using cosine proximity:</p>
  
  <p><img src="https://wikimedia.org/api/rest_v1/media/math/render/svg/c6f6fb303bca4199d8ee2e1be4acc64ce8615847" alt="formula"></p>
  
  <p>So I am wondering if using a custom metric based on cosine proximity is a good idea and if so how is that implemented.</p>