Skip to content

Commit

Permalink
deploy: 6a66281
Browse files Browse the repository at this point in the history
  • Loading branch information
dragonfly-ai committed Oct 4, 2023
1 parent 81d6e92 commit 32dab50
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 34 deletions.
34 changes: 17 additions & 17 deletions basics/getting_started.html
Original file line number Diff line number Diff line change
Expand Up @@ -124,19 +124,19 @@ <h2 id="creating-a-vector" class="section"><a class="anchor-link left" href="#cr

</span><span class="keyword">val</span><span> </span><span class="identifier">v_rand</span><span> = </span><span class="type-name">Vec</span><span>.</span><span class="identifier">random</span><span>[</span><span class="number-literal">5</span><span>]()
</span><span class="comment">// v_rand: Vec[5] = Array(
// -0.20352537238944035,
// -0.02491528862855108,
// -0.39325785054630713,
// -0.8501951021363982,
// -0.5439307481683034
// -0.22947769588402422,
// -0.6698438809908556,
// -0.7074388478575468,
// -0.24622548694297253,
// -0.6926722879363331
// )
</span><span class="keyword">val</span><span> </span><span class="identifier">v_rand_max_min</span><span> = </span><span class="type-name">Vec</span><span>.</span><span class="identifier">random</span><span>[</span><span class="number-literal">5</span><span>](</span><span class="number-literal">2.0</span><span>, </span><span class="number-literal">0.5</span><span>)
</span><span class="comment">// v_rand_max_min: Vec[5] = Array(
// 0.9676979626464479,
// 1.2621031761299732,
// 1.6892782359679228,
// 0.5255711219991179,
// 1.3653099389191805
// 1.0229463533013234,
// 0.5550084637256207,
// 1.974303606839591,
// 1.4764157478549798,
// 1.938727543614427
// )</span></code></pre>
<p>And do some stuff</p>
<pre><code class="nohighlight"><span class="identifier">v</span><span> + </span><span class="identifier">v_fill</span><span>
Expand All @@ -147,11 +147,11 @@ <h2 id="creating-a-vector" class="section"><a class="anchor-link left" href="#cr
</span><span>
</span><span class="identifier">v_rand</span><span> -= </span><span class="identifier">v_ones</span><span>
</span><span class="comment">// res2: Vec[5] = Array(
// -0.20352537238944035,
// -0.02491528862855108,
// -0.39325785054630713,
// -0.8501951021363982,
// -0.5439307481683034
// -0.22947769588402422,
// -0.6698438809908556,
// -0.7074388478575468,
// -0.24622548694297253,
// -0.6926722879363331
// )
</span><span>
</span><span class="comment">// native indexing is fast...
Expand All @@ -165,10 +165,10 @@ <h2 id="creating-a-vector" class="section"><a class="anchor-link left" href="#cr
</span><span class="comment">// res6: Double = 3.0
</span><span>
</span><span class="identifier">v</span><span>.</span><span class="identifier">corr</span><span>(</span><span class="identifier">v_rand</span><span>)
</span><span class="comment">// res7: Double = -0.7505371583106978
</span><span class="comment">// res7: Double = -0.3204459909845354
</span><span>
</span><span class="identifier">v_rand</span><span>.</span><span class="identifier">elementRanks</span><span>
</span><span class="comment">// res8: Vec[5] = Array(4.0, 5.0, 3.0, 1.0, 2.0)</span></code></pre>
</span><span class="comment">// res8: Vec[5] = Array(5.0, 3.0, 1.0, 4.0, 2.0)</span></code></pre>


<hr class="footer-rule"/>
Expand Down
34 changes: 17 additions & 17 deletions demo/poisson.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,57 +126,57 @@ <h1 id="poisson-distribution" class="title">Poisson Distribution</h1>
</span><span class="comment">// res2: Double = 1.0
</span><span>
</span><span class="keyword">val</span><span> </span><span class="identifier">rand</span><span> = </span><span class="identifier">ai</span><span>.</span><span class="identifier">dragonfly</span><span>.</span><span class="identifier">math</span><span>.</span><span class="type-name">Random</span><span>.</span><span class="identifier">defaultRandom</span><span>
</span><span class="comment">// rand: Random = scala.util.Random@354d6cbc
</span><span class="comment">// rand: Random = scala.util.Random@548cc01b
</span><span class="keyword">type</span><span> </span><span class="type-name">N</span><span> = </span><span class="number-literal">10000</span><span>
</span><span class="keyword">val</span><span> </span><span class="identifier">v</span><span> : </span><span class="type-name">NArray</span><span>[</span><span class="type-name">Long</span><span>] = </span><span class="identifier">dist1</span><span>.</span><span class="identifier">sample</span><span>(</span><span class="number-literal">10000</span><span>, </span><span class="identifier">rand</span><span>)
</span><span class="comment">// v: Array[Long] = Array(
// 0L,
// 1L,
// 1L,
// 2L,
// 3L,
// 1L,
// 0L,
// 1L,
// 1L,
// 1L,
// 1L,
// 2L,
// 3L,
// 0L,
// 0L,
// 1L,
// 0L,
// 0L,
// 2L,
// 0L,
// 2L,
// 0L,
// 1L,
// 0L,
// 0L,
// 0L,
// 1L,
// 0L,
// 0L,
// 0L,
// 2L,
// 1L,
// 0L,
// 3L,
// 2L,
// 0L,
// 1L,
// 0L,
// 3L,
// 1L,
// 0L,
// 0L,
// 1L,
// 0L,
// 1L,
// 0L,
// 0L,
// 1L,
// 2L,
// 0L,
// 2L,
// 1L,
// 0L,
// 2L,
// 0L,
// 0L,
// 2L,
// 3L,
// 2L,
// 1L,
// 0L,
// 0L,
// 1L,
// 0L,
// ...</span></code></pre>

Expand Down

0 comments on commit 32dab50

Please sign in to comment.