(self, cwt_p, cwt_g)
| 269 | return NotImplementedError |
| 270 | |
| 271 | def cwt_loss(self, cwt_p, cwt_g): |
| 272 | if hparams['cwt_loss'] == 'l1': |
| 273 | return F.l1_loss(cwt_p, cwt_g) |
| 274 | if hparams['cwt_loss'] == 'l2': |
| 275 | return F.mse_loss(cwt_p, cwt_g) |
| 276 | if hparams['cwt_loss'] == 'ssim': |
| 277 | return self.ssim_loss(cwt_p, cwt_g, 20) |
| 278 | |
| 279 | def add_energy_loss(self, energy_pred, energy, losses): |
| 280 | nonpadding = (energy != 0).float() |
no test coverage detected