Skip to content

Commit

Permalink
deploy: de600fa
Browse files Browse the repository at this point in the history
  • Loading branch information
mieskolainen committed Aug 28, 2024
1 parent c14e2b0 commit 70f604e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
6 changes: 3 additions & 3 deletions _modules/icenet/tools/process.html
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@ <h1>Source code for icenet.tools.process</h1><div class="highlight"><pre>
<span class="c1"># -------------------------------------------------------------------</span>
<span class="c1"># Technical</span>

<span class="n">args</span><span class="p">[</span><span class="s1">&#39;__runmode__&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">bool</span><span class="p">(</span><span class="n">cli_dict</span><span class="p">[</span><span class="s1">&#39;runmode&#39;</span><span class="p">])</span>
<span class="n">args</span><span class="p">[</span><span class="s1">&#39;__runmode__&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="n">cli_dict</span><span class="p">[</span><span class="s1">&#39;runmode&#39;</span><span class="p">]</span>
<span class="n">args</span><span class="p">[</span><span class="s1">&#39;__use_cache__&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">bool</span><span class="p">(</span><span class="n">cli_dict</span><span class="p">[</span><span class="s1">&#39;use_cache&#39;</span><span class="p">])</span>
<span class="n">args</span><span class="p">[</span><span class="s1">&#39;__compute__&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="nb">bool</span><span class="p">(</span><span class="n">cli_dict</span><span class="p">[</span><span class="s1">&#39;compute&#39;</span><span class="p">])</span>
<span class="n">args</span><span class="p">[</span><span class="s1">&#39;__raytune_running__&#39;</span><span class="p">]</span> <span class="o">=</span> <span class="kc">False</span>
Expand All @@ -918,7 +918,7 @@ <h1>Source code for icenet.tools.process</h1><div class="highlight"><pre>

<span class="c1"># -------------------------------------------------------------------</span>
<span class="c1"># Set random seeds for reproducability and train-validate-test splits</span>

<span class="nb">print</span><span class="p">(</span><span class="s1">&#39;&#39;</span><span class="p">)</span>
<span class="nb">print</span><span class="p">(</span><span class="s2">&quot; torch.__version__: &quot;</span> <span class="o">+</span> <span class="n">torch</span><span class="o">.</span><span class="n">__version__</span><span class="p">)</span>

Expand Down Expand Up @@ -963,7 +963,7 @@ <h1>Source code for icenet.tools.process</h1><div class="highlight"><pre>
<span class="nb">print</span><span class="p">(</span><span class="n">cli</span><span class="p">)</span> <span class="c1"># for output log</span>
<span class="n">data</span> <span class="o">=</span> <span class="n">read_data_processed</span><span class="p">(</span><span class="n">args</span><span class="o">=</span><span class="n">args</span><span class="p">,</span> <span class="n">func_loader</span><span class="o">=</span><span class="n">func_loader</span><span class="p">,</span>
<span class="n">func_factor</span><span class="o">=</span><span class="n">func_factor</span><span class="p">,</span> <span class="n">mvavars</span><span class="o">=</span><span class="sa">f</span><span class="s1">&#39;configs.</span><span class="si">{</span><span class="n">rootname</span><span class="si">}</span><span class="s1">.mvavars&#39;</span><span class="p">,</span> <span class="n">runmode</span><span class="o">=</span><span class="n">runmode</span><span class="p">)</span>

<span class="k">if</span> <span class="n">args</span><span class="p">[</span><span class="s1">&#39;__compute__&#39;</span><span class="p">]:</span>

<span class="k">if</span> <span class="n">runmode</span> <span class="o">==</span> <span class="s1">&#39;train&#39;</span><span class="p">:</span>
Expand Down
14 changes: 10 additions & 4 deletions _modules/icezee/common.html
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,14 @@ <h1>Source code for icezee.common</h1><div class="highlight"><pre>
<span class="c1">#W = W[rand].squeeze()</span>
<span class="c1"># -------------------------------------------------------------------------</span>

<span class="c1"># -------------------------------------------------------------------------</span>
<span class="c1">## Add event weights as an aux variable called `raw_weight` for plots etc.</span>

<span class="n">X</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">hstack</span><span class="p">((</span><span class="n">X</span><span class="p">,</span> <span class="n">W</span><span class="p">[</span><span class="kc">None</span><span class="p">]</span><span class="o">.</span><span class="n">T</span><span class="p">))</span>
<span class="n">ids</span> <span class="o">=</span> <span class="n">ids</span> <span class="o">+</span> <span class="p">[</span><span class="s1">&#39;raw_weight&#39;</span><span class="p">]</span>

<span class="c1"># -------------------------------------------------------------------------</span>

<span class="c1">## Print some diagnostics</span>
<span class="nb">print</span><span class="p">(</span><span class="sa">f</span><span class="s1">&#39;Total number of events: </span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="n">X</span><span class="p">)</span><span class="si">}</span><span class="s1">&#39;</span><span class="p">)</span>

Expand Down Expand Up @@ -752,11 +760,11 @@ <h1>Source code for icezee.common</h1><div class="highlight"><pre>
<span class="n">data</span> <span class="o">=</span> <span class="n">io</span><span class="o">.</span><span class="n">IceXYW</span><span class="p">(</span><span class="n">x</span><span class="o">=</span><span class="n">x</span><span class="p">,</span> <span class="n">y</span><span class="o">=</span><span class="n">y</span><span class="p">,</span> <span class="n">w</span><span class="o">=</span><span class="n">w</span><span class="p">,</span> <span class="n">ids</span><span class="o">=</span><span class="n">ids</span><span class="p">)</span>

<span class="c1"># -------------------------------------------------------------------------</span>
<span class="c1">### Pick kinematic variables out</span>
<span class="c1">### Pick kinematic variables out (note also &#39;raw_weight&#39;)</span>
<span class="n">data_kin</span> <span class="o">=</span> <span class="kc">None</span>

<span class="k">if</span> <span class="n">inputvars</span><span class="o">.</span><span class="n">KINEMATIC_VARS</span> <span class="ow">is</span> <span class="ow">not</span> <span class="kc">None</span><span class="p">:</span>
<span class="nb">vars</span> <span class="o">=</span> <span class="n">aux</span><span class="o">.</span><span class="n">process_regexp_ids</span><span class="p">(</span><span class="n">all_ids</span><span class="o">=</span><span class="n">data</span><span class="o">.</span><span class="n">ids</span><span class="p">,</span> <span class="n">ids</span><span class="o">=</span><span class="n">inputvars</span><span class="o">.</span><span class="n">KINEMATIC_VARS</span><span class="p">)</span>
<span class="nb">vars</span> <span class="o">=</span> <span class="n">aux</span><span class="o">.</span><span class="n">process_regexp_ids</span><span class="p">(</span><span class="n">all_ids</span><span class="o">=</span><span class="n">data</span><span class="o">.</span><span class="n">ids</span><span class="p">,</span> <span class="n">ids</span><span class="o">=</span><span class="n">inputvars</span><span class="o">.</span><span class="n">KINEMATIC_VARS</span> <span class="o">+</span> <span class="p">[</span><span class="s1">&#39;raw_weight&#39;</span><span class="p">])</span>
<span class="n">data_kin</span> <span class="o">=</span> <span class="n">data</span><span class="p">[</span><span class="nb">vars</span><span class="p">]</span>
<span class="n">data_kin</span><span class="o">.</span><span class="n">x</span> <span class="o">=</span> <span class="n">data_kin</span><span class="o">.</span><span class="n">x</span><span class="o">.</span><span class="n">astype</span><span class="p">(</span><span class="n">np</span><span class="o">.</span><span class="n">float32</span><span class="p">)</span>

Expand Down Expand Up @@ -809,8 +817,6 @@ <h1>Source code for icezee.common</h1><div class="highlight"><pre>
<span class="c1"># Change the variable name [+ have the same original variables in data_kin]</span>
<span class="n">data</span><span class="o">.</span><span class="n">ids</span><span class="p">[</span><span class="n">ind</span><span class="p">]</span> <span class="o">=</span> <span class="sa">f</span><span class="s1">&#39;TRF__</span><span class="si">{</span><span class="n">v</span><span class="si">}</span><span class="s1">&#39;</span>

<span class="c1"># -------------------------------------------------------------------------</span>

<span class="k">return</span> <span class="p">{</span><span class="s1">&#39;data&#39;</span><span class="p">:</span> <span class="n">data</span><span class="p">,</span> <span class="s1">&#39;data_MI&#39;</span><span class="p">:</span> <span class="n">data_MI</span><span class="p">,</span> <span class="s1">&#39;data_kin&#39;</span><span class="p">:</span> <span class="n">data_kin</span><span class="p">,</span> <span class="s1">&#39;data_deps&#39;</span><span class="p">:</span> <span class="n">data_deps</span><span class="p">,</span> <span class="s1">&#39;data_tensor&#39;</span><span class="p">:</span> <span class="n">data_tensor</span><span class="p">,</span> <span class="s1">&#39;data_graph&#39;</span><span class="p">:</span> <span class="n">data_graph</span><span class="p">}</span></div>

</pre></div>
Expand Down

0 comments on commit 70f604e

Please sign in to comment.