Data 49

Pytorch data Samplers & Sequence bucketing

Guide: Pytorch data Samplers & Sequence bucketing Explore and run machine learning code with Kaggle Notebooks | Using data from CommonLit Readability Prize www.kaggle.com 링크의 내용 리뷰하고자 한다. Data Sampler : 주어진 데이터 풀과 배치 사이즈에서 어떻게 배치를 형성할지 결정해주며, 데이터셋의 순서(order)를 결정하기도 한다. Dataloader가 초기화될 때, 그 안에서 데이터셋의 샘플들의 sequence order를 작성한다. 이때 만들어진 sequence를 통해 데이터셋에서 데이터들이 주어진 배치사이즈만큼 배치의 형태로 나오게 된다. dataset..

Data/코드 리뷰 2022.02.28

Huggig Face, Tokenizers

The 🤗 Tokenizers library - Hugging Face Course Introduction In Chapter 3, we looked at how to fine-tune a model on a given task. When we do that, we use the same tokenizer that the model was pretrained with — but what do we do when we want to train a model from scratch? In these cases, using a tokeni huggingface.co 코스 6에 해당하는 내용 1. 기존 토크나이저로 새 토크나이저 학습시키기 데이터셋을 불러오고 사용할 데이터를 확인. generator를 활용해 토..

Data/Information 2022.02.25

Hugging Face, Datasets

The 🤗 Datasets library - Hugging Face Course Introduction In Chapter 3 you got your first taste of the 🤗 Datasets library and saw that there were three main steps when it came to fine-tuning a model: Load a dataset from the Hugging Face Hub. Preprocess the data with Dataset.map(). Load and compute huggingface.co 오늘은 chapter 5 내용을 리뷰하고자 한다. 1. Data 불러오기 데이터 로드 및 확인, field를 통해 어디에서 data를 가져올지 지정(j..

Data/Information 2022.02.24

Hugging Face, Hub와 Repository 활용

Sharing models and tokenizers - Hugging Face Course In the steps below, we’ll take a look at the easiest ways to share pretrained models to the 🤗 Hub. There are tools and utilities available that make it simple to share and update models directly on the Hub, which we will explore below. We encourage al huggingface.co 위 링크, Course 4의 Sharing pretrained models의 내용 요약입니다. 노트북 환경에서 notebook_login()을..

Data/Information 2022.02.22

Hugging Face, pretrained models 불러오기

Sharing models and tokenizers - Hugging Face Course Using pretrained models The Model Hub makes selecting the appropriate model simple, so that using it in any downstream library can be done in a few lines of code. Let’s take a look at how to actually use one of these models, and how to contribute back to huggingface.co 위의 링크의 내용 1. 파이프라인 패키지를 통해 불러오기 - 가장 단순하지만 Task에 맞는 모델을 불러와야함. 2. 모델 아키텍쳐 패키..

Data/Information 2022.02.22

Hugging Face, fine-tuning 까지

Fine-tuning a pretrained model - Hugging Face Course Now we’ll see how to achieve the same results as we did in the last section without using the Trainer class. Again, we assume you have done the data processing in section 2. Here is a short summary covering everything you will need: Before actually writi huggingface.co 최근 허깅페이스의 코스를 학습 중이다. 허깅페이스는 NLP 문제들을 쉽게 해결할 수 있게 도와주는 API이자 HUB라고 보면 되겠다. ..

Data/Information 2022.02.22

Conda 가상 환경 생성, Kernel 추가하기

현재 콘다 가상 환경 리스트 conda create -n "가상 환경 이름" python="파이썬 버젼" 콘다 가상 환경 생성 (이름 : new_kernel, python 버젼 3.7) 콘다 가상 환경 변경 ipykernel 라이브러리 설치 커널 추가 하기 python -m ipykernel install --user --name 가상 환경 이름 --display-name "디스플레이될 이름" 주피터 노트북 열기 커널 생성 확인, new의 새로운 커널로 노트북 생성 가능. 오른쪽 위에는 현재 커널 커널 탭의 change kernel로 커널 변경 가능 jupyter kernelspec uninstall "가상 환경 이름" 프롬프트로 돌아와서 커널 삭제 가상 환경 비활성화, 이전 가상 환경으로 돌아옴 con..

Data/Errors 2022.02.22

torch.cuda.is_available()이 False일 때

GPU에 맞는 CUDA를 설치하고 cuDNN kit 까지 잘 설치하고 GPU 디바이스가 설치된 것이 확인됐는데도 torch.cuda.is_available()이 False라면 torch 버젼을 확인하고 다시 깔아주자. CUDA 버젼 확인 내 경우, torch version이 1.10.2+cpu로 되어있어서 gpu를 못잡았더라. Pytorch uinstall PyTorch An open source machine learning framework that accelerates the path from research prototyping to production deployment. pytorch.org 파이토치 사이트 방문 후 맞는 사양을 선택하고 Run this command의 코드를 프롬프트에 복사,..

Data/Errors 2022.02.22