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

Method _training_step

tasks/tts/pe.py:111–115  ·  view source on GitHub ↗
(self, sample, batch_idx, _)

Source from the content-addressed store, hash-verified

109 # def build_scheduler(self, optimizer):
110 # return torch.optim.lr_scheduler.StepLR(optimizer, hparams['decay_steps'], gamma=0.5)
111 def _training_step(self, sample, batch_idx, _):
112 loss_output = self.run_model(self.model, sample)
113 total_loss = sum([v for v in loss_output.values() if isinstance(v, torch.Tensor) and v.requires_grad])
114 loss_output['batch_size'] = sample['mels'].size()[0]
115 return total_loss, loss_output
116
117 def validation_step(self, sample, batch_idx):
118 outputs = {}

Callers

nothing calls this directly

Calls 2

run_modelMethod · 0.95
sizeMethod · 0.80

Tested by

no test coverage detected