일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- Paper
- pandas
- pytorch
- Flask
- judge
- list
- 책갈피
- Linux
- Mac
- TORCH
- Package
- evaluation
- LLM
- file
- Laravel
- numpy
- PostgreSQL
- Windows
- docker
- DB
- KAKAO
- enV
- GitLab
- format
- git
- Database
- AI
- Container
- Converting
- Python
- Today
- Total
목록전체 글 (112)
Daily Develope
모르면 Adam(Adaptive Moment Estimation) 기반 Optimizer 사용하자! 용어 Adam (Adaptive Moment Estimation) 경사 하강법을 기반으로 하되, gradient 모멘텀과 학습량 증가에 따른 학습률 감소 문제를 개선한 최적화 알고리즘 AdamW Adam 옵티마이저에 가중치 감쇠(weight decay)를 적용해 오버피팅(overfitting)을 완화한 최적화 알고리즘 torch.optim.AdamW(params, lr=0.001, betas=(0.9, 0.999), eps=1e-08, weight_decay=0, amsgrad=False) params: 최적화할 파라미터들의 iterable lr: 학습률(learning rate), 기본값은 0.001 b..
의미 Type checking을 위해 데이터의 유형을 명시적으로 나타내기 위해 사용하는 Class (또는 Type) 자주 사용되는 Type Any : 모든 Type과 호환되는 Type Union : Union 리스트에 선언된 Type 중 하나에 해당함을 의미 def foo(arg: Union[int, float] = None) -> None: # arg는 int 또는 float 유형 # ... Optional : Optional 리스트에 선언된 Type이거나 None인 경우를 의미 def foo(arg: Optional[int] = None) -> None: # ... 가끔 사용되는 Type NoReturn : function의 반환값이 없음을 명시적으로 표현 from typing import NoRet..
Pickle이란? Python의 객체(Object)를 binary 파일로 serializing 하거나 반대로 binray 파일로부터 de-serializing 하기 위한 프로토콜이 구현된 라이브러리. 흔히 pickling, flattening, marshalling 등으로 일컫는다. 장점? Python 객체를 바로 파일로 쓰거나 읽을 수 있다. Binary(또는 Bytes) 형태로 데이터를 다루기 때문에 읽기/쓰기 속도가 빠르다. 읽기/쓰기 예시코드 import pickle import os my_filepath = "target/file/path/filename.bin" my_data = ['target', 'data'] if os.path.isfile(my_filepath): ### 읽기 with o..
Huggingface Model/Tokenizer 설치 pip install transformers사용 예시 Tokenizer 선언 (불러오기) from transformers import AutoTokenizer model = "klue/bert-base" tokenizer = AutoTokenizer.from_pretrained(model_checkpoint)Encoding (Tokenize-토큰화) & Decoding (디코딩) ### [pre-condition] Tokenizer 선언 이후 ### Encoding my_data = "text of target data" tokenized_input = tokenizer(my_data, padding='max_length', trunc..
postgresql DB를 생성하고, adminer 웹 UI를 통해 쉽게 DB를 제어할 수 있는 컨테이너 환경 구성 환경 Docker : version 20.10.13 샘플코드 컨테이너 구성 파일 (db_docker_compose.yaml) 컨테이너 및 가상망 설정 Docker 가상 네트워크 생성 (네트워크명:db-network) adminer와 postgresql 컨테이너 생성 및 가상망과 연결 postgresql 설정 image : postgres alpine 3.18 이미지 port : 호스트 5432 포트와 컨테이너 5432 포트 연결 DB ID/PW : 환경변수 파일(.env)의 값을 불러와 설정 (POSTGRES_USER / POSTGRES_PWD) volume : 환경변수 파일(.env)에 ..