정리 6

활성화 함수와 손실 함수

- 이진 분류를 처리할 때 (Binary classification), - Sigmoid Function ((-INF, INF) → (0, 1)) - Binary Cross-Entropy Loss (Log Loss) ((0, 1) → [0, INF)) - 다중 분류를 처리할 때 (Multi-class classification), - Softmax Function ((-INF, INF) → (0, 1)) - Negative Log-Likelihood ((0, 1) → (INF, 0]) - 따라서, 몇 개의 요소로 분류를 하는 지에 따라, 사용하는 함수가 다름을 이해하자. - Sigmoid는 Softmax의 특수 케이스로 클래스 갯수만 2개일 뿐 완전히 같은 연산을 수행한다. - 활성화 함수 이후에 손실 ..

정리/Data&AI 2022.10.20

손실 함수, 경사 하강법, 역전파

Loss function(손실 함수) - Loss function is a metric that shows how bad is the model prediction. - [0, INF] - Binary Cross-Entropy Loss(Log Loss), 2개의 카테고리로 구분 시 이용 - Negative log likelihood(NLL), 2개 이상의 카테고리로 구분 시 이용 Gradient Descent(경사 하강법) - Gradient: Slope of a function for a given point - Descent: Going down - 손실 함수의 최솟값을 찾기 위해 경사 하강법을 이용한다. x좌표의 차이가 매우 작은 두 점의 좌표를 이용해, 현재의 기울기를 구한다. - Amount o..

정리/Data&AI 2022.09.22

Python에서 OOP하기

python class - OOP - The result of the class implementation is called an instance 파이썬의 OOP 기본 개념 class Hello: # class 생성 def greeting(self): # method 생성 print('Hello, World!') a = Hello() # instance 생성 a.greeting() # method 호출 class에는 크게 attribute과 method 두 가지가 있다. attribute는 매개변수를 받고 사용하기 위한 값, method는 만들어진 attribute를 이용해 어떤 행위를 하는 함수라고 생각해도 된다. class Member: value = [] # class attribute def in..

정리/Data&AI 2022.09.14

Jupyter Notebook관련 이것 저것

Jupyter Notebook Magic Command Ipython(Jupyter Notebook)에는 Magic Command가 내장되어 있다. Cell에 %Ismagic이라고 입력하면, 다양한 Magic Command 목록을 볼 수 있다. 자주 사용하는 매직 커멘드 몇 개를 살펴보자. %의 적용 범위는 라인, %%의 적용 범위는 셀이다. 1. %matplotlib inline, %matplotlib notebook %matplotlib inline: show 명령 없이도 바로 그래프 표현(정적) %matplotlib notebook: show 명령 없이도 바로 그래프 표현(동적) import matplotlib.pyplot as plt %matplotlib inline plt.plot([2, 4, ..

정리/Data&AI 2022.09.14