MCPcopy Index your code
hub / github.com/MoonInTheRiver/DiffSinger / fit

Method fit

utils/pl_utils.py:477–490  ·  view source on GitHub ↗
(self, model)

Source from the content-addressed store, hash-verified

475 # MODEL TRAINING
476 # -----------------------------
477 def fit(self, model):
478 if self.use_ddp:
479 mp.spawn(self.ddp_train, nprocs=self.num_gpus, args=(model,))
480 else:
481 model.model = model.build_model()
482 if not self.testing:
483 self.optimizers, self.lr_schedulers = self.init_optimizers(model.configure_optimizers())
484 if self.use_dp:
485 model.cuda(self.root_gpu)
486 model = DP(model, device_ids=self.data_parallel_device_ids)
487 elif self.single_gpu:
488 model.cuda(self.root_gpu)
489 self.run_pretrain_routine(model)
490 return 1
491
492 def init_optimizers(self, optimizers):
493

Callers 2

testMethod · 0.95
startMethod · 0.95

Calls 5

init_optimizersMethod · 0.95
run_pretrain_routineMethod · 0.95
DPClass · 0.85
configure_optimizersMethod · 0.80
build_modelMethod · 0.45

Tested by

no test coverage detected