loss function에 대하여

1. loss function은 도대체 무엇인가?

 

누군가가 loss function이 뭐냐고 물어보면 뭐라 대답해야할지 모르겠다.

 

나라면 당장 데이터의 실제 정답(ground truth)과 모델이 예측한 대답의 차이로 정의되는 함수라고 답할 것 같다

 

찾아보니까 대부분 이 말에 비슷한 것 같다

 

위키피디아의 첫줄 정의를 가지고 와봤다.

 

'In mathematical optimization and decision theory, a loss function or cost function is a function that maps an event or values of one or more variables onto a real number intuitively representing some "cost" associated with the event.'

 

어떤 변수를 어떤 사건과 연관된 비용을 표현하는 실수에 mapping시키는 하나의 함수이다.

 

대단히 애매한 표현이라 다른 방식으로도 생각해보면

 

Machines learn by means of a loss function. It’s a method of evaluating how well specific algorithm models the given data.

 

machineloss function으로 학습을 한다. 주어진 데이터에 특정한 알고리즘 모델이 얼마나 잘 맞는지를 측정하는 하나의 수단이다.

 

다음은 위와 비슷한 말이다.

 

A loss function is a measure of how good a prediction model does in terms of being able to predict the expected outcome.

 

어떤 사람은 이런 말로도 표현했다

 

The loss function is how you're penalizing your output.

 

loss function은 너의 output을 어떻게 벌점화 시킬 것인지 알려준다.

 

 

2. unsupervised learning에서 loss function이란?

 

그러면 비지도학습에서 loss function이 있냐고 물어보면 뭐라고 대답해야하지?

 

먼저 비지도학습이 뭘까? 주어진 input X에 대해 대응하는 output value는 특별히 없는 경우.

 

비지도학습은 무엇을 하나?

 

주어진 X로부터 가장 연관되었다고 생각하는 feature y를 추측하는 문제

 

X들로부터 적절한 community를 찾아 clustering하는 문제

 

수학적으로 주어진 X로부터 하나의 y를 뽑을 확률을 가장 높이는, X가 주어질 때 y의 조건부확률인 $P(y|X)$를 가장 높이는 문제가 아닐까?

 

앞에서 loss function주어진 데이터에 특정한 알고리즘 모델이 얼마나 잘 맞는지를 측정하는 하나의 수단이라고 말했는데 이럴 때는 $P(y|X)$가 하나의 loss function이 아닐까?

 

 

3. 참고

 

machine learning - What is a loss function in simple words? - Stack Overflow

 

What is a loss function in simple words?

Can anyone please explain in simple words and possibly with some examples what is a loss function in the field of machine learning/neural networks? This came out while I was following a Tensorflow

stackoverflow.com

 

Common Loss functions in machine learning | by Ravindra Parmar | Towards Data Science

 

Common Loss functions in machine learning

Machines learn by means of a loss function. It’s a method of evaluating how well specific algorithm models the given data. If predictions…

towardsdatascience.com

 

TAGS.

Comments