Skip to content

Commit c02cf48

Browse files
JwaminjuboyunJangstevhliu
authored
🌐 [i18n-KO] Translated main_classes/callback.md to Korean (#33572)
* docs: ko: callback.md * feat: nmt draft & manual edits * fix: resolve suggestions * Update docs/source/ko/main_classes/callback.md * Apply suggestions from code review * Apply suggestions from code review 확인했습니다! 상세한 리뷰 정말 감사합니다! Co-authored-by: boyunJang <gobook1234@naver.com> * Update _toctree.yml Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com> --------- Co-authored-by: boyunJang <gobook1234@naver.com> Co-authored-by: Steven Liu <59462357+stevhliu@users.noreply.github.com>
1 parent 0354d44 commit c02cf48

File tree

2 files changed

+135
-2
lines changed

2 files changed

+135
-2
lines changed

docs/source/ko/_toctree.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,8 +276,8 @@
276276
title: 자동 클래스
277277
- local: in_translation
278278
title: (번역중) Backbones
279-
- local: in_translation
280-
title: (번역중) Callbacks
279+
- local: main_classes/callback
280+
title: 콜백
281281
- local: main_classes/configuration
282282
title: 구성
283283
- local: main_classes/data_collator
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
<!--Copyright 2020 The HuggingFace Team. All rights reserved.
2+
3+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
4+
the License. You may obtain a copy of the License at
5+
6+
http://www.apache.org/licenses/LICENSE-2.0
7+
8+
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
9+
an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
10+
specific language governing permissions and limitations under the License.
11+
12+
⚠️ Note that this file is in Markdown but contain specific syntax for our doc-builder (similar to MDX) that may not be
13+
rendered properly in your Markdown viewer.
14+
15+
-->
16+
17+
# 콜백 [[callbacks]]
18+
19+
콜백은 PyTorch [`Trainer`]의 반복 학습 동작을 사용자 정의할 수 있는 객체입니다
20+
(이 기능은 TensorFlow에서는 아직 구현되지 않았습니다). 콜백은 반복 학습의 상태를
21+
검사하여 (진행 상황 보고, TensorBoard 또는 기타 머신 러닝 플랫폼에 로그 남기기 등)
22+
결정(예: 조기 종료)을 내릴 수 있습니다.
23+
24+
콜백은 [`TrainerControl`] 객체를 반환하는 것 외에는 반복 학습에서 어떤 것도 변경할 수 없는
25+
"읽기 전용" 코드 조각입니다. 반복 학습에 변경이 필요한 사용자 정의 작업이 필요한 경우,
26+
[`Trainer`]를 서브클래스로 만들어 필요한 메소드들을 오버라이드해야 합니다 (예시는 [trainer](trainer)를 참조하세요).
27+
28+
기본적으로 `TrainingArguments.report_to``"all"`로 설정되어 있으므로, [`Trainer`]는 다음 콜백을 사용합니다.
29+
30+
- [`DefaultFlowCallback`]는 로그, 저장, 평가에 대한 기본 동작을 처리합니다.
31+
- [`PrinterCallback`] 또는 [`ProgressCallback`]는 진행 상황을 표시하고 로그를 출력합니다
32+
([`TrainingArguments`]를 통해 tqdm을 비활성화하면 첫 번째 콜백이 사용되고, 그렇지 않으면 두 번째가 사용됩니다).
33+
- [`~integrations.TensorBoardCallback`]는 TensorBoard가 (PyTorch >= 1.4
34+
또는 tensorboardX를 통해) 접근 가능하면 사용됩니다.
35+
- [`~integrations.WandbCallback`][wandb](https://www.wandb.com/)가 설치되어 있으면
36+
사용됩니다.
37+
- [`~integrations.CometCallback`][comet_ml](https://www.comet.com/site/)이 설치되어 있으면 사용됩니다.
38+
- [`~integrations.MLflowCallback`][mlflow](https://www.mlflow.org/)가 설치되어 있으면 사용됩니다.
39+
- [`~integrations.NeptuneCallback`][neptune](https://neptune.ai/)이 설치되어 있으면 사용됩니다.
40+
- [`~integrations.AzureMLCallback`][azureml-sdk](https://pypi.org/project/azureml-sdk/)가 설치되어
41+
있으면 사용됩니다.
42+
- [`~integrations.CodeCarbonCallback`][codecarbon](https://pypi.org/project/codecarbon/)이 설치되어
43+
있으면 사용됩니다.
44+
- [`~integrations.ClearMLCallback`][clearml](https://github.com/allegroai/clearml)이 설치되어 있으면 사용됩니다.
45+
- [`~integrations.DagsHubCallback`][dagshub](https://dagshub.com/)이 설치되어 있으면 사용됩니다.
46+
- [`~integrations.FlyteCallback`][flyte](https://flyte.org/)가 설치되어 있으면 사용됩니다.
47+
- [`~integrations.DVCLiveCallback`][dvclive](https://dvc.org/doc/dvclive)가 설치되어 있으면 사용됩니다.
48+
49+
패키지가 설치되어 있지만 해당 통합 기능을 사용하고 싶지 않다면, `TrainingArguments.report_to`를 사용하고자 하는 통합 기능 목록으로 변경할 수 있습니다 (예: `["azure_ml", "wandb"]`).
50+
51+
콜백을 구현하는 주요 클래스는 [`TrainerCallback`]입니다. 이 클래스는 [`Trainer`]
52+
인스턴스화하는 데 사용된 [`TrainingArguments`]를 가져오고, 해당 Trainer의 내부 상태를
53+
[`TrainerState`]를 통해 접근할 수 있으며, [`TrainerControl`]을 통해 반복 학습에서 일부
54+
작업을 수행할 수 있습니다.
55+
56+
57+
## 사용 가능한 콜백 [[available-callbacks]]
58+
59+
라이브러리에서 사용 가능한 [`TrainerCallback`] 목록은 다음과 같습니다:
60+
61+
[[autodoc]] integrations.CometCallback
62+
- setup
63+
64+
[[autodoc]] DefaultFlowCallback
65+
66+
[[autodoc]] PrinterCallback
67+
68+
[[autodoc]] ProgressCallback
69+
70+
[[autodoc]] EarlyStoppingCallback
71+
72+
[[autodoc]] integrations.TensorBoardCallback
73+
74+
[[autodoc]] integrations.WandbCallback
75+
- setup
76+
77+
[[autodoc]] integrations.MLflowCallback
78+
- setup
79+
80+
[[autodoc]] integrations.AzureMLCallback
81+
82+
[[autodoc]] integrations.CodeCarbonCallback
83+
84+
[[autodoc]] integrations.NeptuneCallback
85+
86+
[[autodoc]] integrations.ClearMLCallback
87+
88+
[[autodoc]] integrations.DagsHubCallback
89+
90+
[[autodoc]] integrations.FlyteCallback
91+
92+
[[autodoc]] integrations.DVCLiveCallback
93+
- setup
94+
95+
## TrainerCallback [[trainercallback]]
96+
97+
[[autodoc]] TrainerCallback
98+
99+
여기 PyTorch [`Trainer`]와 함께 사용자 정의 콜백을 등록하는 예시가 있습니다:
100+
101+
```python
102+
class MyCallback(TrainerCallback):
103+
"A callback that prints a message at the beginning of training"
104+
105+
def on_train_begin(self, args, state, control, **kwargs):
106+
print("Starting training")
107+
108+
109+
trainer = Trainer(
110+
model,
111+
args,
112+
train_dataset=train_dataset,
113+
eval_dataset=eval_dataset,
114+
callbacks=[MyCallback], # 우리는 콜백 클래스를 이 방식으로 전달하거나 그것의 인스턴스(MyCallback())를 전달할 수 있습니다
115+
)
116+
```
117+
118+
또 다른 콜백을 등록하는 방법은 `trainer.add_callback()`을 호출하는 것입니다:
119+
120+
```python
121+
trainer = Trainer(...)
122+
trainer.add_callback(MyCallback)
123+
# 다른 방법으로는 콜백 클래스의 인스턴스를 전달할 수 있습니다
124+
trainer.add_callback(MyCallback())
125+
```
126+
127+
## TrainerState [[trainerstate]]
128+
129+
[[autodoc]] TrainerState
130+
131+
## TrainerControl [[trainercontrol]]
132+
133+
[[autodoc]] TrainerControl

0 commit comments

Comments
 (0)