본문 바로가기

Develop/Python

(20)
hydra framework (decorator) python 프레임워크 https://pjt3591oo.github.io/hydra_translate/build/html/About/Introduction.html hydra documation 한글 버전 소개 — Hydra Of Python translate V0.9.0 0.9.0 documentation 소개 히드라는 복잡한 어플리케이션 설정을 아름다운 사용을 위한 프레임워크. 히드라라는 이름은 비슷한 다수의 작업을 수행할 수 있는 능력에서 비롯되었다. - 마치 머리가 여러개 있는 히드 pjt3591oo.github.io https://lassl.github.io/implementation/hydra.html hydra 철학과 간단한 사용법 간단한 예제로 살펴본 Hydra를 이용한 어플리케이션 구성 Hydra: 페이스북에서..
conda env export / import 콘다 가상환경 백업/복구 conda env export > xxxxxx.yaml name: grit channels: - conda-forge dependencies: - _libgcc_mutex=0.1=conda_forge - _openmp_mutex=4.5=2_gnu - bzip2=1.0.8=h7f98852_4 - ca-certificates=2022.9.24=ha878542_0 - ld_impl_linux-64=2.39=hc81fddc_0 - libffi=3.4.2=h7f98852_5 - libgcc-ng=12.2.0=h65d4601_19 - libgomp=12.2.0=h65d4601_19 - libnsl=2.0.0=h7f98852_0 - libsqlite=3.40.0=h753d276_0 - libuuid=2.32.1=h7..
Python function Decorator (함수 장식자 @) https://jythonbook-ko.readthedocs.io/en/latest/DefiningFunctionsandUsingBuilt-Ins.html#id20 4장. 함수 정의하기 및 내장함수 사용하기 — 자이썬(Jython) 완벽 안내서 함수는 파이썬에서 작업의 기본 단위이다. 파이썬에서의 함수는 작업을 수행하여 결과를 반환한다. 이 장에서는 함수의 기초에서 시작하여 내장(built-in) 함수의 사용법을 알아볼 것이다. 내장 jythonbook-ko.readthedocs.io 장식자 decorator는 함수를 변형시키는 방법을 기술하는 데에 편리하다. 그것들은 본질적으로, 그것들이 장식하는 함수의 행위를 강화하는 메타 프로그래밍 기법이다. 함수 장식자란, 이미 정의된 함수를 다른 함수를 장식하는..
이미지 캡셔닝 예제 소스 https://dinolabs.tistory.com/295 [에어] InceptionV3으로 한국어(한글) 이미지 캡셔닝(Image Captioning) 모델 만들기 (파이썬/Colab) 에어 프로젝트 #6 InceptionV3으로 한국어(한글) 이미지 캡셔닝(Image Captioning) 모델 만들기 만약 인공지능이 경기장에서 축구를 하고 있는 사람의 이미지를 보고 '사람이 경기장에서 축구를 하고 있 www.dinolabs.ai 데이터 셋 - AI Hub 한국어 이미지 설명 데이터셋 https://aihub.or.kr/aihubdata/data/view.do?currMenu=120&topMenu=100&aihubDataSe=extrldata&dataSetSn=261 AI-Hub 분야기타 유형 텍스트 ..
Conda env prefix 쉘 표기 변경하기 conda config --set env_prompt '({name})' https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#specifying-a-location-for-an-environment Managing environments — conda 22.9.0.post48+5df27c43e documentation Conda removes the path name for the currently active environment from your system command. Note To simply return to the base environment, it's better to call conda ..
einops 라이브러리 tensor 차원변경용 Einstein notation 은 복잡한 텐서 연산을 표기하는 방법입니다. 이름이 생소할 수는 있어도 사실 선형대수학을 비롯해서 벡터/행렬 등을 표기할 때 일반적으로 쓰는 방법이죠. https://en.wikipedia.org/wiki/Einstein_notation 딥러닝에서 쓰이는 많은 연산은 Einstein notation 으로 쉽게 표기할 수 있습니다. 기존에도 프레임워크마다 'einsum' 라는 API 가 있긴 했지만 각각 작성법이 다르고 기능이 제한적이었는데, 마침 반갑게도 얼마 전에 numpy, pytorch, tensorflow 등 여러 프레임워크를 동시에 지원하는 einops (https://github.com/arogozhnikov/einops) 라는 라이브러리가 공개되었습니다. 그리..
Git 명령어 정리 git init : 현재 디렉토리를 Git이 관리하는 프로젝트 디렉토리(=working directory)로 설정하고 그 안에 레포지토리(.git 디렉토리) 생성 git config user.name 'codeit' : 현재 사용자의 아이디를 'codeit'으로 설정(커밋할 때 필요한 정보) git config user.email 'teacher@codeit.kr' : 현재 사용자의 이메일 주소를 'teacher@codeit.kr'로 설정(커밋할 때 필요한 정보) git add [파일 이름] : 수정사항이 있는 특정 파일을 staging area에 올리기 git add [디렉토리명] : 해당 디렉토리 내에서 수정사항이 있는 모든 파일들을 staging area에 올리기 git add . : working..
python pickle 기본 사용법 import pickle my_list = ['a','b','c'] ## Save pickle with open("data.pickle","wb") as fw: pickle.dump(my_list, fw) ## Load pickle with open("data.pickle","rb") as fr: data = pickle.load(fr) print(data) #['a', 'b', 'c']