Skip to content
Permalink
Browse files

typo

  • Loading branch information...
rusty1s committed Apr 15, 2019
1 parent 17f3418 commit 72fcf920e30295853ed4ab2c3f446b091573e28a
@@ -408,8 +408,8 @@ <h1>Source code for torch_geometric.nn.models.re_net</h1><div class="highlight">
<span class="k">return</span> <span class="n">log_prob_obj</span><span class="p">,</span> <span class="n">log_prob_sub</span></div>

<div class="viewcode-block" id="RENet.test"><a class="viewcode-back" href="../../../../modules/nn.html#torch_geometric.nn.models.RENet.test">[docs]</a> <span class="k">def</span> <span class="nf">test</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">logits</span><span class="p">,</span> <span class="n">y</span><span class="p">):</span>
<span class="sd">&quot;&quot;&quot;Given ground-truth :math:`y`, computes Mean Reciprocal Rank (MRR)</span>
<span class="sd"> and Hits@1/3/10.&quot;&quot;&quot;</span>
<span class="sd">&quot;&quot;&quot;Given ground-truth :obj:`y`, computes Mean Reciprocal Rank (MRR)</span>
<span class="sd"> and Hits at 1/3/10.&quot;&quot;&quot;</span>

<span class="n">_</span><span class="p">,</span> <span class="n">perm</span> <span class="o">=</span> <span class="n">logits</span><span class="o">.</span><span class="n">sort</span><span class="p">(</span><span class="n">dim</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">descending</span><span class="o">=</span><span class="kc">True</span><span class="p">)</span>
<span class="n">mask</span> <span class="o">=</span> <span class="p">(</span><span class="n">y</span><span class="o">.</span><span class="n">view</span><span class="p">(</span><span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span> <span class="o">==</span> <span class="n">perm</span><span class="p">)</span>
@@ -2620,8 +2620,8 @@ <h1>torch_geometric.nn<a class="headerlink" href="#torch-geometric-nn" title="Pe
<dl class="method">
<dt id="torch_geometric.nn.models.RENet.test">
<code class="descname">test</code><span class="sig-paren">(</span><em>logits</em>, <em>y</em><span class="sig-paren">)</span><a class="reference internal" href="../_modules/torch_geometric/nn/models/re_net.html#RENet.test"><span class="viewcode-link">[source]</span></a><a class="headerlink" href="#torch_geometric.nn.models.RENet.test" title="Permalink to this definition">¶</a></dt>
<dd><p>Given ground-truth <span class="math notranslate nohighlight">\(y\)</span>, computes Mean Reciprocal Rank (MRR)
and <a class="reference external" href="mailto:Hits&#37;&#52;&#48;1/3/10">Hits<span>&#64;</span>1/3/10</a>.</p>
<dd><p>Given ground-truth <code class="xref py py-obj docutils literal notranslate"><span class="pre">y</span></code>, computes Mean Reciprocal Rank (MRR)
and Hits at 1/3/10.</p>
</dd></dl>

</dd></dl>
@@ -213,8 +213,8 @@ def forward(self, data):
return log_prob_obj, log_prob_sub

def test(self, logits, y):
"""Given ground-truth :math:`y`, computes Mean Reciprocal Rank (MRR)
and Hits@1/3/10."""
"""Given ground-truth :obj:`y`, computes Mean Reciprocal Rank (MRR)
and Hits at 1/3/10."""

_, perm = logits.sort(dim=1, descending=True)
mask = (y.view(-1, 1) == perm)

0 comments on commit 72fcf92

Please sign in to comment.
You can’t perform that action at this time.