 <a class="reference external" href="https://github.com/siliconlabs/mltk/blob/master/mltk/core/keras/losses.py">mltk/core/keras/losses.py</a></p>
<p>The basic formula for contrastive loss is:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">Contrastive</span> <span class="n">loss</span> <span class="o">=</span> <span class="n">mean</span><span class="p">(</span> <span class="p">(</span><span class="mi">1</span><span class="o">-</span><span class="n">tru