Skip to content

Commit 0c92759

Browse files
Deploy PR #23 preview
1 parent 9b34f4f commit 0c92759

7 files changed

Lines changed: 17 additions & 9 deletions

File tree

pr-23/_sources/api/algorithms.rst.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,13 +119,13 @@ Logged metrics include:
119119
Checkpointing
120120
-------------
121121

122-
Checkpoints are saved automatically:
122+
Checkpoints are saved automatically in safetensors format:
123123

124-
- ``checkpoint_last.pt``: Most recent checkpoint (frequency controlled by ``logging.checkpoint_freq``)
125-
- ``checkpoint_best.pt``: Best performing checkpoint
124+
- ``checkpoint_last.safetensors``: Most recent checkpoint (frequency controlled by ``logging.checkpoint_freq``)
125+
- ``checkpoint_best.safetensors``: Best performing checkpoint
126126

127127
Load a checkpoint:
128128

129129
.. code-block:: bash
130130
131-
python -m twisterl.train --config config.json --load_checkpoint_path runs/my_run/checkpoint_best.pt
131+
python -m twisterl.train --config config.json --load_checkpoint_path runs/my_run/checkpoint_best.safetensors

pr-23/_sources/api/environments.rst.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ All environments must provide these methods (called from Rust or Python):
9696
- ``step(action)``: Take action, return (obs, reward, done, info)
9797
- ``obs_shape()``: Return observation dimensions
9898
- ``num_actions()``: Return number of valid actions
99+
- ``is_final()``: Return True if current state is terminal
100+
- ``success()``: Return True if the goal was achieved (episode ended successfully)
101+
- ``reward()``: Return the reward value for the current state
99102
- ``twists()``: Return permutation symmetries (optional)
100103
- ``set_state(state)``: Set environment to specific state (for inference)
101104
- ``difficulty``: Property to get/set difficulty level

pr-23/_sources/api/twisterl.rst.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ Key functions:
4444

4545
- ``prepare_algorithm(config, run_path, load_checkpoint_path)``: Prepares an algorithm instance from config
4646
- ``load_config(config_path)``: Loads a JSON config file
47+
- ``load_checkpoint(checkpoint_path)``: Loads a checkpoint from either safetensors or pt format
4748
- ``pull_hub_algorithm(repo_id, model_path, revision, validate)``: Downloads models from HuggingFace Hub
4849

4950
twisterl.defaults module

pr-23/api/algorithms.html

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,13 +192,13 @@ <h2>Metrics and Logging<a class="headerlink" href="#metrics-and-logging" title="
192192
</section>
193193
<section id="checkpointing">
194194
<h2>Checkpointing<a class="headerlink" href="#checkpointing" title="Link to this heading"></a></h2>
195-
<p>Checkpoints are saved automatically:</p>
195+
<p>Checkpoints are saved automatically in safetensors format:</p>
196196
<ul class="simple">
197-
<li><p><code class="docutils literal notranslate"><span class="pre">checkpoint_last.pt</span></code>: Most recent checkpoint (frequency controlled by <code class="docutils literal notranslate"><span class="pre">logging.checkpoint_freq</span></code>)</p></li>
198-
<li><p><code class="docutils literal notranslate"><span class="pre">checkpoint_best.pt</span></code>: Best performing checkpoint</p></li>
197+
<li><p><code class="docutils literal notranslate"><span class="pre">checkpoint_last.safetensors</span></code>: Most recent checkpoint (frequency controlled by <code class="docutils literal notranslate"><span class="pre">logging.checkpoint_freq</span></code>)</p></li>
198+
<li><p><code class="docutils literal notranslate"><span class="pre">checkpoint_best.safetensors</span></code>: Best performing checkpoint</p></li>
199199
</ul>
200200
<p>Load a checkpoint:</p>
201-
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python<span class="w"> </span>-m<span class="w"> </span>twisterl.train<span class="w"> </span>--config<span class="w"> </span>config.json<span class="w"> </span>--load_checkpoint_path<span class="w"> </span>runs/my_run/checkpoint_best.pt
201+
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>python<span class="w"> </span>-m<span class="w"> </span>twisterl.train<span class="w"> </span>--config<span class="w"> </span>config.json<span class="w"> </span>--load_checkpoint_path<span class="w"> </span>runs/my_run/checkpoint_best.safetensors
202202
</pre></div>
203203
</div>
204204
</section>

pr-23/api/environments.html

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -182,6 +182,9 @@ <h2>Environment Interface<a class="headerlink" href="#environment-interface" tit
182182
<li><p><code class="docutils literal notranslate"><span class="pre">step(action)</span></code>: Take action, return (obs, reward, done, info)</p></li>
183183
<li><p><code class="docutils literal notranslate"><span class="pre">obs_shape()</span></code>: Return observation dimensions</p></li>
184184
<li><p><code class="docutils literal notranslate"><span class="pre">num_actions()</span></code>: Return number of valid actions</p></li>
185+
<li><p><code class="docutils literal notranslate"><span class="pre">is_final()</span></code>: Return True if current state is terminal</p></li>
186+
<li><p><code class="docutils literal notranslate"><span class="pre">success()</span></code>: Return True if the goal was achieved (episode ended successfully)</p></li>
187+
<li><p><code class="docutils literal notranslate"><span class="pre">reward()</span></code>: Return the reward value for the current state</p></li>
185188
<li><p><code class="docutils literal notranslate"><span class="pre">twists()</span></code>: Return permutation symmetries (optional)</p></li>
186189
<li><p><code class="docutils literal notranslate"><span class="pre">set_state(state)</span></code>: Set environment to specific state (for inference)</p></li>
187190
<li><p><code class="docutils literal notranslate"><span class="pre">difficulty</span></code>: Property to get/set difficulty level</p></li>

pr-23/api/twisterl.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ <h2>twisterl.utils module<a class="headerlink" href="#twisterl-utils-module" tit
133133
<ul class="simple">
134134
<li><p><code class="docutils literal notranslate"><span class="pre">prepare_algorithm(config,</span> <span class="pre">run_path,</span> <span class="pre">load_checkpoint_path)</span></code>: Prepares an algorithm instance from config</p></li>
135135
<li><p><code class="docutils literal notranslate"><span class="pre">load_config(config_path)</span></code>: Loads a JSON config file</p></li>
136+
<li><p><code class="docutils literal notranslate"><span class="pre">load_checkpoint(checkpoint_path)</span></code>: Loads a checkpoint from either safetensors or pt format</p></li>
136137
<li><p><code class="docutils literal notranslate"><span class="pre">pull_hub_algorithm(repo_id,</span> <span class="pre">model_path,</span> <span class="pre">revision,</span> <span class="pre">validate)</span></code>: Downloads models from HuggingFace Hub</p></li>
137138
</ul>
138139
</section>

pr-23/searchindex.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)