Skip to content

intermediate_source/reinforcement_ppo.py 번역#1139

Open
ptesogno wants to merge 2 commits into
PyTorchKorea:masterfrom
ptesogno:main
Open

intermediate_source/reinforcement_ppo.py 번역#1139
ptesogno wants to merge 2 commits into
PyTorchKorea:masterfrom
ptesogno:main

Conversation

@ptesogno
Copy link
Copy Markdown

라이선스 동의

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

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

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

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

관련 이슈 번호

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

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

PR 종류

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

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

PR 설명

이 PR로 무엇이 달라지는지 대략적으로 알려주세요.
intermediate_source/reinforcement_ppo.py 문서를 번역하였습니다.

@ehdtjr
Copy link
Copy Markdown

ehdtjr commented May 20, 2026

번역하시느라 고생 많으셨습니다!
아래는 제가 파악해본 수정사항인데, 참고해주시면 좋을듯합니다.

48 row : 근접성 제약(proximality constraint)를 -> 근접성 제약(proximality constraint)을
92 row : 필수적인정책 -> 필수적인 정책
343 row : Tahn-Normal -> Tanh-Normal
418, 470, 497, 549, 551, 666 row -> 훈련 -> 학습 / (용어 사용 규칙 참고)

# the better.
# 데이터를 수집할 때 ``frames_per_batch`` 매개변수를 정의해 각 배치의 크기를
# 결정할 수 있습니다. 사용할 수 있는 프레임 수(시뮬레이터와 상호작용하는 횟수 등) 또한 정의합니다.
# 일반적으로 강화학습 알고리즘의 목표는 환경 상호작용동안 최대한 빠르게is to learn to solve the task
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

영문이 삭제되지 않고 남아 있습니다.
환경 상호작용동안 최대한 빠르게is to learn to solve the task환경과의 상호작용 측면에서 최대한 빠르게 문제를 해결하도록 학습하는 것입니다.

- How to compute the advantage signal for policy gradient methods;
- How to create a stochastic policy using a probabilistic neural network;
- How to create a dynamic replay buffer and sample from it without repetition.
- 정책 변화도(policy gradient) 메서드에서 advatage 신호를 계산하는 방법
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

오타: advatageadvantage

# thing we need to care about is to build a neural network that outputs the
# right number of parameters for the policy to work with (a location, or mean,
# and a scale):
# 데이터가 연속적(continuous)이므로, 우리는 액션 공간의 경계를 준수하기 위해 Tahn-Normal 분포를
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

오타: Tahn-NormalTanh-Normal

# 3. Next, we will design the policy network and the value model,
# which is indispensable to the loss function. These modules will be used
# to configure our loss module.
# 3. 이후 손실 함수에 필수적인정책 네트워크와 가치 모델(value model)을 설계합니다.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

띄어쓰기: 필수적인정책필수적인 정책

# 이 모듈은 손실 모듈을 구성하는 데 사용될 것입니다.
#
# 4. Next, we will create the replay buffer and data loader.
# 4. 다음으로 응답 버퍼와 데이터 로더를 생성합니다.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

483번 줄인 '리플레이 버퍼(Replay buffer)'로 통일하셔서, 여기서도 "리플레이 버퍼"로 통일하면 좋을 것 같습니다!

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

수정 완료하였습니다. 감사합니다!

@ptesogno
Copy link
Copy Markdown
Author

번역하시느라 고생 많으셨습니다! 아래는 제가 파악해본 수정사항인데, 참고해주시면 좋을듯합니다.

48 row : 근접성 제약(proximality constraint)를 -> 근접성 제약(proximality constraint)을 92 row : 필수적인정책 -> 필수적인 정책 343 row : Tahn-Normal -> Tanh-Normal 418, 470, 497, 549, 551, 666 row -> 훈련 -> 학습 / (용어 사용 규칙 참고)

수정 완료하였습니다. 감사합니다!

Copy link
Copy Markdown
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.

긴 문서 번역하느라 수고하셨습니다.
몇가지 수정사항을 제안하니 확인 부탁드립니다

# 1. 일정 단계동안 환경 내에서 정책을 이용해 데이터를 샘플링합니다.
# 2. 수집한 batch 데이터의 무작위 부표본(sub-sample)에서 clipped REINFORCE loss를 사용해
# 주어진 횟수만큼 최적화 단계를 수행합니다.
# 3. 클리핑(clipping)은 손실에 회의적 제한을 두어 비교적 낮은 추정값을
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

손실에 보수적인 제한을 두어 정도로 순화해보면 어떨까요

# what a module reads and writes and care less about the specific data
# description and more about the algorithm itself.
# 이 튜토리얼 전반에서 :mod:`tensordict` 라이브러리를 사용합니다.
# :class:`~tensordict.TensorDict` 는 TorchRL의 매개어입니다.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

매개어도 맥락에 맞긴하지만
TensorDict는 TorchRL의 공통 인터페이스 역할을 합니다. 정도로 순화해보는건 어떨까요?

#
frames_per_batch = 1000
# For a complete training, bring the number of frames up to 1M
# 온전한 학습을 위해 100만까지 프레임 수를 늘리세요.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

여기서는 완전한 학습을 위해 이 더 자연스러울거 같습니다

# 매번 중첩된 학습 루프 안에서 방금 획득한 전체 데이터를 소비합니다.
# 여기서 ``sub_batch_size``는 위의 ``frames_per_batch``와 다릅니다.
# 수집기(collector)로부터 수집되고 ``frames_per_batch``에 의해 크기가 정의된 "데이터 배치"를 가지고 작업하며,
# 내부 학습 루프 동안 이를 더 작은 서브 배치(sub-batche)로 세분화한다는 점을 기억하세요.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

batche는 오타인거 같습니다

# of transforms it contains.
# 우리는 정책을 위한 데이터를 준비하기 위해 몇 가지 변환(transforms)을 환경에 추가할 것입니다.
# Gym에서는 주로 래퍼(wrappers)를 통해 이를 달성합니다. TorchRL은 변환의 사용을 통해, 다른
# pytorch 도메인 라이브러리들과 더 유사한 색다른 접근 방식을 취합니다.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

색다른이면 뭔가 더 많이 달라야 자연스러울것 같습니다.
다른 접근 방식을 취합니다 정도가 어떨까요

# tensor로 구성될 수 있음을 의미합니다. 전체 관측치 세트가 출력 :class:`~tensordict.TensorDict`에
# 자동으로 패킹되므로 이는 TorchRL에서 문제가 되지 않습니다. 지정된 스텝 수 동안
# 롤아웃(예를 들어, 일련의 환경 스텝 및 무작위 액션 생성)을 실행한 후, 우리는 이
# 궤적(trajectory) 길이와 일치하는 형태(shape)를 가진 :class:`~tensordict.TensorDict` 인스턴스를 회수하게 됩니다.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

retrieve는 얻다로도 순화 가능합니다
TensorDict 인스턴스를 얻게 됩니다 는 어떨까요

# structure as the policy, but for simplicity we assign it its own set of
# parameters.
# 가치 네트워크는 추론 시점에는 사용되지 않지만, PPO 알고리즘의 매우 중요한 구성 요소입니다.
# 이 모듈은 관측치를 읽고 이어지는 궤적이 무시된 반환값의 추정치를 반환합니다.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

discount가 무시된다기보다는 깎이거나 줄어들었다는 의미가 아닐까요?


# We're also using a learning rate scheduler. Like the gradient clipping,
# this is a nice-to-have but nothing necessary for PPO to work.
# 우리는 학습률 스케줄러(learning rate scheduler)도 사용하고 있습니다. 변화도 클리핑과 마찬가지로,
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

강조의 의미가 아니면 주어는 넣지 않습니다

# We're also using a learning rate scheduler. Like the gradient clipping,
# this is a nice-to-have but nothing necessary for PPO to work.
# 우리는 학습률 스케줄러(learning rate scheduler)도 사용하고 있습니다. 변화도 클리핑과 마찬가지로,
# 이것은 있으면 좋은 것이지만, PPO가 작동하는 데 필수적인 것은 아닙니다.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

이것의 주어도 빼도 문장이 어색하지 않습니다

# storing and execution backends.
#
# Transforms
# 이 코드에서 몇 가지 주의 깊게 볼 사항이 있습니다. 첫째, 우리는 ``GymEnv``
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

주어는 강조의 의미가 아니면 넣지 않습니다

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.

4 participants