title: how to implement hamming loss as a custom metric in keras model
body: <p>how to implement hamming loss as a custom metric in keras model<br />
  I have a multilabel classification with 6 classes</p>
  <pre><code>model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy',hamming_loss])
  </code></pre>
  <p>I tried using</p>
  <pre><code>from sklearn.metrics import hamming_loss
  def custom_hl(y_true, y_pred):    
    return hamming_loss(y_true, y_pred)
  </code></pre>
  <p>which doesn't work because i have the y_true , y_pred as follow</p>
  <pre><code>YTRUE
  Tensor(&quot;Cast_10:0&quot;, shape=(None, 6), dtype=float32)
  YPRED
  Tensor(&quot;model_1/dense_1/Sigmoid:0&quot;, shape=(None, 6), dtype=float32)
  </code></pre>
  <p>also  tried the function in this question and it doesn't work
  <a href="https://stackoverflow.com/questions/32239577/getting-the-accuracy-for-multi-label-prediction-in-scikit-learn">Getting the accuracy for multi-label prediction in scikit-learn</a>
  is there any way I can get the hamming loss as metric in keras
  thanks for any help</p>