<p>There is really no difference between minimizing a cost function and maximizing a value function.  One can be the reciprocal of the other, or the negative of the other, for example.</p>

CC BY-SA 4.0
2019-10-14T06:56:35.773Z
It is worth noting that the function that the OP gives is in fact the negative of the usual multi-class loss function. I would hazard a guess that Andrej used it to make a more direct comparison with RL.
Neil Slater
CC BY-SA 4.0
2019-10-14T04:22:04.797Z
2019-10-14T04:22:04.797Z
S. McGrew
<p>I was watching a video about policy gradients by Andrej Karpathy. At <a href="https://youtu.be/tqrcjHuNdmQ?t=604" rel="nofollow noreferrer">10:00</a>, it shows an equation for supervised learning for image classification.</p>
<p><span class="math-container">$$\max\sum _{i} \log p(y_i \mid x_i)$$</span></p>
<p>I have worked with image classification models before, but I always minimized a cost function (aka loss function). I have also never seen someone maximizing a cost function for image classification in the wild.</p>
<ul>
<li><p>So, what are the advantages of a minimizing loss function over a maximizing loss function in image classification?</p>
</li>
<li><p>Other than RL, which problems do we solve by maximizing a cost function?</p>
</li>
</ul>

<deep-learning><terminology><image-recognition><objective-functions><policy-gradients>
In image classification, why do we usually minimize a cost function rather than maximizing it?
Eka
# In image classification, why do we usually minimize a cost function rather than maximizing it?

(Asked by: username_0 on 2019-10-14)

I was watching a video about policy gradients by Andrej Karpathy. At [10:00](https://youtu.be/tqrcjHuNdmQ?t=604), it shows an equation for supervised learning for image classification.

$$\max\sum \_{i} \log p(y\_i \mid x\_i)$$

I have worked with image classification models before, but I always minimized a cost function (aka loss function). I have also never seen someone maximizing a cost function for image classification in the wild.

* So, what are the advantages of a minimizing loss function over a maximizing loss function in image classification?
* Other than RL, which problems do we solve by maximizing a cost function?

**Tags:** deep-learning, terminology, image-recognition, objective-functions, policy-gradients


---

## 1 answers

### Answer by username_1 on 2019-10-14. Score: 1

There is really no difference between minimizing a cost function and maximizing a value function. One can be the reciprocal of the other, or the negative of the other, for example.

> **Comments:**
> **username_2**: It is worth noting that the function that the OP gives is in fact the negative of the usual multi-class loss function. I would hazard a guess that Andrej used it to make a more direct comparison with RL.  

---

