# Loss function or Cost function?

**URL:** <https://dlai.staged-by-discourse.com/t/loss-function-or-cost-function/129641>\
**Category:** Convolutional Neural Networks\
**Tags:** coursera-platform\
**Created:** [May 19, 2022, 10:47pm UTC](https://dlai.staged-by-discourse.com/t/loss-function-or-cost-function/129641 "2022-05-19T22:47:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jesus\_Ricardo\_Licona](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@Jesus\_Ricardo\_Licona](https://dlai.staged-by-discourse.com/u/Jesus_Ricardo_Licona)\
**Post date:** [May 19, 2022, 10:47pm UTC](https://dlai.staged-by-discourse.com/t/loss-function-or-cost-function/129641/1 "2022-05-19T22:47:38Z")

</div>

Hi,

My question 7 indicates the following:

“Neural style transfer uses images Content C, Style S. The loss function used to generate image G is composed of which of the following: (Choose all that apply.)”

However, the slides related to Neural style transfer mention only the cost function.

 ![Captura de Pantalla 2022-05-20 a la(s) 0.46.06](https://global.discourse-cdn.com/dlaistaging/uploads/default/original/3X/2/3/237761b2e9f030e083debf4d8cbf136965874c2b.jpeg)

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlaistaging/user_avatar/dlai.staged-by-discourse.com/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://dlai.staged-by-discourse.com/u/paulinpaloalto)\
**Post date:** [May 20, 2022, 12:13am UTC](https://dlai.staged-by-discourse.com/t/loss-function-or-cost-function/129641/2 "2022-05-20T00:13:43Z")

</div>

When used in this generic way, “loss” and “cost” are equivalent terms.

If you want to be fully precise, usually Prof Ng will reserve the term “loss function” for a vector valued function with one output per sample or in some more detailed cases like image segmentation perhaps one value per pixel per sample. Whereas “cost function” usually refers to a scalar valued function which is the average of the “loss” values.

---

<div class="post-metadata">

**Author:** ![Jesus\_Ricardo\_Licona](https://avatars.discourse-cdn.com/v4/letter/j/e36b37/32.png) [@Jesus\_Ricardo\_Licona](https://dlai.staged-by-discourse.com/u/Jesus_Ricardo_Licona)\
**Post date:** [May 20, 2022, 12:30am UTC](https://dlai.staged-by-discourse.com/t/loss-function-or-cost-function/129641/3 "2022-05-20T00:30:44Z")

</div>

Thanks for answering; it was helpful!
