s(targets[0] - self.pred))/ self.conf.n_classes/ self.conf.batch_size
              return hmap_loss
        </code></pre>

    <h3><a id="pb_train">Defining train  function</a></h3>
        Inputs<br>
        <ul>
            <li>restore: Whether to start training from previously saved model or start from scratch.
        </ul>
        Outputs<br>
        <br>

        <p>By default this function trains the network my minimizing the loss function using Adam optimizer along with gradient norm clipping. The 