분류 전체보기
-
Matrix Multiplication Code | Advanced Learning AlgorithmMachine Learning/Stanford ML Specialization 2024. 2. 10. 20:59
Coursera Machine Learning Specialization > Supervised Machine Learning: Advanced Learning Algorithms > Neural Network Intuition 이제 전에 직접 계산했던것을 NumPy를 이용해서 계산해보자. 먼저 A matrix를 아래와 같이 생성할 수 있다. A = np.array([1, -1, 0.1], [2, -2, 0.2]]) 이제 이 matrix를 transpose 한 matrix를 생성해보자. AT = np.array([[1, 2], [-1, -2], [0.1, 0.2]]) 매번 이렇게 직접 쓰지 않아도, 원래의 matrix가 있다면, transpose를 이렇게 할 수 있다. AT = A.T 그리고 W matr..
-
Matrix Multiplication Rules | Advanced Learning AlgorithmMachine Learning/Stanford ML Specialization 2024. 2. 10. 18:40
Coursera Machine Learning Specialization > Supervised Machine Learning: Advanced Learning Algorithms > Neural Network Intuition 이번에는 Matrix를 곱할때 규칙들을 살펴보자. 아래와 같은 Matrix를 살펴보자. A를 Transpose 하게 되면 3x2 matrix가 된다. 이것을 2 x 4 matrix인 W와 곱하게 되면? A의 각 row들을 w을 컬럼들과 한번씩 곱하야하기 때문에 3 by 4 matrix가 생성된다. 그렇다면 계산은 어떻게 될까? 해당 column과 row를 sum product해서 돌바른 자리에 넣어주면 된다. 위의 계산 예시를 참고. 여기서, Multiplication을 하기위한..
-
Matrix Multiplication | Advanced Learning AlgorithmMachine Learning/Stanford ML Specialization 2024. 2. 10. 06:05
Coursera Machine Learning Specialization > Supervised Machine Learning: Advanced Learning Algorithms > Neural Network Intuition 지난시간, for loop을 이용하는것보다 vectorization을 통해서 2D Array, 즉 Matrix를 이용하면 훨씬 코드를 간단하게 만들 수 있었다. 그렇다면 이 Matrix를 곱한다는것은 어떤 의미일까? Linear Algibra 수업으로 되돌아가보자. 간단한 예시이다. 2개의 Vector를 dot product하게 되면, 간단하게 같은 층에 있는 값들끼리 곱해서 더하게 된다. 이런식의 행렬같은 경우, 같은 위치에 있는 값들을 모두 곱해서 더하는 방식인데, 이런것을 ..
-
How Neural Networks are Implemented Efficiently(Feat. mutmul) | Advanced Learning AlgorithmMachine Learning/Stanford ML Specialization 2024. 2. 10. 05:14
지난 10년동안 Neural Network 분야가 급속도로 성장할 수 있었던 이유중 하나는, 이 신경망을 Vector화 할 수 있었기 때문이다. Matrix(행렬) 곱셈을 사용하면 이 모델을 아주 효율적으로 구현할 수 있다. GPU를 포함한 병렬 컴퓨팅 하드웨어뿐만 아니라, 일부 CPU도 아주 큰 Matrix 곱셈을 수행할 때 아주 능숙하다는 것이 밝혀졌다. 이런 벡터화된 신경망 구현이 어떻게 작동하는지 알아보자. 먼저, loop들과 vectorization을 비교해보자. 먼저, 단일 레이어에서 Forward Propagation을 구현하는 방법을 살펴보자. x = np.array([200, 17]) W = np.array([[1, -3, 5], [-2, 4, -6]]) b = np.array([-1, ..
-
Neural Network with NumPy | Advanced Learning AlgorithmMachine Learning/Stanford ML Specialization 2024. 2. 9. 23:16
Coursera Machine Learning Specialization > Supervised Machine Learning: Advanced Learning Algorithms > Neural Network Intuition 이제 NumPy를 이용해서 Coffee Rosting 문제를 해결해보자. 먼저 Library들과 로깅 세팅을 해보자. import numpy as np import matplotlib.pyplot as plt plt.style.use('./deeplearning.mplstyle') import tensorflow as tf from lab_utils_common import dlc, sigmoid from lab_coffee_utils import load_coffee_data,..
-
Forward Propagation in NumPy | Advanced Learning AlgorithmMachine Learning/Stanford ML Specialization 2024. 2. 9. 22:39
Coursera Machine Learning Specialization > Supervised Machine Learning: Advanced Learning Algorithms > Neural Network Intuition 이전에 했던대로, 모든것을 Hard Coding하게 되면, 코드도 길어지고 재사용도 힘들다. 그렇다면 NumPy를 이용해 조금 더 general한 방식으로 코드를 짠다면 어떤식일까? 먼저, 사용할 데이터들을 생각해보자. # W 값들이 정의되어있는 Matrix. 여기선 2 x 3 matrix라고 가정하자. # 1, 2는 w1, -3, 4는 w2, 그리고 5, -6은 w3이다. W = np.array([ [1, -3, 5] [2, 4, -6]]) # Bias(b) 값도 1D Arra..
-
Forward Propagation in a Single Layer | Advanced Learning AlgorithmMachine Learning/Stanford ML Specialization 2024. 2. 9. 19:49
Coursera Machine Learning Specialization > Supervised Machine Learning: Advanced Learning Algorithms > Neural Network Intuition 만약, TensorFlow나 PyTorch를 사용하지 않고, Forward Propagation을 Python에서 처음부터 구연해야한다면 어떻게 해야할까? 그 라이브러리보다 더 나은 Framework를 생각해 낸다면? 결국 이러한 것들을 처음부터 구현해야 할 수 도 있다. Coffee Rosting Model을 예시로 살펴보자. layer마다 각 뉴런에는 weight과 bias값이 있다. 각 뉴런은 아래와 같은 연산이 일어난다. 그렇다면 이 연산을 python으로 구현하면 어떻게..
-
듣고싶은 강의 목록책읽기/Computer Programming 2024. 2. 9. 18:45
여기 커리큘럼 모두 https://www.coursera.org/degrees/master-of-science-information-technology-iiithyderabad/academics Academics | MS in IT, IIIT Hyderabad Learn about the curriculum of the IIIT Hyderabad Master of Science in IT degree programme. www.coursera.org Meta 출신이 알려주는 프론트앤드 강의 https://www.coursera.org/professional-certificates/meta-front-end-developer Meta Front-End Developer Meta에서 제공합니다. Launch..