title: Why the accuracy and binary_accuracy in keras have same result?
body: <p>I created a simple model for binary classification with Keras. The code is:</p>
  <pre class="lang-py prettyprint-override"><code>    # create model
      model = Sequential()
      model.add(Dense(250, input_dim=1, activation='relu'))
      model.add(Dense(1, activation='sigmoid'))
      # Compile model
      model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy', 'binary_accuracy'])
  </code></pre>
  <p>My purpose was check the result of <code>accuracy</code> and <code>binary_accuracy</code> is understand difference between them.</p>
  <p>As Keras says <code>binary_accuracy</code> accuracy have threshold that default is <code>.5</code>, that `accuracy' haven't. When I test them with sample data the result is difference but in the train of model thy have same results in each epoch.</p>
  <p>for this true and predicted sample I tested <code>accuracy</code> and <code>binary_accuracy</code>:</p>
  <pre class="lang-py prettyprint-override"><code>   y_true = [[1], [1], [0], [0]]
     y_pred = [[0.51], [1], [0], [0.4]]
  </code></pre>
  <p>For  <code>binary_accuracy</code> is:</p>
  <pre class="lang-py prettyprint-override"><code>m = tf.keras.metrics.BinaryAccuracy()
  m.update_state(y_true, y_pred)
  m.result().numpy()
  </code></pre>
  <p>that result is:
  <code>1</code></p>
  <p>For  <code>accuracy</code> is:</p>
  <pre class="lang-py prettyprint-override"><code>m = tf.keras.metrics.Accuracy()
  m.update_state(y_true, y_pred)
  m.result().numpy()
  </code></pre>
  <p>and the result is:
  '.5'</p>
  <p>But in the above model it is same for each of them in each epoch.</p>
  <p><strong>Edit</strong></p>
  <p>By changing the compile to this the result changed:</p>
  <pre class="lang-py prettyprint-override"><code>model.compile(loss='binary_crossentropy', optimizer='adam', metrics=['accuracy', tf.keras.metrics.BinaryAccuracy(threshold=.7)])
  </code></pre>
  <p>Why <code>accuracy</code> work like <code>binary_accuracy</code> with <code>threshold=0.5</code> in model but not in out of model?</p>