<span class="p">)</span>

                <span class="c1"># Perform forward pass</span>
                <span class="n">y_pred</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</span><span class="n">model</span><span class="p">(</span><span class="n">X_val_batch</span><span class="p">)</span>

                <span class="c1"># Calculate loss for the batch</span>
                <span class="n">loss</span> <span class="o">=</span> <span class="bp">self</span><span class="o">.</s