Skip to content

Commit

Permalink
Deploying to gh-pages from @ fc5d955 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
asogaard committed May 28, 2024
1 parent cd35ff3 commit 4514c94
Show file tree
Hide file tree
Showing 12 changed files with 278 additions and 14 deletions.
1 change: 1 addition & 0 deletions _modules/graphnet/models/components/embedding.html
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,7 @@ <h1 id="modules-graphnet-models-components-embedding--page-root">Source code for
<span class="sa">f</span><span class="s2">"</span><span class="si">{</span><span class="n">n_features</span><span class="si">}</span><span class="s2"> features."</span>
<span class="p">)</span>
<span class="k">elif</span> <span class="n">n_features</span> <span class="o">&gt;=</span> <span class="mi">6</span><span class="p">:</span>

<span class="n">hidden_dim</span> <span class="o">=</span> <span class="mi">6</span> <span class="o">*</span> <span class="n">seq_length</span>
<span class="k">else</span><span class="p">:</span>
<span class="n">hidden_dim</span> <span class="o">=</span> <span class="nb">int</span><span class="p">((</span><span class="n">n_features</span> <span class="o">+</span> <span class="mf">0.5</span><span class="p">)</span> <span class="o">*</span> <span class="n">seq_length</span><span class="p">)</span>
Expand Down
5 changes: 4 additions & 1 deletion _modules/graphnet/models/graphs/graph_definition.html
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ <h1 id="modules-graphnet-models-graphs-graph-definition--page-root">Source code
<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">detector</span><span class="p">:</span> <span class="n">Detector</span><span class="p">,</span>
<span class="n">node_definition</span><span class="p">:</span> <span class="n">NodeDefinition</span> <span class="o">=</span> <span class="n">NodesAsPulses</span><span class="p">(),</span>
<span class="n">node_definition</span><span class="p">:</span> <span class="n">NodeDefinition</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">edge_definition</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">EdgeDefinition</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">input_feature_names</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">dtype</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">torch</span><span class="o">.</span><span class="n">dtype</span><span class="p">]</span> <span class="o">=</span> <span class="n">torch</span><span class="o">.</span><span class="n">float</span><span class="p">,</span>
Expand Down Expand Up @@ -422,6 +422,9 @@ <h1 id="modules-graphnet-models-graphs-graph-definition--page-root">Source code
<span class="c1"># Base class constructor</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span><span class="n">name</span><span class="o">=</span><span class="vm">__name__</span><span class="p">,</span> <span class="n">class_name</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="vm">__class__</span><span class="o">.</span><span class="vm">__name__</span><span class="p">)</span>

<span class="k">if</span> <span class="n">node_definition</span> <span class="ow">is</span> <span class="kc">None</span><span class="p">:</span>
<span class="n">node_definition</span> <span class="o">=</span> <span class="n">NodesAsPulses</span><span class="p">()</span>

<span class="c1"># Member Variables</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_detector</span> <span class="o">=</span> <span class="n">detector</span>
<span class="bp">self</span><span class="o">.</span><span class="n">_edge_definition</span> <span class="o">=</span> <span class="n">edge_definition</span>
Expand Down
44 changes: 44 additions & 0 deletions _modules/graphnet/models/graphs/graphs.html
Original file line number Diff line number Diff line change
Expand Up @@ -408,6 +408,50 @@ <h1 id="modules-graphnet-models-graphs-graphs--page-root">Source code for graphn
<span class="n">seed</span><span class="o">=</span><span class="n">seed</span><span class="p">,</span>
<span class="p">)</span></div>



<div class="viewcode-block" id="EdgelessGraph">
<a class="viewcode-back" href="../../../../api/graphnet.models.graphs.graphs.html#graphnet.models.graphs.graphs.EdgelessGraph">[docs]</a>
<span class="k">class</span> <span class="nc">EdgelessGraph</span><span class="p">(</span><span class="n">GraphDefinition</span><span class="p">):</span>
<span class="w"> </span><span class="sd">"""A Data representation without edge assignment.</span>

<span class="sd"> I.e the resulting representation is created without an EdgeDefinition.</span>
<span class="sd"> """</span>

<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">detector</span><span class="p">:</span> <span class="n">Detector</span><span class="p">,</span>
<span class="n">node_definition</span><span class="p">:</span> <span class="n">NodeDefinition</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">input_feature_names</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">List</span><span class="p">[</span><span class="nb">str</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">dtype</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">torch</span><span class="o">.</span><span class="n">dtype</span><span class="p">]</span> <span class="o">=</span> <span class="n">torch</span><span class="o">.</span><span class="n">float</span><span class="p">,</span>
<span class="n">perturbation_dict</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Dict</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="nb">float</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="n">seed</span><span class="p">:</span> <span class="n">Optional</span><span class="p">[</span><span class="n">Union</span><span class="p">[</span><span class="nb">int</span><span class="p">,</span> <span class="n">Generator</span><span class="p">]]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">)</span> <span class="o">-&gt;</span> <span class="kc">None</span><span class="p">:</span>
<span class="w"> </span><span class="sd">"""Construct isolated nodes graph representation.</span>

<span class="sd"> Args:</span>
<span class="sd"> detector: Detector that represents your data.</span>
<span class="sd"> node_definition: Definition of nodes in the graph.</span>
<span class="sd"> input_feature_names: Name of input feature columns.</span>
<span class="sd"> dtype: data type for node features.</span>
<span class="sd"> perturbation_dict: Dictionary mapping a feature name to a standard</span>
<span class="sd"> deviation according to which the values for this</span>
<span class="sd"> feature should be randomly perturbed. Defaults</span>
<span class="sd"> to None.</span>
<span class="sd"> seed: seed or Generator used to randomly sample perturbations.</span>
<span class="sd"> Defaults to None.</span>
<span class="sd"> """</span>
<span class="c1"># Base class constructor</span>
<span class="nb">super</span><span class="p">()</span><span class="o">.</span><span class="fm">__init__</span><span class="p">(</span>
<span class="n">detector</span><span class="o">=</span><span class="n">detector</span><span class="p">,</span>
<span class="n">node_definition</span><span class="o">=</span><span class="n">node_definition</span> <span class="ow">or</span> <span class="n">NodesAsPulses</span><span class="p">(),</span>
<span class="n">edge_definition</span><span class="o">=</span><span class="kc">None</span><span class="p">,</span>
<span class="n">dtype</span><span class="o">=</span><span class="n">dtype</span><span class="p">,</span>
<span class="n">input_feature_names</span><span class="o">=</span><span class="n">input_feature_names</span><span class="p">,</span>
<span class="n">perturbation_dict</span><span class="o">=</span><span class="n">perturbation_dict</span><span class="p">,</span>
<span class="n">seed</span><span class="o">=</span><span class="n">seed</span><span class="p">,</span>
<span class="p">)</span></div>

</pre></div>

</article>
Expand Down
Loading

0 comments on commit 4514c94

Please sign in to comment.