| Model | Year | Paper | State |
|---|---|---|---|
| GAN | 2014 | Done | |
| cGAN | 2014 | Code Done | |
| DCGAN | 2016 | Done | |
| WGAN | 2017 | Done | |
| WGAN-GP | 2017 | Code Done | |
| LSGAN | 2017 | Code Done | |
| EBGAN | 2016 | Code Done | |
| Pix2Pix | 2016 | Code Done | |
| CycleGAN | 2017 | Code Done | |
| SRGAN | 2016 | Code Done | |
| ACGAN | 2016 | Code Done | |
| ProGAN | 2018 | Code Done |
OS: Ubuntu 20.04 LTS x86_64 Kernel: 5.4.0-80-generic Shell: zsh 5.8 CPU: Intel i9-10980XE (36) @ 4.800GHz GPU 00: NVIDIA RTX-3090 NVIDIA Corporation Device 2204 GPU 01: NVIDIA RTX-3090 NVIDIA Corporation Device 2204 Memory: 128512MiB
- albumentations==1.0.3
- PyYAML==5.4.1
- scipy==1.7.0
- tensorboard==2.5.0
- torch==1.9.0
- torchvision==0.10.0
- tqdm==4.61.2
- Repository Rules
- Anaconda CUDA Env install (Local)
- Anaconda CUDA Env install (Docker)
- Useful Tools
- AMP(Automatic Mixed Precision) package
- Kaggle API(Dataset Download)
- Code Structure
- Template Meta
- Run Model
각 구현체의 경우 디렉터리로 구분되어 있으며 각 구현체 디렉터리의 경우 아래와 같은 구조를 기본으로 합니다. 별도의 구성요소가 포함되면 각 구현체 README.md에 설명을 포함합니다.
# (option) : 학습 과정 중 생성 # (*) : 학습에 꼭 필요 혹은 기본 구성요소 RepoRootPath │── opt.py # Template class 와 같은 부가 요소 link to MyAwesomeModel's ├── dataset # 학습 데이터 전처리(*) link to MyAwesomeModel's ├── DATASET # downloaded data dir (*) ├── GAN # 구현된 모델(구현체) │ ├── README.md # 구현체 개별 설명(option) │ ├── log # log dir(option) │ ├── hyperparameters.py # 학습 파라미터(*) │ ├── model.py or module # 구현된 모델(*) │ ├── train.py # 구현체 학습자(*) │ ├── dataset # link from root dir's dataset (*) │ ├── opt.py # link from root dir's opt.py (*) │ ├── src │ │ └── [paper].pdf # paper of model ├── DCGAN # 구현된 모델(구현체) ├── MyAwesomeModel # 구현된 모델(구현체) ├── README.md ├── ... Etc
해당 레포는 템플릿 프로그래밍을 사용합니다.
모든 구현체 내부의 "opt.py"(link) 의 "Template" class를 상속받아 학습을 진행합니다.
Template class 설명은 아래와 같습니다.
class Template(metaclass=ABCMeta): """ Abstract Class for Trainer """ def __init__(self, hp: dict, model_name: str): """ Args: hp (dict): hyperparameters for train model_name (str): train model name (for log dir name) Desc: - 학습진행필요한 변수를 생성 - seed 값 초기화 - Tensorboard를 위한 log 디렉터리 생성 """ @abstractmethod def train(self): """ Desc: - 실제 학습을 진행할 메서드 - 대부분의 구현은 여기서 이루어 짐 """ def test(self,real): """ Desc: - 학습 도중 test/sample 생성을 진행할 메서드 """
따라서 모든 모델 구현체의 경우 아래와 같은 방식으로 생성되어 있습니다.
# 새로운 모델 구현 예시 (train.py) import hyperparameters as hp class MyAwesomeModelTrainer(Template): def __init__(self): super().__init__(hp,'MyAwesomeModel') ... def train(self): ... def test(self): ... ... if __name__ == '__main__': # train.py에 main 작성 trainer = MyAwesomeModelTrainer() trainer.train()
- requirements.txt 를 사용해 python 인터프리터의 환경 설정을 진행 합니다.
you@server:~$ pip install requirements.txt- 원하는 모델의 디렉터리로 이동해 학습자를 실행합니다.
you@server:~$ pwd [RepoRootPath] you@server:~$ cd MyAwesomeModel # 원하는 모델 디렉터리로 이동 you@server:~$ python train.py # 학습자 실행
- TensorBoard를 통해 학습 로그를 시각화합니다.
you@server:~$ pwd [RepoRootPath]/MyAwesomeModel you@server:~$ tensorboard --bind_all --logdir log/MyAwesomModel/[**TimeStamp**]