-
Notifications
You must be signed in to change notification settings - Fork 226
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
intermediate/mario_rl_tutorial.html 번역 #430
Conversation
import gym | ||
from gym.spaces import Box | ||
from gym.wrappers import FrameStack | ||
|
||
# NES Emulator for OpenAI Gym | ||
# OpenAI Gym에서의 닌텐도 게임 세팅입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아래쪽 번역이 복붙된 거 같네요.
동사가 없는 구라서 마침표로 된 문장보단 좀 더 깔끔하게 처리 가능하지 않을까 싶기도 합니다.
# OpenAI Gym에서의 닌텐도 게임 세팅입니다. | |
# OpenAI Gym을 위한 NES 에뮬레이터 |
from nes_py.wrappers import JoypadSpace | ||
|
||
# Super Mario environment for OpenAI Gym | ||
# OpenAI Gym에서의 슈퍼 마리오 환경 세팅입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위와 마찬가지로 입니다.
를 떼면 어떨까 싶습니다.
# OpenAI Gym에서의 슈퍼 마리오 환경 세팅입니다. | |
# OpenAI Gym에서의 슈퍼 마리오 환경 세팅 |
# """""""""""""""""" | ||
# | ||
# **Environment** The world that an agent interacts with and learns from. | ||
# **환경(Environment)** : 에이전트가 상호작용하며 스스로 배우는 세계입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
뒤에 불필요한 공백이 들어가 있네요. 아래 문장에도 젤 뒤에 공백이 들어가 있군요.
# | ||
# When Mario makes an action, the environment responds with the changed | ||
# (next) state, reward and other info. | ||
# 마리오 게임에서는, 환경은 튜브, 버섯 그리고 다른 요소들로 구성되어 있습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
약간 더 순화시킬 수도 있을거 같네요.
# 마리오 게임에서는, 환경은 튜브, 버섯 그리고 다른 요소들로 구성되어 있습니다. | |
# 마리오 게임에서 환경은 튜브, 버섯, 그 이외 다른 여러 요소들로 구성되어 있습니다. |
# | ||
# We use **Wrappers** to preprocess environment data before sending it to | ||
# the agent. | ||
# 아래에 설명할 클래스들은 환경 데이터를 에이전트에 보내기 전 미리 전처리 과정을 거칠 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
래퍼가 전처리 과정을 거치진 않고 전처리 과정에 사용할 클래스라서 아래처럼 바꾸면 어떨까 싶네요.
보내기 전 단계에서 전처리 과정에 사용할 래퍼(Wrappers) 입니다.
문장 제일 뒤에 공백도 들어가 있네요.
# ``[1, 240, 256]`` | ||
# ``GrayScaleObservation`` 은 RGB 이미지를 흑백 이미지로 바꾸는 일반적인 래퍼입니다. | ||
# 이렇게 하면 유용한 정보를 잃지 않고 상태의 크기를 줄일 수 있습니다. | ||
# ``GrayScaleObservation`` 를 적용하면 각각 상태의 크기는 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GrayScaleObservation
이 클래스를 사용해서 상태 크기를 줄였다고 명확하게 짚어준게 좋군요.
# information. The n-th frame aggregates rewards accumulated over each | ||
# skipped frame. | ||
# ``SkipFrame`` 은 ``gym.Wrapper`` 으로부터 상속을 받은 사용자 지정 클래스이고, | ||
# ``step()`` 함수를 구현했습니다. 왜냐하면 연속되는 프레임은 큰 차이가 없기 때문에 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
구현했습니다 라고 과거형을 쓰기 보다는 단순하게 구현합니다
정도로 수정하면 어떨까요.
문장 제일 뒤에 공백도 들어가 있군요.
# | ||
# ``ResizeObservation`` downsamples each observation into a square image. | ||
# New size: ``[1, 84, 84]`` | ||
# ``ResizeObservation`` 은 각각의 상태(Observation)를 정사각형 이미지로 다운 샘플링합니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
문장 제일 뒤에 공백이 들어가 있군요.
# skipped frame. | ||
# ``SkipFrame`` 은 ``gym.Wrapper`` 으로부터 상속을 받은 사용자 지정 클래스이고, | ||
# ``step()`` 함수를 구현했습니다. 왜냐하면 연속되는 프레임은 큰 차이가 없기 때문에 | ||
# n개의 중간 프레임을 손실 없이 건너뛸 수 있기 때문입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
정보의 손실이 아예 없는 것이 아니기 때문에 손실이 발생하긴 하지만
많은 정보의 손실은 일어나지 않는다고 적어 주는게 어떨까요.
# n개의 중간 프레임을 손실 없이 건너뛸 수 있기 때문입니다. | |
# n개의 중간 프레임을 큰 정보의 손실 없이 건너뛸 수 있기 때문입니다. |
# ``SkipFrame`` 은 ``gym.Wrapper`` 으로부터 상속을 받은 사용자 지정 클래스이고, | ||
# ``step()`` 함수를 구현했습니다. 왜냐하면 연속되는 프레임은 큰 차이가 없기 때문에 | ||
# n개의 중간 프레임을 손실 없이 건너뛸 수 있기 때문입니다. | ||
# n번째 프레임은 건너뛴 각 프레임에 걸쳐 누적된 포상을 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제일 뒤에 공백이 있군요.
# learning model. This way, we can identify if Mario was landing or | ||
# jumping based on the direction of his movement in the previous several | ||
# frames. | ||
# ``FrameStack`` 은 환경의 연속 프레임을 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제일 뒤에 공백이 있군요.
# frames. | ||
# ``FrameStack`` 은 환경의 연속 프레임을 | ||
# 단일 관찰 지점으로 바꾸어 학습 모델에 제공할 수 있는 래퍼입니다. | ||
# 이렇게 하면 마리오가 착지 중이였는지 또는 점프 중이었는지 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제일 뒤에 공백이 있군요.
# ``FrameStack`` 은 환경의 연속 프레임을 | ||
# 단일 관찰 지점으로 바꾸어 학습 모델에 제공할 수 있는 래퍼입니다. | ||
# 이렇게 하면 마리오가 착지 중이였는지 또는 점프 중이었는지 | ||
# 이전 몇 프레임의 움직임 방향에 따라 확인할 수 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제일 뒤에 공백이 있군요.
super().__init__(env) | ||
self._skip = skip | ||
|
||
def step(self, action): | ||
"""Repeat action, and sum reward""" | ||
"""행동을 반복하고 포상을 합한다.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기만 합한다.
라고 해서 약간 튀는군요.
# the environment responds with a state of this structure. The structure | ||
# is represented by a 3-D array of size ``[4, 84, 84]``. | ||
# 앞서 소개한 래퍼를 환경에 적용한 후, | ||
# 최종 래핑 상태는 아래의 왼쪽 이미지에 표시된 것처럼 4개의 연속되는 그레이스케일 프레임으로 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아래의 왼쪽 이미지? 좀 어색하군요. 왼쪽 아래라는 표현이 자연스럽지 않을까 싶습니다.
앞서 그레이스케일을 흑백으로 옮겼기에 연속된 흑백 프레임으로
정도가 적당하지 않을까 싶네요.
문단의 문장들 뒤에 공백도 포함이 되어 있군요.
# We create a class ``Mario`` to represent our agent in the game. Mario | ||
# should be able to: | ||
# ``Mario`` 라는 클래스를 이 게임의 에이전트로 생성합니다. | ||
# 마리오는 다음과 같은 기능을 할 수 있어야 합니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
문장 제일 뒤에 콜론(:) 이 아니라 마침표를 쓰셨는데, 둘 다 써도 무방할거 같긴 합니다.
pass | ||
|
||
def cache(self, experience): | ||
"""Add the experience to memory""" | ||
"""메모리에 경험을 추가합니다.""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여기 적힌 메모리
라는 것이 무엇인지 정확히 이해를 못하겠군요.
캐시, 리콜에 쓰이는 기억
의 일종으로 쓰인 축적된 경험이라고 이해를 해야 할까요
아니면 단순히 특정 상태를 메모리
에 기록한다 그런 의미로 이해를 해야 되는 걸까요?
# For any given state, an agent can choose to do the most optimal action | ||
# (**exploit**) or a random action (**explore**). | ||
# 주어진 상태에 대해, 에이전트는 최적의 행동을 이용할 것인지 | ||
# 임의의 행동을 선택하여 분석할 것인지 선택할 수 있습니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
exploit과 explore를 별도의 괄호 등을 쓰지 않고 무난하게 잘 번역한 것 같습니다.
원문 단어 두 개를 번역문에 넣지 않고도 이해가 되네요.
Outputs: | ||
action_idx (int): An integer representing which action Mario will perform | ||
입력값: | ||
상태(LazyFrame): 현재 상태에서의 단일 상태(observation)값을 말합니다. 차원은 (state_dim)입니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
입력 파라미터 state
와 리턴 변수명 action_idx
관련하여 설명하는 주석이라
이 두개는 원문 유지해야되지 않을까 싶군요.
""" | ||
# EXPLORE | ||
# 임의의 행동을 선택하기 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
위에서 한 의역과 마찬가지로 잘 풀어서 번역한 것 같습니다.
# and whether the game is *done*. | ||
# ``cache()``: 마리오가 행동을 할 때마다, 그는 | ||
# ``경험`` 을 그의 메모리에 저장합니다. 그의 경험에는 현재 *상태* 에 따른 수행된 | ||
# *행동* , 행동으로 부터 얻은 *포상* , *다음 상태*, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
행동으로부터
라고 띄어쓰기를 사용해야 되지 않을까 싶습니다.
reward (float), | ||
done(bool)) | ||
입력값: | ||
상태 (LazyFrame), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
이 부분도 변수명은 원문을 유지해야 되지 않을까 싶습니다.
# :math:`Q_{target}` ) 을 사용하고, 독립적으로 최적의 행동-가치 함수에 | ||
# 근사 시키려고 합니다. | ||
# | ||
# 구현을 할 때,특징 생성기에서 :math:`Q_{online}` 와 :math:`Q_{target}` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
쉼표 뒤에 띄어쓰기가 있으면 어떨까 싶습니다. 윗 문단의 마지막에 공백이 들어간 문장도 보이는군요.
# 근사 시키려고 합니다. | ||
# | ||
# 구현을 할 때,특징 생성기에서 :math:`Q_{online}` 와 :math:`Q_{target}` | ||
# ``특징들`` 을 공유합니다. 그러나 각각의 FC 분류기는 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
문장이 좀 헷갈리네요. 아래와 같이 약간 다듬어 봤는데 아직 잘 모르겠습니다. 좀 더 좋은 문장은 없을까 싶네요.
특징 생성기 특징들
을 :math:Q_{online}
와 :math:Q_{target}
양쪽에 공유합니다.
# **TD Target** - aggregation of current reward and the estimated | ||
# :math:`Q^*` in the next state :math:`s'` | ||
# **TD 목표** - 현재의 포상과 다음 상태 :math:`s'` 에서 추정된 :math:`Q^*` 의 합. | ||
# |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
공백이 들어간 곳이 너무 많군요 ㅠㅠ
@@ -510,22 +508,22 @@ def td_target(self, reward, next_state, done): | |||
|
|||
|
|||
###################################################################### | |||
# Updating the model | |||
# 모델을 업데이트 합니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
제목처럼 간략하게 적어도 좋지 않을까 싶군요.
# 모델을 업데이트 합니다. | |
# 모델을 업데이트하기 |
# and :math:`TD_e` and backpropagate this loss down :math:`Q_{online}` to | ||
# update its parameters :math:`\theta_{online}` (:math:`\alpha` is the | ||
# learning rate ``lr`` passed to the ``optimizer``) | ||
# 마리오가 재생 버퍼에서 입력을 샘플링할 때, :math:`TD_t` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
그냥 리플레이라고 적어주는 것이 뜻이 더 잘 사는 것이 아닌가 싶기도 하네요.
@@ -553,8 +551,8 @@ def sync_Q_target(self): | |||
|
|||
|
|||
###################################################################### | |||
# Save checkpoint | |||
# ~~~~~~~~~~~~~~~~~~ | |||
# 체크포인트를 저장합니다. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
554, 552번째 줄도 모두 제목처럼 ~하기 로 문장 끝을 마무리하면 어떨까 싶네요.
바쁘신데 번역하시느라 고생하셨습니다. |
@des00 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
라이선스 동의
변경해주시는 내용에 BSD 3항 라이선스가 적용됨을 동의해주셔야 합니다.
더 자세한 내용은 기여하기 문서를 참고해주세요.
동의하시면 아래
[ ]
를[x]
로 만들어주세요.관련 이슈 번호
이 Pull Request와 관련있는 이슈 번호를 적어주세요.
이슈 또는 PR 번호 앞에 #을 붙이시면 제목을 바로 확인하실 수 있습니다. (예. #999 )
PR 종류
이 PR에 해당되는 종류 앞의
[ ]
을[x]
로 변경해주세요.PR 설명
이 PR로 무엇이 달라지는지 대략적으로 알려주세요.
intermediate/mario_rl_tutorial.html을 번역하였습니다.