Skip to content

Commit

Permalink
Deploying to gh-pages from @ dcad9a5 🚀
Browse files Browse the repository at this point in the history
  • Loading branch information
DaliCHEBBI committed Nov 15, 2024
1 parent 8064da6 commit ed65c45
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions _modules/simlearner3d/models/generic_model.html
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,14 @@ <h1>Source code for simlearner3d.models.generic_model</h1><div class="highlight"
<span class="c1"># Forward</span>
<span class="n">FeatsL</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">feature</span><span class="p">(</span><span class="n">x0</span><span class="p">)</span>
<span class="n">FeatsR</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">feature</span><span class="p">(</span><span class="n">x1</span><span class="p">)</span>
<span class="n">Offset_pos</span><span class="o">=-</span> <span class="p">(</span><span class="mf">0.5</span><span class="p">)</span> <span class="o">*</span> <span class="n">torch</span><span class="o">.</span><span class="n">rand</span><span class="p">(</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">(),</span><span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">)</span> <span class="o">+</span> <span class="p">(</span><span class="mf">0.5</span><span class="p">)</span>
<span class="n">Offset_neg</span><span class="o">=</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">false1</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">false2</span><span class="p">)</span> <span class="o">*</span> <span class="n">torch</span><span class="o">.</span><span class="n">rand</span><span class="p">(</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">(),</span><span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">)</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">false2</span><span class="p">)</span>
<span class="n">RandSens</span><span class="o">=</span><span class="n">torch</span><span class="o">.</span><span class="n">rand</span><span class="p">(</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">(),</span><span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">)</span>
<span class="n">RandSens</span><span class="o">=</span><span class="p">((</span><span class="n">RandSens</span> <span class="o">&lt;</span> <span class="mf">0.5</span><span class="p">)</span><span class="o">.</span><span class="n">float</span><span class="p">()</span><span class="o">+</span><span class="p">(</span><span class="n">RandSens</span> <span class="o">&gt;=</span> <span class="mf">0.5</span><span class="p">)</span><span class="o">.</span><span class="n">float</span><span class="p">()</span><span class="o">*</span><span class="p">(</span><span class="o">-</span><span class="mf">1.0</span><span class="p">))</span>
<span class="n">Offset_pos</span><span class="o">=</span><span class="n">Offset_pos</span><span class="o">*</span><span class="n">RandSens</span>
<span class="n">Offset_neg</span><span class="o">=</span><span class="n">Offset_neg</span><span class="o">*</span><span class="n">RandSens</span>
<span class="c1">#dispnoc0=torch.nan_to_num(dispnoc0, nan=0.0)</span>
<span class="n">D_pos</span><span class="o">=</span><span class="n">dispnoc0</span>
<span class="n">D_pos</span><span class="o">=</span><span class="n">dispnoc0</span><span class="o">+</span><span class="n">Offset_pos</span>
<span class="n">D_neg</span><span class="o">=</span><span class="n">dispnoc0</span><span class="o">+</span><span class="n">Offset_neg</span>
<span class="n">Index_X</span><span class="o">=</span><span class="n">torch</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span><span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">)</span>
<span class="n">Index_X</span><span class="o">=</span><span class="n">Index_X</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">()[</span><span class="o">-</span><span class="mi">2</span><span class="p">],</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span><span class="o">.</span><span class="n">unsqueeze</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="o">.</span><span class="n">unsqueeze</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="o">.</span><span class="n">repeat_interleave</span><span class="p">(</span><span class="n">x0</span><span class="o">.</span><span class="n">size</span><span class="p">()[</span><span class="mi">0</span><span class="p">],</span><span class="mi">0</span><span class="p">)</span>
Expand Down Expand Up @@ -318,12 +320,14 @@ <h1>Source code for simlearner3d.models.generic_model</h1><div class="highlight"
<span class="n">device</span><span class="o">=</span><span class="s1">&#39;cuda&#39;</span> <span class="k">if</span> <span class="n">x0</span><span class="o">.</span><span class="n">is_cuda</span> <span class="k">else</span> <span class="s1">&#39;cpu&#39;</span>
<span class="n">FeatsL</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">feature</span><span class="p">(</span><span class="n">x0</span><span class="p">)</span>
<span class="n">FeatsR</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">feature</span><span class="p">(</span><span class="n">x1</span><span class="p">)</span>
<span class="n">Offset_pos</span><span class="o">=-</span> <span class="p">(</span><span class="mf">0.5</span><span class="p">)</span> <span class="o">*</span> <span class="n">torch</span><span class="o">.</span><span class="n">rand</span><span class="p">(</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">(),</span><span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">)</span> <span class="o">+</span> <span class="p">(</span><span class="mf">0.5</span><span class="p">)</span>
<span class="n">Offset_neg</span><span class="o">=</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">false1</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">false2</span><span class="p">)</span> <span class="o">*</span> <span class="n">torch</span><span class="o">.</span><span class="n">rand</span><span class="p">(</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">(),</span><span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">)</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">false2</span><span class="p">)</span>
<span class="n">RandSens</span><span class="o">=</span><span class="n">torch</span><span class="o">.</span><span class="n">rand</span><span class="p">(</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">(),</span><span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">)</span>
<span class="n">RandSens</span><span class="o">=</span><span class="p">((</span><span class="n">RandSens</span> <span class="o">&lt;</span> <span class="mf">0.5</span><span class="p">)</span><span class="o">.</span><span class="n">float</span><span class="p">()</span><span class="o">+</span><span class="p">(</span><span class="n">RandSens</span> <span class="o">&gt;=</span> <span class="mf">0.5</span><span class="p">)</span><span class="o">.</span><span class="n">float</span><span class="p">()</span><span class="o">*</span><span class="p">(</span><span class="o">-</span><span class="mf">1.0</span><span class="p">))</span>
<span class="n">Offset_pos</span><span class="o">=</span><span class="n">Offset_pos</span><span class="o">*</span><span class="n">RandSens</span>
<span class="n">Offset_neg</span><span class="o">=</span><span class="n">Offset_neg</span><span class="o">*</span><span class="n">RandSens</span>
<span class="c1">#dispnoc0=torch.nan_to_num(dispnoc0, nan=0.0)</span>
<span class="n">D_pos</span><span class="o">=</span><span class="n">dispnoc0</span>
<span class="n">D_pos</span><span class="o">=</span><span class="n">dispnoc0</span><span class="o">+</span><span class="n">Offset_pos</span>
<span class="n">D_neg</span><span class="o">=</span><span class="n">dispnoc0</span><span class="o">+</span><span class="n">Offset_neg</span>
<span class="n">Index_X</span><span class="o">=</span><span class="n">torch</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span><span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">)</span>
<span class="n">Index_X</span><span class="o">=</span><span class="n">Index_X</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">()[</span><span class="o">-</span><span class="mi">2</span><span class="p">],</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span><span class="o">.</span><span class="n">unsqueeze</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="o">.</span><span class="n">unsqueeze</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="o">.</span><span class="n">repeat_interleave</span><span class="p">(</span><span class="n">x0</span><span class="o">.</span><span class="n">size</span><span class="p">()[</span><span class="mi">0</span><span class="p">],</span><span class="mi">0</span><span class="p">)</span>
Expand Down Expand Up @@ -389,12 +393,14 @@ <h1>Source code for simlearner3d.models.generic_model</h1><div class="highlight"
<span class="n">device</span><span class="o">=</span><span class="s1">&#39;cuda&#39;</span> <span class="k">if</span> <span class="n">x0</span><span class="o">.</span><span class="n">is_cuda</span> <span class="k">else</span> <span class="s1">&#39;cpu&#39;</span>
<span class="n">FeatsL</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">feature</span><span class="p">(</span><span class="n">x0</span><span class="p">)</span>
<span class="n">FeatsR</span><span class="o">=</span><span class="bp">self</span><span class="o">.</span><span class="n">feature</span><span class="p">(</span><span class="n">x1</span><span class="p">)</span>
<span class="n">Offset_pos</span><span class="o">=-</span> <span class="p">(</span><span class="mf">0.5</span><span class="p">)</span> <span class="o">*</span> <span class="n">torch</span><span class="o">.</span><span class="n">rand</span><span class="p">(</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">(),</span><span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">)</span> <span class="o">+</span> <span class="p">(</span><span class="mf">0.5</span><span class="p">)</span>
<span class="n">Offset_neg</span><span class="o">=</span><span class="p">((</span><span class="bp">self</span><span class="o">.</span><span class="n">false1</span> <span class="o">-</span> <span class="bp">self</span><span class="o">.</span><span class="n">false2</span><span class="p">)</span> <span class="o">*</span> <span class="n">torch</span><span class="o">.</span><span class="n">rand</span><span class="p">(</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">(),</span><span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">)</span> <span class="o">+</span> <span class="bp">self</span><span class="o">.</span><span class="n">false2</span><span class="p">)</span>
<span class="n">RandSens</span><span class="o">=</span><span class="n">torch</span><span class="o">.</span><span class="n">rand</span><span class="p">(</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">(),</span><span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">)</span>
<span class="n">RandSens</span><span class="o">=</span><span class="p">((</span><span class="n">RandSens</span> <span class="o">&lt;</span> <span class="mf">0.5</span><span class="p">)</span><span class="o">.</span><span class="n">float</span><span class="p">()</span><span class="o">+</span><span class="p">(</span><span class="n">RandSens</span> <span class="o">&gt;=</span> <span class="mf">0.5</span><span class="p">)</span><span class="o">.</span><span class="n">float</span><span class="p">()</span><span class="o">*</span><span class="p">(</span><span class="o">-</span><span class="mf">1.0</span><span class="p">))</span>
<span class="n">Offset_pos</span><span class="o">=</span><span class="n">Offset_pos</span><span class="o">*</span><span class="n">RandSens</span>
<span class="n">Offset_neg</span><span class="o">=</span><span class="n">Offset_neg</span><span class="o">*</span><span class="n">RandSens</span>
<span class="c1">#dispnoc0=torch.nan_to_num(dispnoc0, nan=0.0)</span>
<span class="n">D_pos</span><span class="o">=</span><span class="n">dispnoc0</span>
<span class="n">D_pos</span><span class="o">=</span><span class="n">dispnoc0</span><span class="o">+</span><span class="n">Offset_pos</span>
<span class="n">D_neg</span><span class="o">=</span><span class="n">dispnoc0</span><span class="o">+</span><span class="n">Offset_neg</span>
<span class="n">Index_X</span><span class="o">=</span><span class="n">torch</span><span class="o">.</span><span class="n">arange</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">],</span><span class="n">device</span><span class="o">=</span><span class="n">device</span><span class="p">)</span>
<span class="n">Index_X</span><span class="o">=</span><span class="n">Index_X</span><span class="o">.</span><span class="n">expand</span><span class="p">(</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">()[</span><span class="o">-</span><span class="mi">2</span><span class="p">],</span><span class="n">dispnoc0</span><span class="o">.</span><span class="n">size</span><span class="p">()[</span><span class="o">-</span><span class="mi">1</span><span class="p">])</span><span class="o">.</span><span class="n">unsqueeze</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="o">.</span><span class="n">unsqueeze</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="o">.</span><span class="n">repeat_interleave</span><span class="p">(</span><span class="n">x0</span><span class="o">.</span><span class="n">size</span><span class="p">()[</span><span class="mi">0</span><span class="p">],</span><span class="mi">0</span><span class="p">)</span>
Expand Down

0 comments on commit ed65c45

Please sign in to comment.