Skip to content

Commit

Permalink
example added
Browse files Browse the repository at this point in the history
  • Loading branch information
Anwar-Said committed Nov 8, 2023
1 parent f342e3e commit b77d832
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 23 deletions.
8 changes: 0 additions & 8 deletions NeuroGraph/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,6 @@ class NeuroGraphDynamic():
def __init__(self,root, name):
self.root = root
self.name = name


# self.urls = {"DynHCP-Gender":'https://vanderbilt.box.com/shared/static/mj0z6unea34lfz1hkdwsinj7g22yohxn.zip',
# "DynHCP-State":'https://vanderbilt.box.com/shared/static/2so3fnfqakeu6hktz322o3nm2c8ocus7.zip',
# "DynHCP-Age":'https://vanderbilt.box.com/shared/static/195f9teg4t4apn6kl6hbc4ib4g9addtq.zip',
# "DynHCP-WM":'https://vanderbilt.box.com/shared/static/mxy8fq3ghm60q6h7uhnu80pgvfxs6xo2.zip',
# "DynHCP-FI":'https://vanderbilt.box.com/shared/static/un7w3ohb2mmyjqt1ou2wm3g87y1lfuuo.zip'
# }
assert name in self.filenames.keys()
self.name = name
file_path = os.path.join(self.root,self.name,'processed', self.name+".pt")
Expand Down
Binary file modified doc/_build/doctrees/environment.pickle
Binary file not shown.
Binary file modified doc/_build/doctrees/get_started.doctree
Binary file not shown.
8 changes: 0 additions & 8 deletions doc/_build/html/_modules/NeuroGraph/datasets.html
Original file line number Diff line number Diff line change
Expand Up @@ -254,14 +254,6 @@ <h1>Source code for NeuroGraph.datasets</h1><div class="highlight"><pre>
<span class="k">def</span> <span class="fm">__init__</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span><span class="n">root</span><span class="p">,</span> <span class="n">name</span><span class="p">):</span>
<span class="bp">self</span><span class="o">.</span><span class="n">root</span> <span class="o">=</span> <span class="n">root</span>
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>


<span class="c1"># self.urls = {&quot;DynHCP-Gender&quot;:&#39;https://vanderbilt.box.com/shared/static/mj0z6unea34lfz1hkdwsinj7g22yohxn.zip&#39;,</span>
<span class="c1"># &quot;DynHCP-State&quot;:&#39;https://vanderbilt.box.com/shared/static/2so3fnfqakeu6hktz322o3nm2c8ocus7.zip&#39;,</span>
<span class="c1"># &quot;DynHCP-Age&quot;:&#39;https://vanderbilt.box.com/shared/static/195f9teg4t4apn6kl6hbc4ib4g9addtq.zip&#39;,</span>
<span class="c1"># &quot;DynHCP-WM&quot;:&#39;https://vanderbilt.box.com/shared/static/mxy8fq3ghm60q6h7uhnu80pgvfxs6xo2.zip&#39;,</span>
<span class="c1"># &quot;DynHCP-FI&quot;:&#39;https://vanderbilt.box.com/shared/static/un7w3ohb2mmyjqt1ou2wm3g87y1lfuuo.zip&#39;</span>
<span class="c1"># }</span>
<span class="k">assert</span> <span class="n">name</span> <span class="ow">in</span> <span class="bp">self</span><span class="o">.</span><span class="n">filenames</span><span class="o">.</span><span class="n">keys</span><span class="p">()</span>
<span class="bp">self</span><span class="o">.</span><span class="n">name</span> <span class="o">=</span> <span class="n">name</span>
<span class="n">file_path</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="bp">self</span><span class="o">.</span><span class="n">root</span><span class="p">,</span><span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="p">,</span><span class="s1">&#39;processed&#39;</span><span class="p">,</span> <span class="bp">self</span><span class="o">.</span><span class="n">name</span><span class="o">+</span><span class="s2">&quot;.pt&quot;</span><span class="p">)</span>
Expand Down
4 changes: 2 additions & 2 deletions doc/_build/html/_sources/get_started.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@ NeuroGraph utilizes the `PyG` `InMemoryDataset` class to facilitate the loading
.. code-block:: python
:linenos:
from NeuroGraph.datasets import NeuroGraphStatic
from NeuroGraph.datasets import NeuroGraphDataset
dataset = NeuroGraphStatic(root="data/", name= "HCPGender")
dataset = NeuroGraphDataset(root="data/", name= "HCPGender")
print(dataset.num_classes)
print(dataset.num_features)
Expand Down
4 changes: 2 additions & 2 deletions doc/_build/html/get_started.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,10 +113,10 @@ <h2>Loading Benchmark datasets<a class="headerlink" href="#loading-benchmark-dat
<section id="loading-static-benchmarks">
<h3>Loading Static Benchmarks<a class="headerlink" href="#loading-static-benchmarks" title="Link to this heading"></a></h3>
<p>NeuroGraph utilizes the <cite>PyG</cite> <cite>InMemoryDataset</cite> class to facilitate the loading of datasets. this allows an easy-to-use interface for applying graph machine learning pipelines. For example, the <cite>HCPGender</cite> benchmark can be loaded as follows:</p>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="linenos">1</span><span class="kn">from</span> <span class="nn">NeuroGraph.datasets</span> <span class="kn">import</span> <span class="n">NeuroGraphStatic</span>
<div class="highlight-python notranslate"><div class="highlight"><pre><span></span><span class="linenos">1</span><span class="kn">from</span> <span class="nn">NeuroGraph.datasets</span> <span class="kn">import</span> <span class="n">NeuroGraphDataset</span>
<span class="linenos">2</span>
<span class="linenos">3</span>
<span class="linenos">4</span><span class="n">dataset</span> <span class="o">=</span> <span class="n">NeuroGraphStatic</span><span class="p">(</span><span class="n">root</span><span class="o">=</span><span class="s2">&quot;data/&quot;</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span> <span class="s2">&quot;HCPGender&quot;</span><span class="p">)</span>
<span class="linenos">4</span><span class="n">dataset</span> <span class="o">=</span> <span class="n">NeuroGraphDataset</span><span class="p">(</span><span class="n">root</span><span class="o">=</span><span class="s2">&quot;data/&quot;</span><span class="p">,</span> <span class="n">name</span><span class="o">=</span> <span class="s2">&quot;HCPGender&quot;</span><span class="p">)</span>
<span class="linenos">5</span>
<span class="linenos">6</span><span class="nb">print</span><span class="p">(</span><span class="n">dataset</span><span class="o">.</span><span class="n">num_classes</span><span class="p">)</span>
<span class="linenos">7</span><span class="nb">print</span><span class="p">(</span><span class="n">dataset</span><span class="o">.</span><span class="n">num_features</span><span class="p">)</span>
Expand Down
Loading

0 comments on commit b77d832

Please sign in to comment.