One-hot encodes the waveform amplitudes. This allows the definition of the network as a categorical distribution over a finite set of possible amplitudes.
(self, input_batch)
| 514 | return conv2 |
| 515 | |
| 516 | def _one_hot(self, input_batch): |
| 517 | '''One-hot encodes the waveform amplitudes. |
| 518 | |
| 519 | This allows the definition of the network as a categorical distribution |
| 520 | over a finite set of possible amplitudes. |
| 521 | ''' |
| 522 | with tf.name_scope('one_hot_encode'): |
| 523 | encoded = tf.one_hot( |
| 524 | input_batch, |
| 525 | depth=self.quantization_channels, |
| 526 | dtype=tf.float32) |
| 527 | shape = [self.batch_size, -1, self.quantization_channels] |
| 528 | encoded = tf.reshape(encoded, shape) |
| 529 | return encoded |
| 530 | |
| 531 | def _embed_gc(self, global_condition): |
| 532 | '''Returns embedding for global condition. |
no outgoing calls
no test coverage detected