Skip to content

Commit

Permalink
Deployed 01c687e with MkDocs version: 1.5.3
Browse files Browse the repository at this point in the history
  • Loading branch information
michaeldeistler committed Aug 20, 2024
1 parent 2ff9763 commit 7b70ed7
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

Binary file modified sitemap.xml.gz
Binary file not shown.
14 changes: 7 additions & 7 deletions tutorial/03_setting_parameters/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -991,9 +991,7 @@ <h1 id="setting-parameters-and-initial-states">Setting parameters and initial st
<span class="n">fully_connect</span><span class="p">(</span><span class="n">net</span><span class="o">.</span><span class="n">cell</span><span class="p">(</span><span class="mi">0</span><span class="p">),</span> <span class="n">net</span><span class="o">.</span><span class="n">cell</span><span class="p">(</span><span class="mi">1</span><span class="p">),</span> <span class="n">IonotropicSynapse</span><span class="p">())</span>
<span class="n">net</span><span class="o">.</span><span class="n">IonotropicSynapse</span><span class="p">()</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;IonotropicSynapse_gS&quot;</span><span class="p">,</span> <span class="mf">0.01</span><span class="p">)</span>
</code></pre></div></p>
<p>In the previous two tutorials, you learned how to build single cells or networks and how to simulate them. In this tutorial, you will learn how to speed up such simulations by many orders of magnitude. This can be achieved in to ways:
- by using JIT compilation<br />
- by using GPU parallelization</p>
<p>In the previous two tutorials, you learned how to build single cells or networks and how to simulate them. In this tutorial, you will learn how to change parameters of such simulations.</p>
<p>Let&rsquo;s get started!</p>
<div class="highlight"><pre><span></span><code><span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="kn">import</span> <span class="nn">numpy</span> <span class="k">as</span> <span class="nn">np</span>
Expand Down Expand Up @@ -1024,10 +1022,12 @@ <h3 id="setting-parameters-in-jaxley">Setting parameters in <code>Jaxley</code><
</code></pre></div></p>
<p>You can always inspect the current parameters by inspecting <code>cell.nodes</code>, which is a pandas Dataframe that contains all information about the cell. You can use <code>.set()</code> to set morphological parameters, channel parameters, synaptic parameters, and initial states, as outlined below:</p>
<h3 id="setting-morphological-parameters">Setting morphological parameters<a class="headerlink" href="#setting-morphological-parameters" title="Permanent link">&para;</a></h3>
<p><code>Jaxley</code> allows to set the following morphological parameters:
- <code>radius</code>: the radius of the (zylindrical) compartment (in micrometer)
- <code>length</code>: the length of the zylindrical compartment (in micrometer)
- <code>axial_resistivity</code>: the resistivity of current flow between compartments (in ohm centimeter)</p>
<p><code>Jaxley</code> allows to set the following morphological parameters:</p>
<ul>
<li><code>radius</code>: the radius of the (zylindrical) compartment (in micrometer) </li>
<li><code>length</code>: the length of the zylindrical compartment (in micrometer) </li>
<li><code>axial_resistivity</code>: the resistivity of current flow between compartments (in ohm centimeter) </li>
</ul>
<div class="highlight"><pre><span></span><code><span class="n">cell</span><span class="o">.</span><span class="n">branch</span><span class="p">(</span><span class="mi">0</span><span class="p">)</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;axial_resistivity&quot;</span><span class="p">,</span> <span class="mf">1000.0</span><span class="p">)</span>
<span class="n">cell</span><span class="o">.</span><span class="n">set</span><span class="p">(</span><span class="s2">&quot;length&quot;</span><span class="p">,</span> <span class="mf">1.0</span><span class="p">)</span> <span class="c1"># This will set every compartment in the cell to have length 1.0.</span>
</code></pre></div>
Expand Down
12 changes: 7 additions & 5 deletions tutorial/04_jit_and_vmap/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -1020,9 +1020,11 @@ <h1 id="speeding-up-simulations-with-jit-compilation-and-gpus">Speeding up simul
<span class="n">vmapped_simulate</span> <span class="o">=</span> <span class="n">vmap</span><span class="p">(</span><span class="n">jitted_simulate</span><span class="p">,</span> <span class="n">in_axes</span><span class="o">=</span><span class="p">(</span><span class="mi">0</span><span class="p">,))</span>
<span class="n">voltages</span> <span class="o">=</span> <span class="n">vmapped_simulate</span><span class="p">(</span><span class="n">all_params</span><span class="p">)</span>
</code></pre></div></p>
<p>In the previous two tutorials, you learned how to build single cells or networks and how to simulate them. In this tutorial, you will learn how to speed up such simulations by many orders of magnitude. This can be achieved in to ways:
- by using JIT compilation<br />
- by using GPU parallelization</p>
<p>In the previous tutorials, you learned how to build single cells or networks and how to change their parameters. In this tutorial, you will learn how to speed up such simulations by many orders of magnitude. This can be achieved in to ways:</p>
<ul>
<li>by using JIT compilation </li>
<li>by using GPU parallelization </li>
</ul>
<p>Let&rsquo;s get started!</p>
<h3 id="using-gpu-or-cpu">Using GPU or CPU<a class="headerlink" href="#using-gpu-or-cpu" title="Permanent link">&para;</a></h3>
<p>In <code>Jaxley</code> you can set whether you want to use <code>gpu</code> or <code>cpu</code> with the following lines at the beginning of your script:</p>
Expand Down Expand Up @@ -1073,8 +1075,8 @@ <h3 id="parameter-sweeps">Parameter sweeps<a class="headerlink" href="#parameter
<span class="n">param_state</span> <span class="o">=</span> <span class="n">cell</span><span class="o">.</span><span class="n">data_set</span><span class="p">(</span><span class="s2">&quot;K_gK&quot;</span><span class="p">,</span> <span class="n">params</span><span class="p">[</span><span class="mi">1</span><span class="p">],</span> <span class="n">param_state</span><span class="p">)</span>
<span class="k">return</span> <span class="n">jx</span><span class="o">.</span><span class="n">integrate</span><span class="p">(</span><span class="n">cell</span><span class="p">,</span> <span class="n">param_state</span><span class="o">=</span><span class="n">param_state</span><span class="p">)</span>
</code></pre></div>
<p>The <code>.data_set()</code> method takes three arguments:
1) the name of the parameter you want to set. <code>Jaxley</code> allows to set the following parameters:
<p>The <code>.data_set()</code> method takes three arguments: </p>
<p>1) the name of the parameter you want to set. <code>Jaxley</code> allows to set the following parameters: &ldquo;radius&rdquo;, &ldquo;length&rdquo;, &ldquo;axial_resistivity&rdquo;, as well as all parameters of channels and synapses.<br />
2) the value of the parameter.<br />
3) a <code>param_state</code> which is initialized as <code>None</code> and is modified by <code>.data_set()</code>. This has to be passed to <code>jx.integrate()</code>. </p>
<p>Having done this, the simplest (but least efficient) way to perform the parameter sweep is to run a for-loop over many parameter sets:</p>
Expand Down

0 comments on commit 7b70ed7

Please sign in to comment.