Skip to content
Snippets Groups Projects
Unverified Commit 6a749bed authored by Nolan's avatar Nolan Committed by Yoann Schneider
Browse files

Rename apply_teacher_forcing to add_label_noise in training code

parent befbd8a8
No related branches found
No related tags found
No related merge requests found
......@@ -1089,7 +1089,7 @@ class Manager(OCRManager):
info_dict["curriculum_config"] = self.dataset.train_dataset.curriculum_config
return info_dict
def apply_teacher_forcing(self, y, y_len, error_rate):
def add_label_noise(self, y, y_len, error_rate):
y_error = y.clone()
for b in range(len(y_len)):
for i in range(1, y_len[b]):
......@@ -1115,7 +1115,7 @@ class Manager(OCRManager):
and self.params["training_params"]["teacher_forcing_error_rate"] is not None
):
error_rate = self.params["training_params"]["teacher_forcing_error_rate"]
simulated_y_pred, y_len = self.apply_teacher_forcing(y, y_len, error_rate)
simulated_y_pred, y_len = self.add_label_noise(y, y_len, error_rate)
elif "teacher_forcing_scheduler" in self.params["training_params"]:
error_rate = (
self.params["training_params"]["teacher_forcing_scheduler"][
......@@ -1139,7 +1139,7 @@ class Manager(OCRManager):
"total_num_steps"
]
)
simulated_y_pred, y_len = self.apply_teacher_forcing(y, y_len, error_rate)
simulated_y_pred, y_len = self.add_label_noise(y, y_len, error_rate)
else:
simulated_y_pred = y
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment