ML&DL 이야기
-
[ML] Convolution 합성곱의 정의와 FFT 고속푸리에 변환에 관하여ML&DL 이야기/ML 2023. 10. 8. 22:04
아래의 자료들을 모두 참고하여 작성하였다 https://m.blog.naver.com/ycpiglet/222556985523 [신호및시스템] 컨볼루션(Convolution)이란? - 시스템을 몰라도 입력과 임펄스 응답을 통해 출력(결 신호 및 시스템(Signals and Systems)을 수강하면서 배우게 된 컨볼루션(Convolution) 사실 컨볼루션을 ... blog.naver.com 고속 푸리에 변환에 관한 부분은 아래의 영상을 참고하였다. https://www.youtube.com/watch?v=KuXjwB4LzSA&t=1178s Convolution이란 Convolution이란 합성곱이라고도 하다. 이는 선형 시불변(Linear Time-invarient system)시스템 h에 x라는 신호가..
-
[ML] Regression과 Logit(승수)와 Sigmoid함수 그리고 Softmax함수ML&DL 이야기/ML 2023. 10. 2. 18:27
https://kevinitcoding.tistory.com/entry/%EB%94%A5-%EB%9F%AC%EB%8B%9D%EC%9D%84-%EC%9C%84%ED%95%9C-%ED%9A%8C%EA%B7%80-%EB%B6%84%EC%84%9D%EC%9D%98-%EC%9D%B4%ED%95%B4-Logit-Sigmoid-Softmax https://www.youtube.com/watch?v=K7HTd_Zgr3w 딥 러닝을 위한 회귀 분석의 이해: Logit, Sigmoid, Softmax 안녕하세요. 모두의 케빈입니다. 딥 러닝과 심층 신경망을 보다 깊이 알기 위해서는 회귀 분석에 대한 이해가 선행되어야 합니다. 그래서 오늘은 회귀 분석의 정의부터 딥 러닝에 실제로 활용되 kevinitcoding.tistor..
-
[ML] Entropy와 Likelihood관점에서의 Loss functionML&DL 이야기/ML 2023. 10. 2. 10:04
Entropy와 Cross Entropy Entropy 정보의 불확실성의 척도 정보를 표현하는데 있어서 필요한 최소 자원량, 확률이 적은 애를 길게 코딩하고 확률이 큰 아이를 짧게 코딩해라 길이와 확률은 반비례하기에 -log로 표현됨. H(x)는 x에 따른 코드 길이에 대한 확률의 기댓값으로 표현된다. 정보의 최소 자원량이기에 lower bound를 제공하는 식이라 생각하면 된다. 확률이 균등하면 엔트로피는 최대이다(discrete 일때) Cross-entropy 실제 분포인 q 를 모르고, 모델링을 하여 q 분포를 예측하고자 하는 것이다. 예측 모델링을 통해 구한 분포를 p(x) 라고 해보자. 실제 분포인 q를 예측하는 p 분포를 만들었을 때, 이 때 cross-entropy 는 아래와 같이 정의된다...
-
[PyTorchZerotoAll 내용정리] 09: Softmax ClassifierML&DL 이야기/Pytroch 2023. 9. 5. 13:13
06, 07 내용에 이은 Softmax Classifier이다. Logistic Reression은 단일 품목을 labeling하기 위한 방법이었다. 예시를 들면 개인지, 개가 아닌지?를 판단하는 모델을 학습하는 것이었다. 하지만 우리는 때에 따라서 해당 동물의 사진이 개인지, 고양이인지, 토끼인지, 두더쥐인지 다양한 품목, 종류에 대해 판명해야할 때도 많다. 이를 위해 우리는 Soft max 함수가 필요하고, 이러한 문제를 multi-classification problem, 혹은 model이라고 한다. 기존 classification 문제와 달리 그러면 multi-classfication문제이기 때문에 우리가 분류해야하는 n개의 label에 맞게 n차원의 output을 내야할 것이다. 기존의 clas..
-
[PyTorchZerotoAll 내용정리] 08 DataLoader & DatasetML&DL 이야기/Pytroch 2023. 9. 4. 12:23
https://tutorials.pytorch.kr/beginner/basics/data_tutorial.html Dataset과 DataLoader 파이토치(PyTorch) 기본 익히기|| 빠른 시작|| 텐서(Tensor)|| Dataset과 DataLoader|| 변형(Transform)|| 신경망 모델 구성하기|| Autograd|| 최적화(Optimization)|| 모델 저장하고 불러오기 데이터 샘플을 처리하는 코 tutorials.pytorch.kr 이전 영상의 코드에서는 위와 같은 방식으로 data를 불러왔다. 보면 데이터를 pandas를 이용해 읽고, 이후 각 data를 numpy로 변환하였는데 해당 방식보다 효율적인 방식이 파이토치에는 존재한다. Dataset과 DataLoader이다. ..
-
[PyTorchZerotoAll 내용정리] 07 Wide(다변량) & Deep(gradient vanishing problem)ML&DL 이야기/Pytroch 2023. 8. 30. 12:55
Wide 이전 시간(06) logistic regression을 이용해 PHD 합격 여부를 예측하는 모델을 만들었었다. 그러나 실제로 합격, 불합격이라는 결과를 만들기 위해서는 GPA 뿐만 아니라 더 많은 요소들이 고려될 것이다(다변량) 이런 다양한 input을 받아서 output으로 표현하기 위해서는 행렬의 곱셈 연산이 필요하다 즉, 위와 같이 각 input의 data를 column형태로 쌓아 행렬로 만들고, 해당하는 데이터의 수만큼 가중치를 추가하면 된다. 이것이 Wide&Deep에서 Wide이다. 코드로는 아래와 같이 표현 가능할 것이다(n은 input data의 종류의 수) import torch linear = torch.nn.Linear(n,1) y = linear(x_data) Deep De..
-
[PyTorchZerotoAll 내용정리] 06 Logistic(sigmoid) Regression = Linear classificationML&DL 이야기/Pytroch 2023. 8. 27. 13:49
Linear regression의 경우 우리의 예측 값은 실수형태로 떨어졌다. 즉, 연속된 값을 가정하였다. 이번에는 Binary prediction이 필요한 경우, 즉, 카테고리 분류나 O,X 분류가 필요한 경우를 가정해보자. 실생활에서 이와 같은 경우는 위와 같이, 기나 아니냐 라는 케이스가 대다수이다. Classfication = Logistic Regression 0,1로 결과값을 제약하려면 어떤 함수가 필요할까?? 우리는 Sigmoid함수를 이용할 수 있다. 이런 함수를 activation 함수라고도 하는데, 시그모이드 함수는 그 함수의 특성상 0을 기준으로 값이 급격하게 1로 가까워지거나 0으로 가까워지는 특성이 있다. 즉, 과 1 사이의 실수 결과가 나온다면 특정한 임계치를 정하고 그 이상이..
-
[ML] Optimizer란 무엇인가ML&DL 이야기/ML 2023. 8. 24. 23:40
https://tutorials.pytorch.kr/beginner/basics/optimization_tutorial.html 앞선 글에서 처럼 각 반복 단계에서 모델은 출력을 추측하고, 추측과 정답 사이의 오류(손실(loss))를 계산하고, 매개변수에 대한 오류의 도함수(derivative)를 수집한 뒤, 경사하강법을 사용하여 이 파라미터들을 최적화(optimize)합니다(https://www.youtube.com/watch?v=tIeHLnjs5U8) 24.1.23 LG Aimers 이화여자대학교 강제원 교수님의 강의 내용 추가 하이퍼파라미터(Hyperparameter) 하이퍼파라미터는 모델의 최적화 과정에서 우리가 직접 제어할 수 있는, 조절 가능한 매개변수이다. 이를 조절하는 것을 하이퍼파라미터 ..