목록
반응형
Artificial Intelligence
반응형
(34)
Lumiere, and s5unnyjjj
Problem #1 : Perceptron model with binary classification (1) 아래 식 처럼, 훈련 값 x1에 대한 label value(y1)은 1이고, 훈련 값 x2에 대한 label value(y2)는 0이다. perceptron model에 적용한다 가정했을 때, 각 훈련 값에 대한 두 예측 label을 구하시오. 풀이를 원하실 경우, 하단의 '더보기' 를 클릭해주시기 바랍니다. 더보기 해당 문제를 풀기 위한 perceptron에 대한 설명과 식은 아래 링크에 업로드되어있으니 본 글에서는 생략하도록 한다. https://s5unnyjjj.tistory.com/39?category=939071 ∴ x1의 예측 값은 -1로 0보다 작으니, 예측 label은 0이다. 그리..
아래 그림과 같이 데이터를 분리할 decision boundary인 hyperplane을 찾아야한다. 여기서 초평명(hyperpalne)은 최대 마진 분류기가 선형 경계로 사용하는 선으로 임의의 공간을 반으로 양분하는 선이다. 2차원 공간에서의 초평면은 1차원 직선이고, 3차원 공간에서의 초평면은 2차원 평면이다. 예를 들면 아래와 같은 빨간색 실선인 hyperplane으로 데이터를 분리할 수 있다. 아니면 아래와 같은 빨간색 점선인 hyperplane으로 데이터를 분리할 수도 있다. 이렇게 구분이 가능한 즉 분리가 가능한 초평면이 두 개 이상인 hyperplane이 존재한다면, 이것을 separating hyperplane이라 부른다. 즉, 아래 그림처럼 분리가 가능한 초평면이 하나가 아닌 여러개인 경..
K-근접이웃 (K-Nearest Neighbors, K-NN) 분류하고자하는 새로운 데이터와 가장 가까운 K개의 학습 데이터를 이용하여 새로운 데이터의 클래스를 분류한다. 가장 가까운 K개의 학습 데이터들이 주로 속한 클래스로 새로운 데이터를 분류한다. 즉, 새로운 데이터를 입력으로 받았을 때, 가장 가까이 있는 것이 무엇이냐를 중심으로 새로운 데이터의 종류를 정해주는 알고리즘이다. 방법은 아래와 같다. 가장 가까운 이웃을 찾기 위해, Euclidean distance를 사용하여 이웃간의 거리를 계산한다. 계산한 이웃간의 거리 중, 거리가 가까운 이웃들 K개 만큼 탐색한다. 다수결의 원리에 근거하여, 신규 테스트 데이터의 class를 예측한다. Euclidean distance를 이용한 거리 계산은 아래..
Problem #7 : Dropout를 적용한 모델의 특정 node output 계산 하단의 표를 이용하여 아래의 그림에 표시된 h2의 output인 o2 값을 계산하시오. 단, 활성화 함수(Activation function)은 ReLU를 사용하며 각 노드의 drop 될 가능성은 0.4이다. 풀이를 원하실 경우, 하단의 '더보기' 를 클릭해주시기 바랍니다. 더보기 아래의 내용은 필자가 직접 작성한 풀이입니다. >> 위 내용은 필자가 직접 작성한 내용입니다. >> 부족한 점이 많을 수 있기에 잘못된 내용이나 궁금한 사항이 있으면 댓글 달아주시기 바랍니다. >> 긴 글 읽어주셔서 감사합니다.
GD(Gradient Descent) 변형 알고리즘 GD(Grdient Descent) SGD(Stochastic Gradient Descent) loss function을 계산할 때, 전체 데이터 대신 일부 조그만한 데이터(mini-batch)의 모음에 대해서만 loss 계산 Momentum NAG Adagrad RMSProp Adagrad 식에서 gradient 제곱값을 더해나가면서 구한 Adam Momentum 방식과 유사하게 지금까지 계산해온 기울기의 지수평균을 저장 RMSProp과 유사하게 기울기의 제곱값의 지수 평균 저장
Problem #6 : Batch normalization를 이용한 특정 node의 output 계산 하단의 표를 이용하여 아래의 그림에 표시된 h1의 output인 o2 값을 계산하시오. 단, 활성화 함수(Activation function)은 ReLU를 사용하며 Batch normalization을 사용한다. 또한 r는 2이며, beta는 -1을 사용한다. 풀이를 원하실 경우, 하단의 '더보기' 를 클릭해주시기 바랍니다. 더보기 아래의 내용은 필자가 직접 작성한 풀이입니다. >> 위 내용은 필자가 공부하여 직접 정리한 내용이며, 위 그림 역시 직접 그린 그림이므로 워터마크 "s5unnyjjj"를 삽입하였음을 알려드립니다. >> 부족한 점이 많을 수 있기에 잘못된 내용이나 궁금한 사항이 있으면 댓글 달..
Problem #5 : GD(Gradient Descent)를 이용한 가중치 업데이트 (3) 하단의 표를 이용하여 아래의 그림에 표시된 w3을 두 번 업데이트 값을 계산하시오. 단, 초기 w1, w2, w3의 값은 1이며, 활성화 함수(Activation function)은 ReLU를 사용한다. 또한 momentum rate와 learning rate는 1이다. Error function은 MSE로 하단에 표시된 식과 같다. 풀이를 원하실 경우, 하단의 '더보기' 를 클릭해주시기 바랍니다. 더보기 아래의 내용은 필자가 직접 작성한 풀이입니다. >> 위 내용은 필자가 공부하여 직접 정리한 내용이며, 위 그림 역시 직접 그린 그림이므로 워터마크 "s5unnyjjj"를 삽입하였음을 알려드립니다. >> 부족한 ..
Problem #4 : GD(Gradient Descent)를 이용한 가중치 업데이트 (2) 하단의 표를 이용하여 아래의 그림에 표시된 w1의 업데이트 값을 계산하시오. 단, 초기 w1, w2, w3의 값은 1이며, 활성화 함수(Activation function)은 ReLU를 사용한다. 또한 learning rate는 1이다. Error function은 MSE로 하단에 표시된 식과 같다. 풀이를 원하실 경우, 하단의 '더보기' 를 클릭해주시기 바랍니다. 더보기 아래의 내용은 필자가 직접 작성한 풀이입니다. >> 위 내용은 필자가 공부하여 직접 정리한 내용이며, 위 그림 역시 직접 그린 그림이므로 워터마크 "s5unnyjjj"를 삽입하였음을 알려드립니다. >> 부족한 점이 많을 수 있기에 잘못된 내용이..