title: What function defines accuracy in Keras when the loss is mean squared error (MSE)?
body: <p>How is Accuracy defined when the loss function is mean square error? Is it <a href="https://en.wikipedia.org/wiki/Mean_absolute_percentage_error" rel="noreferrer">mean absolute percentage error</a>?</p>
  
  
  
  <p>The model I use has output activation linear and is compiled with <code>loss= mean_squared_error</code></p>
  
  <pre class="lang-python prettyprint-override"><code>model.add(Dense(1))
  model.add(Activation('linear'))  # number
  
  model.compile(loss='mean_squared_error', optimizer='adam', metrics=['accuracy'])
  </code></pre>
  
  <p>and the output looks like this:</p>
  
  <pre class="lang-python prettyprint-override"><code>Epoch 99/100
  1000/1000 [==============================] - 687s 687ms/step - loss: 0.0463 - acc: 0.9689 - val_loss: 3.7303 - val_acc: 0.3250
  Epoch 100/100
  1000/1000 [==============================] - 688s 688ms/step - loss: 0.0424 - acc: 0.9740 - val_loss: 3.4221 - val_acc: 0.3701
  </code></pre>
  
  <p>So what does e.g. val_acc: 0.3250 mean? Mean_squared_error should be a scalar not a percentage - shouldnt it? So is val_acc - mean squared error, or mean percentage error or another function?</p>
  
  <p>From definition of MSE on wikipedia:<a href="https://en.wikipedia.org/wiki/Mean_squared_error" rel="noreferrer">https://en.wikipedia.org/wiki/Mean_squared_error</a></p>
  
  <blockquote>
    <p>The MSE is a measure of the quality of an estimator—it is always
    non-negative, and values closer to zero are better.</p>
  </blockquote>
  
  <p>Does that mean a value of <code>val_acc: 0.0</code> is better than <code>val_acc: 0.325</code>?</p>
  
  <p>edit: more examples of the output of accuracy metric when I train - where the accuracy is increase as I train more. While the loss function - mse should decrease. Is Accuracy well defined for mse - and how is it defined in Keras?</p>
  
  <pre class="lang-python prettyprint-override"><code>lAllocator: After 14014 get requests, put_count=14032 evicted_count=1000 eviction_rate=0.0712657 and unsatisfied allocation rate=0.071714
  1000/1000 [==============================] - 453s 453ms/step - loss: 17.4875 - acc: 0.1443 - val_loss: 98.0973 - val_acc: 0.0333
  Epoch 2/100
  1000/1000 [==============================] - 443s 443ms/step - loss: 6.6793 - acc: 0.1973 - val_loss: 11.9101 - val_acc: 0.1500
  Epoch 3/100
  1000/1000 [==============================] - 444s 444ms/step - loss: 6.3867 - acc: 0.1980 - val_loss: 6.8647 - val_acc: 0.1667
  Epoch 4/100
  1000/1000 [==============================] - 445s 445ms/step - loss: 5.4062 - acc: 0.2255 - val_loss: 5.6029 - val_acc: 0.1600
  Epoch 5/100
  783/1000 [======================&gt;.......] - ETA: 1:36 - loss: 5.0148 - acc: 0.2306
  </code></pre>