1
Fork 0

Deployed de6b038 with MkDocs version: 1.6.1

This commit is contained in:
github-actions[bot] 2026-05-19 21:05:02 +00:00
parent 26e0b9ee28
commit 281bae4df2
6 changed files with 71 additions and 50 deletions

View file

@ -313,12 +313,12 @@
<a href="#reproducibility-uv" class="md-nav__link">
<span class="md-ellipsis">
Reproducibility &amp;uv
Reproducibility &amp; uv
</span>
</a>
<nav class="md-nav" aria-label="Reproducibility &amp;uv">
<nav class="md-nav" aria-label="Reproducibility &amp; uv">
<ul class="md-nav__list">
<li class="md-nav__item">
@ -1214,12 +1214,12 @@
<a href="#reproducibility-uv" class="md-nav__link">
<span class="md-ellipsis">
Reproducibility &amp;uv
Reproducibility &amp; uv
</span>
</a>
<nav class="md-nav" aria-label="Reproducibility &amp;uv">
<nav class="md-nav" aria-label="Reproducibility &amp; uv">
<ul class="md-nav__list">
<li class="md-nav__item">
@ -1351,7 +1351,7 @@
<h1 id="development-guide">Development Guide</h1>
<p>This guide outlines how to set up the development environment for this project, prioritizing <strong>reproducible builds</strong>, <strong>environment parity</strong>, and <strong>cross-hardware compatibility</strong>.</p>
<h2 id="reproducibility-uv">Reproducibility &amp;uv</h2>
<h2 id="reproducibility-uv">Reproducibility &amp; uv</h2>
<p>This project uses <a href="https://github.com/astral-sh/uv">uv</a> to manage dependencies and virtual environments. The <code>uv.lock</code> file is the absolute source of truth for package versions and must always be committed.</p>
<h3 id="source-of-truth">Source of Truth</h3>
<ul>
@ -1390,14 +1390,16 @@
<li>The hardware-aware sync will run automatically during container creation.</li>
</ol>
<h2 id="local-development-alternative">Local Development (Alternative)</h2>
<p>If you prefer not to use Docker:
1. Install <a href="https://docs.astral.sh/uv/getting-started/installation/">uv</a>.
2. Run <code>uv sync --frozen</code> (CPU) or <code>uv sync --frozen --extra cuda</code> (GPU).</p>
<p>If you prefer not to use Docker:</p>
<ol>
<li>Install <a href="https://docs.astral.sh/uv/getting-started/installation/">uv</a>.</li>
<li>Run <code>uv sync --frozen</code> (CPU) or <code>uv sync --frozen --extra cuda</code> (GPU).</li>
</ol>
<h2 id="hardware-acceleration-jax">Hardware Acceleration (JAX)</h2>
<p>Verify your setup by running the JAX initialization test:</p>
<p><div class="highlight"><pre><span></span><code>uv<span class="w"> </span>run<span class="w"> </span>pytest<span class="w"> </span>tests/test_jax_init.py
<div class="highlight"><pre><span></span><code>uv<span class="w"> </span>run<span class="w"> </span>pytest<span class="w"> </span>tests/test_jax_init.py
</code></pre></div>
In the devcontainer, this will succeed on both CPU and GPU. A <code>GpuDevice</code> is expected if a GPU is detected and the <code>cuda</code> extra was installed.</p>
<p>In the devcontainer, this will succeed on both CPU and GPU. A <code>GpuDevice</code> is expected if a GPU is detected and the <code>cuda</code> extra was installed.</p>
<h2 id="logging-monitoring">Logging &amp; Monitoring</h2>
<p>This project uses a unified logging system through the <code>experiment_logger</code> package. </p>
<ul>

View file

@ -1350,16 +1350,22 @@ bash<span class="w"> </span>scripts/hpc/install.sh
<h3 id="verification-commands">Verification Commands</h3>
<p>After installation, run these commands to ensure your environment is set up correctly:</p>
<ol>
<li><strong>Verify Quota Safety</strong>:
<li>
<p><strong>Verify Quota Safety</strong>:
<div class="highlight"><pre><span></span><code>ls<span class="w"> </span>-d<span class="w"> </span>venvs<span class="w"> </span><span class="m">2</span>&gt;/dev/null<span class="w"> </span><span class="o">&amp;&amp;</span><span class="w"> </span><span class="nb">echo</span><span class="w"> </span><span class="s2">&quot;FAIL&quot;</span><span class="w"> </span><span class="o">||</span><span class="w"> </span><span class="nb">echo</span><span class="w"> </span><span class="s2">&quot;&gt;&gt;&gt; PASS: Project root is clean.&quot;</span>
</code></pre></div></li>
<li><strong>Verify Library Versions (NumPy Fix)</strong>:
</code></pre></div></p>
</li>
<li>
<p><strong>Verify Library Versions (NumPy Fix)</strong>:
<div class="highlight"><pre><span></span><code>python<span class="w"> </span>-c<span class="w"> </span><span class="s2">&quot;import numpy; print(f&#39;NumPy: {numpy.__version__}&#39;)&quot;</span>
<span class="c1"># Expected: 2.x.x (Venv version), not 1.2x (System version)</span>
</code></pre></div></li>
<li><strong>Verify GPU Access</strong>:
</code></pre></div></p>
</li>
<li>
<p><strong>Verify GPU Access</strong>:
<div class="highlight"><pre><span></span><code>python<span class="w"> </span>-c<span class="w"> </span><span class="s2">&quot;import torch, jax; print(f&#39;GPU: {torch.cuda.is_available()}&#39;); print(f&#39;JAX: {jax.devices()}&#39;)&quot;</span>
</code></pre></div></li>
</code></pre></div></p>
</li>
</ol>
<h2 id="managing-dependencies">Managing Dependencies</h2>
<p><code>env/hpc/requirements.txt</code> is auto-generated from <code>pyproject.toml</code>. To regenerate:</p>

View file

@ -1410,10 +1410,12 @@
<h1 id="analysis-plotting-tools">Analysis &amp; Plotting Tools</h1>
<p>This guide outlines the tools available for analyzing experimental data and generating poster-quality visualizations for the Brittle Star project.</p>
<h2 id="shared-configuration">Shared Configuration</h2>
<p>All plotting scripts share a central configuration in <code>scripts/plots/plot_config.py</code>. This file defines:
- <strong>Color Palette:</strong> A color-blind friendly, high-contrast palette for different architectures.
- <strong>Typography:</strong> Consistent font sizes and styles tailored for A0 posters.
- <strong>Markers:</strong> Shared visual indicators, such as the ★ used for best performers.</p>
<p>All plotting scripts share a central configuration in <code>scripts/plots/plot_config.py</code>. This file defines:</p>
<ul>
<li><strong>Color Palette:</strong> A color-blind friendly, high-contrast palette for different architectures.</li>
<li><strong>Typography:</strong> Consistent font sizes and styles tailored for A0 posters.</li>
<li><strong>Markers:</strong> Shared visual indicators, such as the ★ used for best performers.</li>
</ul>
<h2 id="comparison-visualization">Comparison Visualization</h2>
<p>The <code>scripts/plots/analyze_comparisons.py</code> script generates grouped bar charts comparing the performance of different architectures across various morphologies.</p>
<h3 id="usage">Usage</h3>
@ -1437,11 +1439,13 @@ uv<span class="w"> </span>run<span class="w"> </span>python<span class="w"> </sp
<li><code>--fig_width</code> / <code>--fig_height</code>: Physical dimensions of the plot in inches. Match these to your Figma layout to maintain exact font sizes.</li>
</ul>
<h3 id="outputs">Outputs</h3>
<p>The script generates four key plots, each saved as both <code>.png</code> and <code>.svg</code>:
1. <strong>Forward Velocity:</strong> Grouped bar chart (cm/s).
2. <strong>Accumulated Reward:</strong> Mean cumulative reward.
3. <strong>Success Rate:</strong> Target acquisition percentage.
4. <strong>Distance Remaining:</strong> Navigational accuracy.</p>
<p>The script generates four key plots, each saved as both <code>.png</code> and <code>.svg</code>:</p>
<ol>
<li><strong>Forward Velocity:</strong> Grouped bar chart (cm/s).</li>
<li><strong>Accumulated Reward:</strong> Mean cumulative reward.</li>
<li><strong>Success Rate:</strong> Target acquisition percentage.</li>
<li><strong>Distance Remaining:</strong> Navigational accuracy.</li>
</ol>
<hr />
<h2 id="convergence-analysis">Convergence Analysis</h2>
<p>The <code>scripts/plots/analyze_convergence.py</code> script determines the convergence point of training runs.</p>
@ -1454,18 +1458,22 @@ uv<span class="w"> </span>run<span class="w"> </span>python<span class="w"> </sp
<li><strong>CLI Arguments:</strong> Supports the same <code>--show_titles</code>, <code>--font_size</code>, and <code>--fig_width/height</code> flags as the comparison script.</li>
</ul>
<h3 id="outputs_1">Outputs</h3>
<p>Generates three plots (PNG &amp; SVG):
1. <code>convergence_comparison</code>: Grouped horizontal bar chart.
2. <code>progress_reward_curves</code>: Line plots of reward over time.
3. <code>progress_velocity_curves</code>: Line plots of velocity over time.</p>
<p>Generates three plots (PNG &amp; SVG):</p>
<ol>
<li><code>convergence_comparison</code>: Grouped horizontal bar chart.</li>
<li><code>progress_reward_curves</code>: Line plots of reward over time.</li>
<li><code>progress_velocity_curves</code>: Line plots of velocity over time.</li>
</ol>
<hr />
<h2 id="poster-integration-figma">Poster Integration (Figma)</h2>
<h3 id="svg-scaling">SVG &amp; Scaling</h3>
<p>We recommend using the <strong>SVG</strong> outputs for poster design in Figma:
1. <strong>No Resolution Loss:</strong> SVGs are vector-based and will remain sharp at any size.
2. <strong>Native Text:</strong> Text in the SVG imports as native text layers in Figma.
3. <strong>Exact Font Matching:</strong> To ensure a <code>28pt</code> font in the plot matches a <code>28pt</code> font in your poster, set the <code>--fig_width</code> and <code>--fig_height</code> to match the physical dimensions of the plot box in your Figma layout.
4. <strong>Editable:</strong> You can "Ungroup" the SVG in Figma to manually move labels, adjust colors, or tweak individual bars.</p>
<p>We recommend using the <strong>SVG</strong> outputs for poster design in Figma:</p>
<ol>
<li><strong>No Resolution Loss:</strong> SVGs are vector-based and will remain sharp at any size.</li>
<li><strong>Native Text:</strong> Text in the SVG imports as native text layers in Figma.</li>
<li><strong>Exact Font Matching:</strong> To ensure a <code>28pt</code> font in the plot matches a <code>28pt</code> font in your poster, set the <code>--fig_width</code> and <code>--fig_height</code> to match the physical dimensions of the plot box in your Figma layout.</li>
<li><strong>Editable:</strong> You can "Ungroup" the SVG in Figma to manually move labels, adjust colors, or tweak individual bars.</li>
</ol>
<h3 id="image-placeholders">Image Placeholders</h3>
<p>The comparison charts include light-gray square placeholders below the X-axis. These are designed as guides; in Figma, you can drop your morphology renders or illustrations directly on top of these squares.</p>

View file

@ -1179,20 +1179,26 @@
that creates instances of the environment/morphologies/... It uses the
configuration classes defined in <code>env_config.py</code> to create the instances.</p>
<h2 id="configuration">Configuration</h2>
<p>The data classes in <code>env_config</code> have default values as stated in the tutorials.
* MorphologyConfig: configuration for the morphology of the brittle star. Contains
number of arms, number of segments per arm, and control mode.
* ArenaConfig: configuration for the arena. Sets the size of the arena, whether to
set the ground floor to sand, attach a target and sizes of the walls.
* EnvConfig: configuration for the environment. These set shared settings
such as camera locations, simulation time and the task.</p>
<p>The data classes in <code>env_config</code> have default values as stated in the tutorials.</p>
<ul>
<li>MorphologyConfig: configuration for the morphology of the brittle star. Contains
number of arms, number of segments per arm, and control mode.</li>
<li>ArenaConfig: configuration for the arena. Sets the size of the arena, whether to
set the ground floor to sand, attach a target and sizes of the walls.</li>
<li>EnvConfig: configuration for the environment. These set shared settings
such as camera locations, simulation time and the task.</li>
</ul>
<h2 id="backend-and-task-enums">Backend and Task enums</h2>
<p>The Backend enum specifies either an MJC or MJX backend.
* MJC: runs on CPU
* MJX: uses jax on the gpu</p>
<p>The Task enum specifies which task to use. 2 items are present:
* DIRECTED_LOCOMOTION: move to a target location
* LIGHT_ESCAPE: situation where the robot must move to a darker location</p>
<p>The Backend enum specifies either an MJC or MJX backend.</p>
<ul>
<li>MJC: runs on CPU</li>
<li>MJX: uses jax on the gpu</li>
</ul>
<p>The Task enum specifies which task to use. 2 items are present:</p>
<ul>
<li>DIRECTED_LOCOMOTION: move to a target location</li>
<li>LIGHT_ESCAPE: situation where the robot must move to a darker location</li>
</ul>

View file

@ -1182,8 +1182,7 @@ inputs must be distributed fairly to guarantee an objective comparison between d
<li>The reward function is centered around minimizing the distance to the goal or maximizing the movement towards the goal
within a finite number of timesteps $T$.</li>
<li>To motivate efficient movement, the amount of timesteps taken to reach the goal will be used as penalty.</li>
<li>An extra penalty based on movement relative to the current step and
the previous is used to penalize a movement away from the target.</li>
<li>An extra penalty based on movement relative to the current step and the previous is used to penalize a movement away from the target.</li>
</ul>
<h2 id="from-reward-to-ppo">From reward to PPO</h2>
<p>The resulting reward is passed to our PPO library. Our critic network (value function) predicts how good our eventual reward will be for the current state, this value is combined with the reward from the reward function to get advantages. These advantages are then used to calculate the losses to update both our critic and actor pipeline.</p>

File diff suppressed because one or more lines are too long