이 프로젝트는 연세대학교 어영정 교수님의 'GAN (AAI5007)'수업 과제 일환으로 제작되었습니다.
cloud-based ML Platform |
Scalable Parameter Tuning |
|||
Image Augmentation |
"YACS" Variable Configuration |
Quick Test/Play Around |
Code Formatter |
Comet.ml
provides a self-hosted and cloud-based meta ML platform allowing to track and optimize experiments and models.Docker
👨💻 + 🐳 = 💕Pytorch-lightning
, The lightweight PyTorch wrapper for high-performance AI research.YACS
is designed to be simple configuration management system for academic and industrial research projects.Albumentation
is a fast image augmentation library and easy to use wrapper around other libraries.이 프로젝트는 Pytorch를 기반으로 다양한 High-level 라이브러리를 사용합니다.
추후 Boilerplate Template으로 Refactor 후 배포될 예정입니다.
본 코드는 아래의 특징을 모토로 설계하였습니다.
Reproduciblity
: Docker를 사용해 어떤 환경에서든지 5분 안에 실행할 수 있습니다.Clean Coding
: 단순함과 직관성. Clean Coding Rule을 준수하려고 노력하였습니다.modularity
: 각자의 기능이 다른 조각들을 서로 다른 파이썬 sub module로 분리하였습니다.data-augmentation
: Albumentation 패키지를 포함했습니다.ready to go
: 혁신적인 pytorch-lightning 라이브러리를 사용해 train loop을 쓰지 않아도 됩니다.- Comet.ml 을 내장했습니다. ID만 입력하면 모든 학습현황을 모니터링 할 수 있습니다.
Test-Produce-Go
: Jupyter Notebook으로 빠르게 테스트 후 적용이 가능합니다.
./docker/Dockerfile.dev
에서 컨테이너에 접속하기 위한 SSH password를 설정해줍니다.
ENV SSHPASSWD "MY_PASSWORD"
./docker/settings.sh
에서 Dataset과 Output (Optional)의 경로를 설정해줍니다.
#DEFAULT CONFIGURATION
#================================================
#Configure Path
DATASET_DIR=${PROJ_DIR}/dataset # Your dataset path
OUTPUT_DIR=${PROJ_DIR}/output # Your output path : weight, log, checkpoint, predictions..
#Configure Settings
IMAGE="100daysgan" # Image name
CONTAINER="100daysgan" # Container name
GPUS="all" # "all", "0,1,2..", "none"
JUPYTER_PORT_H=18888 # jupyter port
DEFAULT_PORT_H=10022 # SSH port
TB_PORT_H=16006 # TensorBoard port
#================================================
# ensure you are in DCGAN repository
# Build the docker image
./docker/build.sh
# Run the docker container
./docker/run.sh
# Attatch into contaier
./docker/exec.sh
이 프로젝트를 구현하는데 도움을 받은 Github Project
/Blog Post
는 다음과 같습니다.
-
clean-code-ml by David Tan
-
Coding habits for data scientists by David Tan
-
Pytorch Deep Learning Template by Francesco Saverio Zuppichini Blog
-
Best practices to write Deep Learning code: Project structure, OOP, Type checking and documentation by Sergios Karagiannakos
-
Tips for Publishing Research Code by paperswithcode
-
AI 연구자를 위한 클린코드 by 한성민
.
├── callbacks // here you can create your custom callbacks
├── checkpoint // were we store the trained models
├── data // here we define our dataset
│ └── transformation // custom transformation, e.g. resize and data augmentation
├── dataset // the data
│ ├── train
│ └── val
├── logger.py // were we define our logger
├── losses // custom losses
├── main.py
├── models // here we create our models
│ ├── MyCNN.py
│ ├── resnet.py
│ └── utils.py
├── playground.ipynb // a notebook that can be used to fast experiment with things
├── Project.py // a class that represents the project structure
├── README.md
├── requirements.txt
├── test // you should always perform some basic testing
│ └── test_myDataset.py
└── tools.utils.py // utilities functions