Skip to content

Commit 05dd51c

Browse files
authored
starter/ 내 문서 번역 (#6) (#8)
* starter/installation 번역 (#6) * starter/converting 번역 (#6) * starter/style_guide 번역 (#6) * starter/style_guide 리뷰 반영 (#6) * starter/lightning_lite 번역 (#6)
1 parent 9b03ea3 commit 05dd51c

File tree

4 files changed

+333
-335
lines changed

4 files changed

+333
-335
lines changed

source/starter/converting.rst

Lines changed: 40 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
.. _converting:
22

33
######################################
4-
How to Organize PyTorch Into Lightning
4+
PyTorch를 Lightning으로 구성하기
55
######################################
66

7-
To enable your code to work with Lightning, perform the following to organize PyTorch into Lightning.
7+
아래와 같이 PyTorch를 Lightning(라이트닝)으로 구성할 수 있습니다.
88

99
--------
1010

1111
******************************
12-
1. Keep you Computational Code
12+
1. 연산 코드 가져오기
1313
******************************
1414

15-
Keep your regular nn.Module architecture
15+
일반적인 nn.Module 구조를 가져옵니다
1616

1717
.. testcode::
1818

@@ -38,9 +38,9 @@ Keep your regular nn.Module architecture
3838
--------
3939

4040
***************************
41-
2. Configure Training Logic
41+
2. 학습 로직 구성하기
4242
***************************
43-
In the training_step of the LightningModule configure how your training routine behaves with a batch of training data:
43+
LightningModule의 training_step에 학습 데이터를 묶음(batch)으로 가져와 학습하는 과정을 구성합니다:
4444

4545
.. testcode::
4646

@@ -55,14 +55,14 @@ In the training_step of the LightningModule configure how your training routine
5555
loss = F.cross_entropy(y_hat, y)
5656
return loss
5757

58-
.. note:: If you need to fully own the training loop for complicated legacy projects, check out :doc:`Own your loop <../model/own_your_loop>`.
58+
.. note:: 기존 프로젝트가 복잡해서 기존의 학습 루프를 직접 구성해야 하면 :doc:`Own your loop <../model/own_your_loop>` 를 참조하세요.
5959

6060
----
6161

6262
****************************************
63-
3. Move Optimizer(s) and LR Scheduler(s)
63+
3. 옵티마이저와 LR스케줄러 이동하기
6464
****************************************
65-
Move your optimizers to the :meth:`~pytorch_lightning.core.lightning.LightningModule.configure_optimizers` hook.
65+
옵티마이저(들)를 :meth:`~pytorch_lightning.core.lightning.LightningModule.configure_optimizers` 훅(hook)으로 이동합니다.
6666

6767
.. testcode::
6868

@@ -75,9 +75,9 @@ Move your optimizers to the :meth:`~pytorch_lightning.core.lightning.LightningMo
7575
--------
7676

7777
***************************************
78-
4. Organize Validation Logic (optional)
78+
4. (선택사항) 검증 로직 구성하기
7979
***************************************
80-
If you need a validation loop, configure how your validation routine behaves with a batch of validation data:
80+
검증(validation) 루프가 필요하면, 검증 데이터를 묶음(batch)으로 가져와 검증하는 과정을 구성합니다:
8181

8282
.. testcode::
8383

@@ -88,14 +88,14 @@ If you need a validation loop, configure how your validation routine behaves wit
8888
val_loss = F.cross_entropy(y_hat, y)
8989
self.log("val_loss", val_loss)
9090

91-
.. tip:: ``trainer.validate()`` loads the best checkpoint automatically by default if checkpointing was enabled during fitting.
91+
.. tip:: 학습(fit) 중 체크포인트 기능이 켜진 경우 ``trainer.validate()`` 가 자동으로 최적의 체크포인트를 불러옵니다.
9292

9393
--------
9494

9595
************************************
96-
5. Organize Testing Logic (optional)
96+
5. (선택사항) 테스트 로직 구성하기
9797
************************************
98-
If you need a test loop, configure how your testing routine behaves with a batch of test data:
98+
테스트(test) 루프가 필요하면, 테스트 데이터를 묶음(batch)으로 가져와 테스트하는 과정을 구성합니다:
9999

100100
.. testcode::
101101

@@ -109,9 +109,9 @@ If you need a test loop, configure how your testing routine behaves with a batch
109109
--------
110110

111111
****************************************
112-
6. Configure Prediction Logic (optional)
112+
6. (선택사항) 예측 로직 구성하기
113113
****************************************
114-
If you need a prediction loop, configure how your prediction routine behaves with a batch of test data:
114+
예측(prediction) 루프가 필요하면, 테스트 데이터를 묶음(batch)으로 가져와 예측하는 과정을 구성합니다:
115115

116116
.. testcode::
117117

@@ -124,14 +124,16 @@ If you need a prediction loop, configure how your prediction routine behaves wit
124124
--------
125125

126126
******************************************
127-
7. Remove any .cuda() or .to(device) Calls
127+
7. .cuda() 또는 .to(device) 호출 제거하기
128128
******************************************
129129

130-
Your :doc:`LightningModule <../common/lightning_module>` can automatically run on any hardware!
130+
:doc:`LightningModule <../common/lightning_module>` 은 어떠한 하드웨어에서도 자동으로 실행됩니다!
131131

132-
If you have any explicit calls to ``.cuda()`` or ``.to(device)``, you can remove them since Lightning makes sure that the data coming from :class:`~torch.utils.data.DataLoader`
133-
and all the :class:`~torch.nn.Module` instances initialized inside ``LightningModule.__init__`` are moved to the respective devices automatically.
134-
If you still need to access the current device, you can use ``self.device`` anywhere in your ``LightningModule`` except in the ``__init__`` and ``setup`` methods.
132+
``LightningModule.__init__`` 내에서 초기화된 :class:`~torch.nn.Module` 인스턴스들과 :class:`~torch.utils.data.DataLoader` 에서 가져온 데이터는
133+
Lightning이 자동으로 해당 장치로 이동해서 실행하므로, 기존에 명시적으로 ``.cuda()`` 또는 ``.to(device)`` 을 호출하는 부분은 제거해도 됩니다.
134+
135+
그럼에도 장치(device)에 직접 접근해야 할 필요가 있다면, ``LightningModule`` 내부에서 (``__init__`` 과 ``setup`` 메소드를 제외하고) 아무데서나
136+
``self.device`` 를 사용하면 됩니다.
135137

136138
.. testcode::
137139

@@ -140,8 +142,8 @@ If you still need to access the current device, you can use ``self.device`` anyw
140142
z = torch.randn(4, 5, device=self.device)
141143
...
142144

143-
Hint: If you are initializing a :class:`~torch.Tensor` within the ``LightningModule.__init__`` method and want it to be moved to the device automatically you should call
144-
:meth:`~torch.nn.Module.register_buffer` to register it as a parameter.
145+
Hint: ``LightningModule.__init__`` 메소드 내에서 :class:`~torch.Tensor` 를 초기화하면서 자동으로 장치(device)로 이동하려면
146+
:meth:`~torch.nn.Module.register_buffer` 를 호출하여 매개변수로 등록하면 됩니다.
145147

146148
.. testcode::
147149

@@ -152,46 +154,48 @@ Hint: If you are initializing a :class:`~torch.Tensor` within the ``LightningMod
152154

153155
--------
154156

155-
********************
156-
8. Use your own data
157-
********************
158-
Regular PyTorch DataLoaders work with Lightning. For more modular and scalable datasets, check out :doc:`LightningDataModule <../data/datamodule>`.
157+
*************************
158+
8. 기존 데이터 사용하기
159+
*************************
160+
일반적인 PyTorch DataLoader는 Lightning에서 동작합니다. 더 모듈화되고 확장 가능한 데이터셋들은 :doc:`LightningDataModule <../data/datamodule>` 를
161+
참고하세요.
159162

160163
----
161164

162165
************
163-
Good to know
166+
더 알아두기
164167
************
165168

166-
Additionally, you can run only the validation loop using :meth:`~pytorch_lightning.trainer.trainer.Trainer.validate` method.
169+
추가로, :meth:`~pytorch_lightning.trainer.trainer.Trainer.validate` 메소드를 사용하면 검증(validation) 루프만 실행할 수 있습니다.
167170

168171
.. code-block:: python
169172
170173
model = LitModel()
171174
trainer.validate(model)
172175
173-
.. note:: ``model.eval()`` and ``torch.no_grad()`` are called automatically for validation.
176+
.. note:: ``model.eval()`` ``torch.no_grad()`` 는 검증 시에 자동으로 호출됩니다.
174177

175178

176-
The test loop isn't used within :meth:`~pytorch_lightning.trainer.trainer.Trainer.fit`, therefore, you would need to explicitly call :meth:`~pytorch_lightning.trainer.trainer.Trainer.test`.
179+
테스트 루프(test loop)는 :meth:`~pytorch_lightning.trainer.trainer.Trainer.fit` 에서 사용되지 않으므로, 필요 시 명시적으로
180+
:meth:`~pytorch_lightning.trainer.trainer.Trainer.test` 을 호출해야 합니다.
177181

178182
.. code-block:: python
179183
180184
model = LitModel()
181185
trainer.test(model)
182186
183-
.. note:: ``model.eval()`` and ``torch.no_grad()`` are called automatically for testing.
187+
.. note:: ``model.eval()`` ``torch.no_grad()`` 는 테스트 시에 자동으로 호출됩니다.
184188

185-
.. tip:: ``trainer.test()`` loads the best checkpoint automatically by default if checkpointing is enabled.
189+
.. tip:: 체크포인트 기능이 켜진 경우, ``trainer.test()`` 는 자동으로 최적의 체크포인트(best checkpoint)를 불러옵니다.
186190

187191

188-
The predict loop will not be used until you call :meth:`~pytorch_lightning.trainer.trainer.Trainer.predict`.
192+
예측 루프(prediction look)는 :meth:`~pytorch_lightning.trainer.trainer.Trainer.predict` 을 호출하기 전에는 사용되지 않습니다.
189193

190194
.. code-block:: python
191195
192196
model = LitModel()
193197
trainer.predict(model)
194198
195-
.. note:: ``model.eval()`` and ``torch.no_grad()`` are called automatically for testing.
199+
.. note:: ``model.eval()`` ``torch.no_grad()`` 는 예측 시에 자동으로 호출됩니다.
196200

197-
.. tip:: ``trainer.predict()`` loads the best checkpoint automatically by default if checkpointing is enabled.
201+
.. tip:: 체크포인트 기능이 켜진 경우, ``trainer.predict()`` 는 자동으로 최적의 체크포인트를 불러옵니다.

source/starter/installation.rst

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
.. _installation:
44

55
############
6-
Installation
6+
설치하기
77
############
88

99
--------------
1010

1111
*********************
12-
Installation with pip
12+
pip를 사용하여 설치
1313
*********************
1414

15-
Install any supported version of PyTorch if you want from `PyTorch Installation Page <https://pytorch.org/get-started/locally/#start-locally>`_.
16-
Now you can install using `pip <https://pypi.org/project/pytorch-lightning/>`_ using the following command:
15+
`파이토치(PyTorch) 설치하기 페이지 <https://pytorch.kr/get-started/locally/#start-locally>` _ 에서 PyTorch를 설치한 뒤,
16+
아래 명령어로 `pip <https://pypi.org/project/pytorch-lightning/>`_ 를 사용하여 설치할 수 있습니다:
1717

1818
.. code-block:: bash
1919
@@ -22,17 +22,17 @@ Now you can install using `pip <https://pypi.org/project/pytorch-lightning/>`_ u
2222
--------------
2323

2424
***********************
25-
Installation with Conda
25+
Conda를 사용하여 설치
2626
***********************
2727

28-
If you don't have conda installed, follow the `Conda Installation Guide <https://docs.conda.io/projects/conda/en/latest/user-guide/install>`_.
29-
Lightning can be installed with `conda <https://anaconda.org/conda-forge/pytorch-lightning>`_ using the following command:
28+
만약 conda를 아직 설치하지 않았다면, `Conda 설치 가이드 <https://docs.conda.io/projects/conda/en/latest/user-guide/install>`_ 를 참고하세요.
29+
Lightning은 아래 명령어로 `conda <https://anaconda.org/conda-forge/pytorch-lightning>`_ 를 사용하여 설치할 수 있습니다:
3030

3131
.. code-block:: bash
3232
3333
conda install pytorch-lightning -c conda-forge
3434
35-
You can also use `Conda Environments <https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>`_:
35+
`Conda 가상환경(Environments) <https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html>`_ 을 사용할 수도 있습니다:
3636

3737
.. code-block:: bash
3838
@@ -42,31 +42,32 @@ You can also use `Conda Environments <https://docs.conda.io/projects/conda/en/la
4242
--------------
4343

4444
************************
45-
Installation from Source
45+
소스 코드로 설치
4646
************************
4747

48-
Install nightly from the source. Note that it contains all the bug fixes and newly released features that
49-
are not published yet. This is the bleeding edge, so use it at your own discretion.
48+
소스 코드로 최신 버전(nightly)을 설치합니다. 아직 배포되지 않은 버그 수정(bug fix)과 새롭게 출시할 기능들이
49+
포함되어 있습니다. 미검증·불안정 최신 기능(bleeding edge)이므로, 신중하게 사용하세요.
5050

5151
.. code-block:: bash
5252
5353
pip install https://github.com/PyTorchLightning/pytorch-lightning/archive/master.zip
5454
55-
Install future patch releases from the source. Note that the patch release contains only the bug fixes for the recent major release.
55+
향후 공개될 개선 버전(patch release)를 소스 코드로부터 설치합니다. 개선 버전은 가장 최근의 주요 버전(major release)에 대한 버그 수정만
56+
포함되어 있습니다.
5657

5758
.. code-block:: bash
5859
5960
pip install https://github.com/PyTorchLightning/pytorch-lightning/archive/refs/heads/release/1.5.x.zip
6061
6162
--------------
6263

63-
******************
64-
Lightning Coverage
65-
******************
64+
************************************
65+
Lightning 커버리지(Coverage)
66+
************************************
6667

67-
PyTorch Lightning is maintained and tested on different Python and PyTorch versions.
68+
파이토치 라이트닝(PyTorch Lightning)은 다양한 Python과 PyTorch 버전에서 유지 보수 및 테스트되고 있습니다.
6869

69-
Check out the `CI Coverage <https://github.com/PyTorchLightning/pytorch-lightning#continuous-integration>`_ for more info.
70+
더 자세한 정보는 `CI Coverage <https://github.com/PyTorchLightning/pytorch-lightning#continuous-integration>`_ 를 참고하세요.
7071

71-
It is rigorously tested across multiple GPUs, TPUs, CPUs and IPUs. GPU tests run on two NVIDIA P100. TPU tests run on Google GKE TPUv2/3.
72-
TPU py3.7 means we support Colab and Kaggle env. IPU tests run on MK1 IPU boxes.
72+
다양한 GPU와 TPU, CPU, IPU에서 엄격하게 테스트되었습니다. GPU 테스트는 2개의 NVIDIA P100에서 실행됩니다. TPU 테스트는 Google GKE TPUv2/3에서
73+
실행됩니다. TPU py3.7은 Colab Kaggle 환경을 지원함을 뜻합니다. IPU 테스트는 MK1 IPU 장비에서 실행됩니다.

0 commit comments

Comments
 (0)