Train
vims.Trainer
vims 모델을 학습시키기 위한 Trainer class 입니다.
Usage
demo/train.py 참고
build(config, data)
classmethod
Trainer class의 instance를 생성합니다.
Parameters:
Returns:
| Name | Type | Description |
|---|---|---|
Trainer |
Trainer
|
build가 완료된 detection.Trainer class의 instance를 반환합니다. |
to_device(device)
Trainer의 device를 변경합니다. (cpu/gpu)
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
device |
Union[device, str, int]
|
변경하고자 하는 device 입니다.
|
required |
Returns:
| Name | Type | Description |
|---|---|---|
None |
None
|
None |
train_one_step()
학습을 1스텝 수행하고, 결과를 반환합니다.
Returns:
process_weight_sampling()
학습 데이터 전체에 대하여 weight sampling을 진행합니다.
Total train step 별 권장 weight sampling 마일스톤은 아래와 같습니다. - train_step 5000 : [1000, 3000] (default) - train_step 8000 : [1000, 3000, 6000] - train_step 10000 : [1000, 4000, 7000]
Returns:
| Type | Description |
|---|---|
None
|
None |
train_adaptive_autoencoder()
Adaptive autoencoder 학습과정 전체를 수행합니다.
save_checkpoint(checkpoint_path, metadata=None, password=None)
현재 Trainer의 상태를 암호화하여 저장합니다.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checkpoint_path |
str
|
checkpoint를 저장할 path 입니다. |
required |
metadata |
Optional[Dict]
|
checkpoint에 저장할 추가 metadata. Defaults to None. |
None
|
password |
Optional[str]
|
checkpoint 파일에서 중요한 정보를 암호화 하는데 사용되는 password 입니다. None이면 암호화하지 않습니다. Defaults to None. |
None
|
Returns: None: None
load_checkpoint(checkpoint_path, password=None)
저장한 checkpoint로부터 Trainer의 상태를 불러오고, metadata를 반환합니다.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
checkpoint_path |
str
|
load할 checkpoint가 저장 되어 있는 path 입니다. |
required |
password |
Optional[str]
|
checkpoint 파일에서 중요한 정보를 복호화 하는데 사용되는 password 입니다. None이면 복호화하지 않습니다. Defaults to None. |
None
|
Returns:
| Name | Type | Description |
|---|---|---|
Dict |
Dict
|
save_checkpoint에서 저장했던 metadata 입니다. |
warm_up()
3개의 clip을 이용하여 warm up을 수행합니다. VAD 학습의 가장 마지막 과정입니다.