261.63 Hz sinusoid, C4 of the musical note. As discussed in the previous works [@aytar2016soundnet; @oord2016wavenet; @donahue2018adversarial], larger convolutional kernels and strided/dilated convolutions are often needed to deal with audio signals as they could increase the receptive field. On the proposed waveform inpainting model, we thus experiment with gated/dilated convolution,

#### **Gated convolutions.**

For each convolutional layer in waveform-based models (Fig. \[fig:model\_architecture\] (a2)), we adopt gated convolution [@yu2018free] to softly attend on the masked areas: $$Output = \sigma(W_g * x)  \phi(W_f * x)$$ where $x$ is the input feature, $W_g$ is the gating kernel, $W_f$ is the feature kernel, $sigma$ is the sigmoid function to restrict the soft gating values between 0 (invalid) and 1 (valid), $\phi$ is the activation function (LeakyReLU), and $*$ is the convolution operation. Note that a similar idea, gated activation [@van2016conditional] is also found useful for the audio generation task such as WaveNet [@oord2016wavenet].

Loss Functions {#sec:loss_functions}
--------------

#### **Masked $l_1$ loss ($Ml_1$).**

The $l_1$ loss focuses on low-level features and is widely used for both image and video inpainting models [@liu2018image; @wang2018videoinp; @chang2019free]. We apply the $l_1$ loss on the masked area: $$\label{l1_loss}
L_{Ml_1} = \mathop{\mathbb{E}_{t}}[ M_{t} |O_{t} - A_{t}|]$$

#### **Perceptual loss on 