MLDL_정리/Sample 10

Learing Rate Scheduler

💡Learung Rate 정의 Learing Rate는 Gradient의 보폭을 말한다. Deep Learning Network이 확률적 경사 하강법(SGD) 최적화 알고리즘을 사용하여 훈련 하는 데, 사용되는 파라미터이다. Learing Rate는 성능에 꽤 큰 영향을 주는 파라미터이며, 학습되는 모델의 weight의 최적값을 어떻게 찾아 나갈 지 보폭을 정한다. (hyper param) ▶ Hyper Parameter는 user가 직접 셋팅 할 수 있는 값이며, knn or lr rate 등.. 👉 Scheduler Learing Rate를 조정하는 Learing Rate Scheduler를 사용하면 learning rate(보폭)으로 빠르게 optimize를 하고, 최적값에 가까월 질수록 leari..

MLDL_정리/Sample 2023.02.24

Pre Train, Find Tuning 정의

💡Pre Training 정의 선행 학습, 사전 훈련, 전처리 과정이라고도 하며, multi layered perceptron(mlp)에서 weight와 bias를 잘 초기화 시키는 방법 💡Fine Tuning 정의 기학습된 모델을 기반으로 하여, 내가 원하는 이미지에도 대응이 가능하게, 학습된 모델의 weight로 부터 학습을 업데이트 하는 방법 👉 Pretrained Model의 Fine Tuning(미세 조정) 방식 ImageNet Pretrained 모델을 커스텀 모델로 활용 할 시, ImageNet으로 학습된 Feature Extractor 내의 가중치(weight)값의 급격한 변화를 제어하기 위해 적용 하는 기법 🚀 적용 방식 단계 1: feature extractor, classificati..

MLDL_정리/Sample 2023.02.24

[DL] CIFAR-10

🙋‍♂️ CIFAR-10 구성 CIFAR-10 Data Set은 32 x 32 크기의 60,000개의 Image Set으로 구성 되어 있으며, 10개의 Class로 분류 된다.각 Class는 60,000개의 전체 이미지와 50,000개의 Train Image, 10,000개의 Test Image로 구성 (Labels는 동일) → Mnist보다 가볍고, 시간이 덜 소요됨 ✍ Data Set Load / Labels 확인 # Default import import numpy as np # linear algebra import pandas as pd # data processing, CSV file I/O (e.g. pd.read_csv) import os from tensorflow.keras.datase..

MLDL_정리/Sample 2022.03.22

[DL] - Object Detection / MMDetection Package

👉 MMDeteection 개요 칭화 대학의 주도로 만들어진 C.V Open Source Project인 OpenMMLab에서 시작 다양한 Object Detection, Segmentation 알고리즘을 Package로 구현 제공 구현 성능, 효율적인 모듈 설계, Config 기반으로 학습 / 평가 까지 실행되는 파이프라인 적용 Pytorch 기반으로 구현 👉 MMDeteection 구현 # config 파일을 설정하고, 다운로드 받은 pretrained 모델을 checkpoint로 설정. config_file = '/content/mmdetection/configs/faster_rcnn/faster_rcnn_r50_fpn_1x_coco.py' checkpoint_file = '/content/mmde..

MLDL_정리/Sample 2022.03.07

[DL] - MediaPipe / Video Object Detection

👉 개발 환경 : Jupyter Notebook, Python 3.9, MediaPipe, Opencv ✍ Source Code import cv2 import mediapipe as mp # face detection, 찾은 detection 영역에 임의의 표시를 위해 변수 선언 mp_face_detection = mp.solutions.face_detection mp_drawing = mp.solutions.drawing_utils # For webcam input: cap = cv2.VideoCapture("c:\\face_video.mp4") # Source Video # min_detection_confidence 는 0 ~ 1의 값으로 값을 올릴수록 정교하게 object detection 진행..

MLDL_정리/Sample 2022.03.06

DL - Confusion Matrix

Model 성능 평가 방법 - Confusion Matrix → 학습된 모델의 입력값과 예측값을 정리한 테이블을 Confusion Matrix 이라고 한다. → Confusion Matrix를 통해서 모델의 성능지표인 Accuracy, Precision, Recall, F1 Score를 계산 Confusion Matrix 보면 학습된 모델에게 '1'을 5번 보여줬을때 2번 맞췄다는걸 알 수 있습니다. '2'는 5번, '3'은 3번 , '4'는 4번 맞춘걸 알 수 있습니다. import sys, os sys.path.append(os.pardir) import numpy as np from dataset.mnist import load_mnist from two_layer_net import TwoLaye..

MLDL_정리/Sample 2022.02.05

DL - 오차역전파법을 이용한 확률 분포

import sys, os sys.path.append(os.pardir) # 부모 디렉터리의 파일을 가져올 수 있도록 설정 import numpy as np from common.layers import * from common.gradient import numerical_gradient from collections import OrderedDict class TwoLayerNet: def __init__(self, input_size, hidden_size, output_size, weight_init_std = 0.01): # 가중치 초기화 self.params = {} self.params['W1'] = weight_init_std * np.random.randn(input_size, hidd..

MLDL_정리/Sample 2022.02.05