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

translate hyperparameter_tuning_tutorial.py #595

Merged
merged 3 commits into from
Sep 12, 2022

Conversation

95hj
Copy link
Contributor

@95hj 95hj commented Sep 4, 2022

라이선스 동의

변경해주시는 내용에 BSD 3항 라이선스가 적용됨을 동의해주셔야 합니다.

더 자세한 내용은 기여하기 문서를 참고해주세요.

동의하시면 아래 [ ][x]로 만들어주세요.

  • 기여하기 문서를 확인하였으며, 본 PR 내용에 BSD 3항 라이선스가 적용됨에 동의합니다.

관련 이슈 번호

이 Pull Request와 관련있는 이슈 번호를 적어주세요.

이슈 또는 PR 번호 앞에 #을 붙이시면 제목을 바로 확인하실 수 있습니다. (예. #999 )

PR 종류

이 PR에 해당되는 종류 앞의 [ ][x]로 변경해주세요.

  • 오탈자를 수정하거나 번역을 개선하는 기여
  • 번역되지 않은 튜토리얼을 번역하는 기여
  • 공식 튜토리얼 내용을 반영하는 기여
  • 위 종류에 포함되지 않는 기여

PR 설명

이 PR로 무엇이 달라지는지 대략적으로 알려주세요.
beginner source 폴더의 hyperparameter_tuning_tutorial.py를 번역하였습니다.

@hyoyoung hyoyoung added the 컨트리뷰톤 오픈소스 컨트리뷰톤 관련 이슈/PR label Sep 4, 2022
Copy link
Contributor

@kimtaehyeong kimtaehyeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

전체적으로 번역 잘 해주셨습니다.
보완해야 할 내용은 리뷰로 남겼습니다.

# We can only tune those parameters that are configurable. In this example, we can specify
# the layer sizes of the fully connected layers:
# 구성 가능한 파라미터만 튜닝이 가능합니다.
# 이 예시를 통해 fully connected layers의 계층 크기를 지정할 수 있습니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

layer의 계층 크기라는 표현보다 layer 크기를 지정할 수 있습니다가 자연스러워 보입니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정 완료했습니다!

# PyTorch's abstractions in Ray Tune. Thus, we can wrap our model in ``nn.DataParallel``
# to support data parallel training on multiple GPUs:
# 이미지 분류는 GPU를 사용할 때 이점이 많습니다. 운좋게도 Ray Tune에서 파이토치의 추상화를 계속 사용할 수 있습니다.
# 따라서 여러 GPU에서 데이터 병렬 훈련을 지원하기 위해 ``nn.DataParallel`` 에서 모델을 래핑할 수 있습니다.
#
# .. code-block:: python
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -149,25 +133,23 @@ def forward(self, x): 부분이 빠진것 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

혹시 어떤 부분인지 조금 더 자세히 설명해주실 수 있나요? 원문하고 비교해봤는데 어디가 빠진건지 잘 모르겠습니다

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아.. 제가 착각한것 같습니다. 죄송합니다;;

@@ -283,13 +260,12 @@ def train_cifar(config, checkpoint_dir=None, data_dir=None):
print("Finished Training")

######################################################################
# As you can see, most of the code is adapted directly from the original example.
# 보다싶이, 대부분의 코드는 원본 예제에서 직접 적용되었습니다.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

보다시피가 맞는 표현 같습니다.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

감사합니다 수정 완료입니다:)

Copy link
Contributor

@kimtaehyeong kimtaehyeong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 부분은 착각한 것 같습니다.

# PyTorch's abstractions in Ray Tune. Thus, we can wrap our model in ``nn.DataParallel``
# to support data parallel training on multiple GPUs:
# 이미지 분류는 GPU를 사용할 때 이점이 많습니다. 운좋게도 Ray Tune에서 파이토치의 추상화를 계속 사용할 수 있습니다.
# 따라서 여러 GPU에서 데이터 병렬 훈련을 지원하기 위해 ``nn.DataParallel`` 에서 모델을 래핑할 수 있습니다.
#
# .. code-block:: python
#
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아.. 제가 착각한것 같습니다. 죄송합니다;;

@kimtaehyeong
Copy link
Contributor

수고하셨습니다.

Copy link
Member

@hyoyoung hyoyoung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

긴 문서 번역하느라 고생하셨습니다.
전반적으로 읽기 쉽게 작성되어 보기가 편합니다
다만 문서에 자주 나오는 래핑은 감싸기로 순화 가능할듯 보이고
몇가지 수정사항을 부탁드립니다

# As you can guess, the ``config`` parameter will receive the hyperparameters we would like to
# train with. The ``checkpoint_dir`` parameter is used to restore checkpoints. The ``data_dir`` specifies
# the directory where we load and store the data, so multiple runs can share the same data source.
# 훈련 스크립트를 ``train_cifar(config, checkpoint_dir=None, data_dir=None)`` 함수로 래핑합니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

래핑합니다는 감싸둡니다로 번역해도 좋을 듯 합니다

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

'감싸둡니다'로 수정하였습니다

# the directory where we load and store the data, so multiple runs can share the same data source.
# 훈련 스크립트를 ``train_cifar(config, checkpoint_dir=None, data_dir=None)`` 함수로 래핑합니다.
# 짐작할 수 있듯이, ``config`` 매개변수는 훈련할 하이퍼파라미터를 받습니다. ``checkpoint_dir`` 매개변수는 체크포인트를
# 복원하는 데 사용됩니다. ``data_dir`` 은 데이터를 로드하고 저장하는 디렉토리를 지정하므로,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

데이터를 로드하고 저장하는

->

데이터를 읽고 저장하는

이 조금 더 자연스러울듯 합니다

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수정 완료했습니다.

# PyTorch's abstractions in Ray Tune. Thus, we can wrap our model in ``nn.DataParallel``
# to support data parallel training on multiple GPUs:
# 이미지 분류는 GPU를 사용할 때 이점이 많습니다. 운좋게도 Ray Tune에서 파이토치의 추상화를 계속 사용할 수 있습니다.
# 따라서 여러 GPU에서 데이터 병렬 훈련을 지원하기 위해 ``nn.DataParallel`` 에서 모델을 래핑할 수 있습니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서도 래핑을 감싸다로 순화할 수 있을듯합니다

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 반영했습니다!

#
# So that's it! You can now tune the parameters of your PyTorch models.
# 이것이 전부입니다! 이제 파이토치 모델의 매개변수를 조정할 수 있습니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unix호환 운영체제에서는 (linux포함)
텍스트 파일의 끝에는 newline으로 끝나는걸 권장하고 있습니다
newline캐릭터가 맨 마지막에도 필요합니다

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

해당 부분 수정했습니다

4. and define the search space for the model tuning

**번역**: `심형준 <http://github.com/95hj>`_
하이퍼파라미터 튜닝은 평균적인 모델과 매우 정확한 모델간의 차이를 만들어 낼 수 있습니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여기서 average는 평균보다는 보통의 의미에 더 가까울듯합니다

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

네 수정하였습니다!

하이퍼파라미터 튜닝은 평균적인 모델과 매우 정확한 모델간의 차이를 만들어 낼 수 있습니다.
종종 다른 학습률(Learnig rate)을 선택하거나 layer size를 변경하는 것과 같은 간단한 작업만으로도 모델 성능에 큰 영향을 미치기도 합니다.
다행히, 최적의 매개변수 조합을 찾는데 도움이 되는 도구가 있습니다.
`Ray Tune <https://docs.ray.io/en/latest/tune.html>`_ 은 하이퍼파라미터 튜닝을 위해 배포된 업계 표준 도구입니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

distributed hyperparameter tuning의 번역이
'하이퍼파라미터 튜닝위해 배포된'인데
'분산 하이퍼파라미터 튜닝'에 더 가깝지 않을까요?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

번역하면서도 이상하다 싶었는데 '분산 하이퍼파라미터 튜닝'으로 번역하는 것이 맞는 것 같습니다. 수정사항 반영하였습니다!

beginner_source/hyperparameter_tuning_tutorial.py Outdated Show resolved Hide resolved
@95hj 95hj force-pushed the master branch 2 times, most recently from 1f17997 to 2e361d0 Compare September 10, 2022 21:50
@95hj 95hj requested review from hyoyoung and kimtaehyeong and removed request for kimtaehyeong and hyoyoung September 10, 2022 22:00
Copy link
Member

@hyoyoung hyoyoung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2가지 사항을 추가로 제안드립니다.

  1. 래핑 -> 감싸두기로 순화

  2. 시도 -> 실험으로 순화
    trial은 보통 시도로 번역합니다만
    여기서는 다양한 트레이닝 실험을 해서 정확도를 올리는 방법을 소개하고 있으므로
    시도보다는 실험으로 의역하는 것이 조금 더 읽기 편할듯 한데
    어떻게 생각하시나요?
    trial에는 실제로 실험이라는 뜻도 있긴합니다.
    만약 동의하신다면 '시도'는 모두 '실험'으로 변경 부탁드립니다.

https://en.dict.naver.com/#/entry/enko/7e20a8f23bb444d7901351430e98d765

이 튜토리얼은 Ray Tune을 파이토치 학습 workflow에 통합하는 방법을 알려줍니다.
CIFAR10 이미지 분류기를 훈련하기 위해 `파이토치 문서에서 이 튜토리얼을 <https://tutorials.pytorch.kr/beginner/blitz/cifar10_tutorial.html>`_ 확장할 것입니다.
아래와 같이 약간의 수정만 추가하면 됩니다.
1. 함수에서 데이터 로딩 및 학습을 래핑하고,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. 여러 함수들에서 데이터 읽어오기 및 학습 부분을 감싸두고,

정도로 순화하면 어떨까요?

#
# Data loaders
# ------------
# We wrap the data loaders in their own function and pass a global data directory.
# This way we can share a data directory between different trials.
# data loader를 자체 함수로 래핑하고 전역 데이터 디렉토리로 전달합니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

래핑 -> 감싸두고

# set with data that has not been used for training the model. We also wrap this in a
# function:
# 일반적으로 머신러닝 모델의 성능은 모델 학습에 사용되지 않은 데이터를 사용해 테스트합니다.
# Test set 또한 함수로 래핑할 수 있습니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

래핑할 수 -> 감싸둘 수

# We wrap the ``train_cifar`` function with ``functools.partial`` to set the constant
# ``data_dir`` parameter. We can also tell Ray Tune what resources should be
# available for each trial:
# 상수 ``data_dir`` 파라미터를 설정하기 위해 ``functools.partial`` 로 ``train_cifar`` 함수를 래핑합니다. 또한 각 시도에 사용할 수 있는 자원들(resources)을 Ray Tune에 알릴 수 있습니다.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

래핑합니다 -> 감싸둡니다

@95hj
Copy link
Contributor Author

95hj commented Sep 11, 2022

말씀해주신 내용들에 동의합니다. 실험으로 번역하는것이 더 타당해 보입니다. '래핑->감싸다', '시도->실험'으로 수정 완료했습니다!

@95hj 95hj requested a review from hyoyoung September 11, 2022 22:38
Copy link
Member

@hyoyoung hyoyoung left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good

@hyoyoung hyoyoung merged commit 47c52c4 into PyTorchKorea:master Sep 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
컨트리뷰톤 오픈소스 컨트리뷰톤 관련 이슈/PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants