class_docstr: Encodes f0 & loudness to MIDI representation.
docstr: Constructor.
docstr_tok: ["Constructor","."]
code: def __init__(self, net=None, f0_residual=True, **kwargs):
      """Constructor."""
      super().__init__(**kwargs)
      self.net = net
      self.f0_residual = f0_residual
      self.dense_out = tfkl.Dense(2)
      self.norm = nn.Normalize("layer")
  
imports: import ddsp
  from ddsp import spectral_ops
  from ddsp.training import nn
  import gin
  import tensorflow.compat.v2
label_desc: Use image node_id 1 to create a new MidiEncoder object from inherited base classes: nn with example: obj = MidiEncoder(net, f0_residual)