Programming 95

Markdown Cheatsheet - Jupyter Notebook / Lab 마크다운모음집

1. 문단 형식 설정 (#) 글자 앞에 # 개수에 따라서 크기를 다르게 조정할 수 있다. #개수가 작을수록 글씨가 커진다. 2. 문장 앞 Space markdown cell에서는 맨 첫글자 앞에 space를 하기 위해서는 단순히 space bar를 눌러서는 안된다. (이를 사용할 때, 단순 텍스트로 인식할 수 있으니 텍스트 앞뒤로 구분자를 넣어주어야 한다.) 1) : 한칸 띄우기 2) : 두칸 띄우기 3) : 네칸 띄우기 3. 텍스트 강조하기 _text_ 또는 *text* : Italic 이탤릭체 __text__ 또는 **text** : Bold 볼드 (굵은 글씨) ***text*** : Bold and Italic (볼드와 이탤릭을 동시에) ~text~ : Stroke 취소선 (text) text : ..

Programming/python 2022.10.24

TqdmWarning: IProgress not found. 에러 해결방법 (Anaconda, Jupyter Lab / Notebook)

Conda에 Jupyter 조합을 쓰는사람에게 자주 발생하는 에러라고 한다. [해결 방법] 1) Jupyter lab / notebook 종료한 상태에서 Terminal or Anaconda Prompt 접속 2) (base)상태에서 아래의 커맨드로 jupyterlab_widgets 설치 3) (base)상태에서 아래의 두번째 커맨드로 ipywidgets 설치 - your_environment 부분에 본인의 가상환경 이름을 넣기! conda install -n base -c conda-forge jupyterlab_widgets conda install -n your_environment -c conda-forge ipywidgets 4) 터미널 종료하고 다시 재실행하면 에러가 발생하지 않음

Programming/errors 2022.10.21

Python으로 CSV파일 읽기

엑셀의 확장자로 흔하게 볼 수 있는 형식인 , 콤마를 구분자로 하여 파일을 구성하는 CSV 파일을 파이썬에서 다룰 수 있는 라이브러리를 공부해보자. (CSV : Comma-separated values) 파이썬에서는 csv라는 라이브러리를 지원한다. 우선, csv 라이브러리를 임포트해준다. import csv 그 이후는 아주 쉽다. # 불러올 파일 변수 path = "class-descriptions-boxable.csv" # 파일을 python으로 로드하기 boxable_f = open(path, 'r', encoding='utf-8') print(type(boxable_f)) # # csv형태로 파일을 읽어준다. boxable_desc = csv.reader(boxable_f) # 불러온 파일 확인해..

Programming/python 2022.09.22

torch.view (파이토치 뷰) 함수 설명

# Manual -> https://pytorch.org/docs/stable/generated/torch.Tensor.view.html torch.Tensor.view — PyTorch 1.12 documentation Shortcuts pytorch.org 파이토치 함수 중 view 함수는 tensor형태의 데이터의 shape을 바꿔주는 함수이다. 원본데이터도 같고, 성분의 수도 같지만 이를 구성하는 shape만 다르게 만들어주는 함수이다. 예시는 아래와 같다. # make the random tensor input = torch.randn(1, 28, 28) - 랜덤한 값으로 tensor를 만들어준다. # reshape the tensor using torch.view n = 1 output1 = ..

Jupyter lab 실행 시, 에러(Error) 설명 - NumExpr detected 12 cores but "NUMEXPR_MAX_THREADS" not set, so enforcing safe limit of 8.

# NumExpr User Guide - Threadpool Configuration https://numexpr.readthedocs.io/projects/NumExpr3/en/latest/user_guide.html#threadpool-configuration NumExpr 2.0 User Guide — numexpr 2.6.3.dev0 documentation The numexpr package supplies routines for the fast evaluation of array expressions elementwise by using a vector-based virtual machine. Enabling Intel VML support Starting from release 1.2 on,..

Programming/errors 2022.09.07

Linux에 ML환경 구축하기 (2) - anaconda, pytorch, tensorflow2, pip3, jupyter lab / notebook 설치 방법 모음

https://kyull-it.tistory.com/19 Linux에 ML환경 구축하기 (1) - CUDA, cuDNN 여러 버전 한 컴퓨터에 설치하기 + 드라이브 설정 ※ Ubuntu LTS 20.04 버전 설치 필수 (22.04버전에서는 Pytorch, Tensorflow지원 CUDA 호환X) - 2022.08.16 기준 1. GPU 스펙 확인 - CUDA설치가 가능한 시스템을 갖추고있는지 확인하는 과정 - 필자는 컴퓨터 전체 스 kyull-it.tistory.com # 1 : Anaconda 설치방법 - Linux anaconda installation Manual https://docs.anaconda.com/anaconda/install/linux/#installation Installing o..

Handling proper nouns in Machine Translation (기계번역에서 고유명사 처리 전략)

1. 번역을 하지 않고, 원문 그대로를 가져오는 방법 (Keep in the source language) - ex. Hello, John! 2. 음역번역 (Transliteration) - 가장 인기있는 방법 - 뜻이 아니라 발음 그대로를 가져와서 타켓언어로 변환하는 방법 - 원문 발음을 그대로 타켓의 언어로 읽는 방법 - ex. John → 존 3. 기계 번역 (Translation) - ex. New York - 새로운 욕 - 해당 방법은 거의 사용하지 않거나, 2번의 전략과 섞어 쓴다. 출처 : Key strategies for translating proper nouns

문장분절을 위한 Python Library (Sentences Segmentation) - Spacy, kss

Spacy는 고급 자연어 처리를 도와주는 python 라이브러리이다. Spacy 설치방법 : https://spacy.io/usage Install spaCy · spaCy Usage Documentation spaCy is a free open-source library for Natural Language Processing in Python. It features NER, POS tagging, dependency parsing, word vectors and more. spacy.io 내가 설치하고자 하는 path에서 아래의 커맨드로 설치 - Linux에 pip으로 설치의 경우 pip install -U pip setuptools wheel pip install -U spacy python -m ..

Anaconda 외워두면 좋을 필수 명령어 모음 (가상환경 생성, 라이브러리 설치 및 관리 방법)

# 가상환경 conda create -n [가상환경이름] python=x.x # 가상환경 생성 conda info --envs # 생성된 가상환경 리스트 conda activate [가상환경이름] # 가상환경 활성화 conda deactivate # 가상환경 비활성화 conda remove -n 가상환경이름 --all # 가상환경 삭제 virtual_env.yaml"}">conda env export > virtual_env.yaml # 가상환경을 .yaml 파일로 내보내서 저장 conda create -n [복사된_가상환경이름] --clone [복사할_가상환경이름] # 가상환경 클론 생성 anaconda prompt 가상환경 - 라이브러리 설치 requirements.txt "}">pip freeze ..

Linux에 ML환경 구축하기 (1) - Multi CUDA, cuDNN 여러 버전 한 컴퓨터에 설치하기 + 드라이브 설정 (local)

※ Ubuntu LTS 20.04 버전 설치 필수 (22.04버전에서는 Pytorch, Tensorflow지원 CUDA 호환X) - 2022.08.16 기준 1. GPU 스펙 확인 - CUDA설치가 가능한 시스템을 갖추고있는지 확인하는 과정 - 필자는 컴퓨터 전체 스펙을 확인할 수 있는 [CPU-Z]라는 프로그램을 활용하여 확인함 - Graphics > Display Device Selection > NVIDIA GeForce RTX 3060 - the list of CUDA-enabled GPU cards에 내 GPU가 있는지 확인 2. 설치해야하는 CUDA 버전 확인 - PyTorch의 Compute Platform에서 11.6버전이 필요함을 확인 - Tensorflow의 Software Requir..