Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

코드 리팩토링 #4

Merged
merged 10 commits into from
Feb 11, 2025
Merged

코드 리팩토링 #4

merged 10 commits into from
Feb 11, 2025

Conversation

jiy0-0nv
Copy link
Contributor

폴더 구성

configs/
└── config.py  # 모델, 하이퍼파라미터, 경로 설정

dataset/
└── XRayDataset.py  # train 및 inference에 필요한 data를 불러옴

inference/
├── inference.py  # inference main 실행 파일
└── tta.py  # test time augmentation 적용 함수

models/  # 모델별 class를 모아 둔 폴더
└── ...

train/
├── augmentation.py  # train augmentation 적용 함수
├── loss.py  # loss 함수들을 모아 둔 파일
├── modelTrainer.py  # 모델 학습 함수, 검증 함수
└── train.py  # train main 실행 파일

utils/
├── crop/  # cropchange를 적용하는 노트북 파일
├── ensemble/  # 앙상블 파일들
├── pseudo/  # pseudo labeling을 위한 파일들
└── utils.py  # train 및 inference에서 쓰이는 작은 모듈들

학습 실행: python train/train.py
추론 실행: python inference/inference.py

수정사항

  1. train과 inference를 위한 main 함수를 작성하고, 중복되는 코드들을 통합 및 삭제
  2. config 파일에서 경로 관리
  3. 기능에 따라 augmentation, loss, utils, trainer 파일을 분리

고민되는 부분

  1. 모델의 변화를 yaml 파일로 관리하는 방식을 잘 모르겠습니다.
  2. train.py, inference.py를 폴더 밖으로 빼는 게 좋을까요?

@jiy0-0nv jiy0-0nv requested a review from KyubumShin December 18, 2024 02:25
@jiy0-0nv jiy0-0nv merged commit a510b48 into main Feb 11, 2025
@jiy0-0nv jiy0-0nv self-assigned this Feb 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant