GraphSage unsupervised loss function

aure_bnp: <p>The paper “Inductive Representation Learning on Large Graphs (Graphsage)” has an unsupervised loss function based on random walks (sec 3.2 and image below) that is similar to deepwalk and node2vec, I couldn’t find it anywhere.<br>
<div class="lightbox-wrapper"><a class="lightbox" href="https://discuss.pytorch.org/uploads/default/original/3X/2/1/21c517098ee28d376ba8bb23f20eea1df8e5ffbd.png" data-download-href="https://discuss.pytorch.org/uploads/default/21c517098ee28d376ba8bb23f20eea1df8e5ffbd" title="image"><img src="https://discuss.pytorch.org/uploads/default/optimized/3X/2/1/21c517098ee28d376ba8bb23f20eea1df8e5ffbd_2_690x46.png" alt="image" data-base62-sha1="4OK1epYAHi3X1W3MRbczBlWG697" width="690" height="46" srcset="https://discuss.pytorch.org/uploads/default/optimized/3X/2/1/21c517098ee28d376ba8bb23f20eea1df8e5ffbd_2_690x46.png, https://discuss.pytorch.org/uploads/default/original/3X/2/1/21c517098ee28d376ba8bb23f20eea1df8e5ffbd.png 1.5x, https://discuss.pytorch.org/uploads/default/original/3X/2/1/21c517098ee28d376ba8bb23f20eea1df8e5ffbd.png 2x" data-dominant-color="F4F4F4"><div class="meta"><svg class="fa d-icon d-icon-far-image svg-icon" aria-hidden="true"><use href="#far-image"></use></svg><span class="filename">image</span><span class="informations">881×59 7.8 KB</span><svg class="fa d-icon d-icon-discourse-expand svg-icon" aria-hidden="true"><use href="#discourse-expand"></use></svg></div></a></div></p>
<p>Is there an implementation or a plan to implement this loss function in pytorch?</p>
<p>For instance, for a binary cross entropy loss function you just have to use : torch.nn.functional.binary_cross_entropy.<br>
Is there a similar function for the loss of the authors of the section 3.2 ?</p>
<p>Thank you all !</p>

Robsen_bobsen: <p>I think your Question is related to this issue:</p><aside class="onebox githubissue" data-onebox-src="https://github.com/pyg-team/pytorch_geometric/issues/1420">
  <header class="source">

      <a href="https://github.com/pyg-team/pytorch_geometric/issues/1420" target="_blank" rel="noopener nofollow ugc">github.com/pyg-team/pytorch_geometric</a>
  </header>

  <article class="onebox-body">
    <div class="github-row">
  <div class="github-icon-container" title="Issue">
	  <svg width="60" height="60" class="github-icon" viewbox="0 0 14 16" aria-hidden="true"><path fill-rule="evenodd" d="M7 2.3c3.14 0 5.7 2.56 5.7 5.7s-2.56 5.7-5.7 5.7A5.71 5.71 0 0 1 1.3 8c0-3.14 2.56-5.7 5.7-5.7zM7 1C3.14 1 0 4.14 0 8s3.14 7 7 7 7-3.14 7-7-3.14-7-7-7zm1 3H6v5h2V4zm0 6H6v2h2v-2z"></path></svg>
  </div>

  <div class="github-info-container">
    <h4>
      <a href="https://github.com/pyg-team/pytorch_geometric/issues/1420" target="_blank" rel="noopener nofollow ugc">Unsupervised GraphSage</a>
    </h4>

    <div class="github-info">
      <div class="date">
        opened <span class="discourse-local-date" data-format="ll" data-date="2020-07-11" data-time="23:30:13" data-timezone="UTC">11:30PM - 11 Jul 20 UTC</span>
      </div>

        <div class="date">
          closed <span class="discourse-local-date" data-format="ll" data-date="2022-10-26" data-time="21:35:16" data-timezone="UTC">09:35PM - 26 Oct 22 UTC</span>
        </div>

      <div class="user">
        <a href="https://github.com/Sharad24" target="_blank" rel="noopener nofollow ugc">
          <img alt="Sharad24" src="https://avatars.githubusercontent.com/u/33530535?v=4" class="onebox-avatar-inline" width="20" height="20">
          Sharad24
        </a>
      </div>
    </div>

    <div class="labels">
    </div>
  </div>
</div>

  <div class="github-row">
    <p class="github-body-container">## ❓ Questions &amp; Help

Is there a complete example of the Unsupervised GraphSa<span class="show-more-container"><a href="" rel="noopener" class="show-more">…</a></span><span class="excerpt hidden">ge with its loss formulation?</span></p>
  </div>

  </article>

  <div class="onebox-metadata">
    
    
  </div>

  <div style="clear: both"></div>
</aside>

<p>Short this is an Example: <a href="https://github.com/pyg-team/pytorch_geometric/blob/master/examples/graph_sage_unsup_ppi.py" class="inline-onebox" rel="noopener nofollow ugc">pytorch_geometric/examples/graph_sage_unsup_ppi.py at master · pyg-team/pytorch_geometric · GitHub</a></p>