Example #1
0
 def sample(self, batch, outputs, step):
     notes = self._compute_heuristic_notes(outputs)
     outputs['heuristic_notes'] = notes
     summaries.midi_summary(outputs, step, 'heuristic', self._frame_rate,
                            'heuristic_notes')
     summaries.pianoroll_summary(outputs, step, 'heuristic',
                                 self._frame_rate, 'heuristic_notes')
Example #2
0
    def sample(self, batch, outputs, step):
        audio = batch['audio']
        summaries.audio_summary(audio,
                                step,
                                self._sample_rate,
                                name='audio_original')

        audio_keys = [
            'midi_audio', 'synth_audio', 'midi_audio2', 'synth_audio2'
        ]
        for k in audio_keys:
            if k in outputs and outputs[k] is not None:
                summaries.audio_summary(outputs[k],
                                        step,
                                        self._sample_rate,
                                        name=k)
                summaries.spectrogram_summary(audio, outputs[k], step, tag=k)
                summaries.waveform_summary(audio, outputs[k], step, name=k)

        summaries.f0_summary(batch[self._f0_key],
                             outputs[f'{self._f0_key}_pred'],
                             step,
                             name='f0_hz_rec')

        summaries.pianoroll_summary(outputs, step, 'pianoroll',
                                    self._frame_rate, 'pianoroll')
        summaries.midiae_f0_summary(batch[self._f0_key], outputs, step)
        ld_rec = f'{self._db_key}_rec'
        if ld_rec in outputs:
            summaries.midiae_ld_summary(batch[self._db_key], outputs, step,
                                        self._db_key)

        summaries.midiae_sp_summary(outputs, step)