def str_to_step(self, s: str, pretrain: bool = False) -> Step: dataset_hparams = self.pretrain_dataset_hparams if pretrain else self.dataset_hparams iterations_per_epoch = datasets_registry.iterations_per_epoch( dataset_hparams) return Step.from_str(s, iterations_per_epoch)
def end_step(self): iterations_per_epoch = datasets_registry.iterations_per_epoch(self.dataset_hparams) return Step.from_str(self.training_hparams.training_steps, iterations_per_epoch)
def test_iterations_per_epoch(self): self.assertEqual(registry.iterations_per_epoch(self.dataset_hparams), 1000) self.dataset_hparams.subsample_fraction = 0.1 self.assertEqual(registry.iterations_per_epoch(self.dataset_hparams), 100)
def str_to_step(self, s: str) -> Step: return Step.from_str(s, datasets_registry.iterations_per_epoch(self.dataset_hparams))