Skip to content

Commit

Permalink
deploy: e559799
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Oct 14, 2024
1 parent 4877d0f commit a177960
Show file tree
Hide file tree
Showing 22 changed files with 144 additions and 52 deletions.
2 changes: 1 addition & 1 deletion 404.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


<link rel="icon" href="/assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.39">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.40">



Expand Down
2 changes: 1 addition & 1 deletion api/public/API/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


<link rel="icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.39">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.40">



Expand Down
24 changes: 19 additions & 5 deletions api/public/cmf/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


<link rel="icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.39">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.40">



Expand Down Expand Up @@ -1320,6 +1320,11 @@ <h1 id="cmflibcmf">cmflib.cmf<a class="headerlink" href="#cmflibcmf" title="Perm
--neo4j-uri bolt://localhost:7687
</code></pre></div></p>






<details class="quote">
<summary>Source code in <code>cmflib/cmf.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">114</span>
Expand Down Expand Up @@ -1749,7 +1754,7 @@ <h2 id="cmflib.cmf.Cmf.create_execution" class="doc doc-heading">
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="ml_metadata.proto.metadata_store_pb2.Execution">Execution</span></code>
<code>Execution</code>
</td>
<td>
<div class="doc-md-description">
Expand Down Expand Up @@ -4199,7 +4204,7 @@ <h2 id="cmflib.cmf.Cmf.create_dataslice" class="doc doc-heading">
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="cmflib.cmf.Cmf.DataSlice">DataSlice</span></code>
<code>DataSlice</code>
</td>
<td>
<div class="doc-md-description">
Expand Down Expand Up @@ -4364,6 +4369,11 @@ <h2 id="cmflib.cmf.Cmf.update_dataslice" class="doc doc-heading">








<div class="doc doc-children">


Expand Down Expand Up @@ -4979,7 +4989,9 @@ <h2 id="cmflib.cmf.artifact_pull" class="doc doc-heading">
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>pipeline_name</code></td>
<td>
<code>pipeline_name</code>
</td>
<td>
<code>str</code>
</td>
Expand All @@ -4993,7 +5005,9 @@ <h2 id="cmflib.cmf.artifact_pull" class="doc doc-heading">
</td>
</tr>
<tr class="doc-section-item">
<td><code>filepath</code></td>
<td>
<code>filepath</code>
</td>
<td>
</td>
<td>
Expand Down
28 changes: 23 additions & 5 deletions api/public/cmf_ray_logger/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@


<link rel="icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.39">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.40">



Expand Down Expand Up @@ -871,10 +871,12 @@ <h3 id="initialization">Initialization<a class="headerlink" href="#initializatio
<li>pipeline_name: A string representing the name of the CMF pipeline.</li>
<li>file_path: The file path to the metadata file associated with the CMF pipeline.</li>
<li>pipeline_stage: The name of the current stage of the CMF pipeline.</li>
<li>data_dir (optional): A directory path where trial data should be logged. If the path is within the CMF directory, it should be relative. If it is outside, it must be an absolute path. Default vale is <code>None</code>.</li>
</ul>
<p>Example of instantiation:
<div class="highlight"><pre><span></span><code><span class="n">logger</span> <span class="o">=</span> <span class="n">cmf_ray_logger</span><span class="o">.</span><span class="n">CmfRayLogger</span><span class="p">(</span><span class="n">pipeline_name</span><span class="p">,</span> <span class="n">file_path</span><span class="p">,</span> <span class="n">pipeline_stage</span><span class="p">)</span>
</code></pre></div></p>
<div class="highlight"><pre><span></span><code><span class="n">logger</span> <span class="o">=</span> <span class="n">cmf_ray_logger</span><span class="o">.</span><span class="n">CmfRayLogger</span><span class="p">(</span><span class="n">pipeline_name</span><span class="p">,</span> <span class="n">file_path</span><span class="p">,</span> <span class="n">pipeline_stage</span><span class="o">.</span> <span class="n">data_dir</span><span class="p">)</span>
</code></pre></div>
Here, the <code>data_dir</code> argument is used to log the dataset at the start of each trial. Ensure that this path is relative if within the CMF directory and absolute if external to the CMF directory.</p>
<h2 id="integration-with-ray-tune">Integration with Ray Tune<a class="headerlink" href="#integration-with-ray-tune" title="Permanent link">&para;</a></h2>
<p>After initializing the logger, it should be passed to Ray Tune’s <code>tune.run</code> method via the <code>callbacks</code> parameter. This setup allows <code>CmfRayLogger</code> to log metrics for each trial based on the pipeline configuration and trial execution details.</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">ray</span> <span class="kn">import</span> <span class="n">tune</span>
Expand All @@ -890,15 +892,24 @@ <h2 id="integration-with-ray-tune">Integration with Ray Tune<a class="headerlink
<span class="n">callbacks</span><span class="o">=</span><span class="p">[</span><span class="n">logger</span><span class="p">]</span>
<span class="p">)</span>
</code></pre></div>
<h2 id="model-logging">Model Logging<a class="headerlink" href="#model-logging" title="Permanent link">&para;</a></h2>
<p><code>CmfRayLogger</code> can now log the model during trials. To enable this, the <code>train.report</code> method must include a special key: <code>"model_path"</code>. The value of <code>"model_path"</code> should be a relative path pointing to the saved model within the CMF directory.</p>
<p>Important: Ensure that the <code>"model_path"</code> is relative, as the DVC wrapper expects all paths nested within the CMF directory to be relative.
<div class="highlight"><pre><span></span><code><span class="n">train</span><span class="o">.</span><span class="n">report</span><span class="p">({</span>
<span class="s2">&quot;accuracy&quot;</span><span class="p">:</span> <span class="mf">0.95</span><span class="p">,</span>
<span class="s2">&quot;loss&quot;</span><span class="p">:</span> <span class="mf">0.05</span><span class="p">,</span>
<span class="s2">&quot;model_path&quot;</span><span class="p">:</span> <span class="s2">&quot;models/example_model.pth&quot;</span>
<span class="p">})</span>
</code></pre></div></p>
<h2 id="output">Output<a class="headerlink" href="#output" title="Permanent link">&para;</a></h2>
<p>During each trial, <code>CmfRayLogger</code> will automatically create a CMF object with attributes set as <code>pipeline_name</code>, <code>pipeline_stage</code>, and the CMF execution as <code>trial_id</code>. It captures the trial's output and logs it under the metric key <code>'Output'</code>.</p>
<p>During each trial, <code>CmfRayLogger</code> will automatically create a CMF object with attributes set as <code>pipeline_name</code>, <code>pipeline_stage</code>, and the CMF execution as <code>trial_id</code>. It captures the trial's output and logs it under the metric key <code>'Output'</code>. Additionally, it logs the dataset at the start of each trial (if data_dir is specified) and logs the model based on the <code>"model_path"</code> key in <code>train.report</code>.</p>
<h2 id="example">Example<a class="headerlink" href="#example" title="Permanent link">&para;</a></h2>
<p>Here is a complete example of how to use <code>CmfRayLogger</code> with Ray Tune:</p>
<div class="highlight"><pre><span></span><code><span class="kn">from</span> <span class="nn">cmf</span> <span class="kn">import</span> <span class="n">cmf_ray_logger</span>
<span class="kn">from</span> <span class="nn">ray</span> <span class="kn">import</span> <span class="n">tune</span>

<span class="c1"># Initialize the logger</span>
<span class="n">logger</span> <span class="o">=</span> <span class="n">cmf_ray_logger</span><span class="o">.</span><span class="n">CmfRayLogger</span><span class="p">(</span><span class="s2">&quot;ExamplePipeline&quot;</span><span class="p">,</span> <span class="s2">&quot;/path/to/metadata.json&quot;</span><span class="p">,</span> <span class="s2">&quot;Stage1&quot;</span><span class="p">)</span>
<span class="n">logger</span> <span class="o">=</span> <span class="n">cmf_ray_logger</span><span class="o">.</span><span class="n">CmfRayLogger</span><span class="p">(</span><span class="s2">&quot;ExamplePipeline&quot;</span><span class="p">,</span> <span class="s2">&quot;/path/to/metadata.json&quot;</span><span class="p">,</span> <span class="s2">&quot;Stage1&quot;</span><span class="p">,</span> <span class="s2">&quot;path/to/data_dir&quot;</span><span class="p">)</span>

<span class="c1"># Configuration for tuning</span>
<span class="n">config</span> <span class="o">=</span> <span class="p">{</span>
Expand All @@ -911,6 +922,13 @@ <h2 id="example">Example<a class="headerlink" href="#example" title="Permanent l
<span class="n">config</span><span class="o">=</span><span class="n">config</span><span class="p">,</span>
<span class="n">callbacks</span><span class="o">=</span><span class="p">[</span><span class="n">logger</span><span class="p">]</span>
<span class="p">)</span>

<span class="c1"># Reporting within your trainable function</span>
<span class="n">train</span><span class="o">.</span><span class="n">report</span><span class="p">({</span>
<span class="s2">&quot;accuracy&quot;</span><span class="p">:</span> <span class="mf">0.95</span><span class="p">,</span>
<span class="s2">&quot;loss&quot;</span><span class="p">:</span> <span class="mf">0.05</span><span class="p">,</span>
<span class="s2">&quot;model_path&quot;</span><span class="p">:</span> <span class="s2">&quot;path/to/models/example_model.pth&quot;</span>
<span class="p">})</span>
</code></pre></div>


Expand Down
79 changes: 55 additions & 24 deletions api/public/cmfquery/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


<link rel="icon" href="../../../assets/images/favicon.png">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.39">
<meta name="generator" content="mkdocs-1.6.1, mkdocs-material-9.5.40">



Expand Down Expand Up @@ -1316,7 +1316,9 @@ <h1 id="cmflibcmfquerycmfquery">cmflib.cmfquery.CmfQuery<a class="headerlink" hr
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>filepath</code></td>
<td>
<code>filepath</code>
</td>
<td>
<code>str</code>
</td>
Expand All @@ -1332,6 +1334,11 @@ <h1 id="cmflibcmfquerycmfquery">cmflib.cmfquery.CmfQuery<a class="headerlink" hr
</tbody>
</table>






<details class="quote">
<summary>Source code in <code>cmflib/cmfquery.py</code></summary>
<div class="highlight"><table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><span></span><span class="normal">116</span>
Expand Down Expand Up @@ -1381,7 +1388,7 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_pipeline_names" class="doc doc-heading">
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.List">List</span>[str]</code>
<code>List[str]</code>
</td>
<td>
<div class="doc-md-description">
Expand Down Expand Up @@ -1481,7 +1488,9 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_pipeline_stages" class="doc doc-heading">
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>pipeline_name</code></td>
<td>
<code>pipeline_name</code>
</td>
<td>
<code>str</code>
</td>
Expand Down Expand Up @@ -1559,7 +1568,9 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_all_exe_in_stage" class="doc doc-heading">
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>stage_name</code></td>
<td>
<code>stage_name</code>
</td>
<td>
<code>str</code>
</td>
Expand Down Expand Up @@ -1639,9 +1650,11 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_all_executions_by_ids_list" class="doc doc-
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>exe_ids</code></td>
<td>
<code><span title="typing.List">List</span>[int]</code>
<code>exe_ids</code>
</td>
<td>
<code>List[int]</code>
</td>
<td>
<div class="doc-md-description">
Expand All @@ -1667,7 +1680,7 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_all_executions_by_ids_list" class="doc doc-
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="pandas.DataFrame">DataFrame</span></code>
<code>DataFrame</code>
</td>
<td>
<div class="doc-md-description">
Expand Down Expand Up @@ -1743,7 +1756,9 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_all_artifacts_by_context" class="doc doc-he
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>pipeline_name</code></td>
<td>
<code>pipeline_name</code>
</td>
<td>
<code>str</code>
</td>
Expand Down Expand Up @@ -1771,7 +1786,7 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_all_artifacts_by_context" class="doc doc-he
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="pandas.DataFrame">DataFrame</span></code>
<code>DataFrame</code>
</td>
<td>
<div class="doc-md-description">
Expand Down Expand Up @@ -1857,9 +1872,11 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_all_artifacts_by_ids_list" class="doc doc-h
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>artifact_ids</code></td>
<td>
<code><span title="typing.List">List</span>[int]</code>
<code>artifact_ids</code>
</td>
<td>
<code>List[int]</code>
</td>
<td>
<div class="doc-md-description">
Expand All @@ -1885,7 +1902,7 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_all_artifacts_by_ids_list" class="doc doc-h
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="pandas.DataFrame">DataFrame</span></code>
<code>DataFrame</code>
</td>
<td>
<div class="doc-md-description">
Expand Down Expand Up @@ -2017,9 +2034,11 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_artifact_df" class="doc doc-heading">
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>artifact</code></td>
<td>
<code><span title="ml_metadata.proto.metadata_store_pb2.Artifact">Artifact</span></code>
<code>artifact</code>
</td>
<td>
<code>Artifact</code>
</td>
<td>
<div class="doc-md-description">
Expand All @@ -2031,9 +2050,11 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_artifact_df" class="doc doc-heading">
</td>
</tr>
<tr class="doc-section-item">
<td><code>d</code></td>
<td>
<code><span title="typing.Optional">Optional</span>[<span title="typing.Dict">Dict</span>]</code>
<code>d</code>
</td>
<td>
<code>Optional[Dict]</code>
</td>
<td>
<div class="doc-md-description">
Expand Down Expand Up @@ -2125,7 +2146,7 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_all_artifacts" class="doc doc-heading">
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.List">List</span>[str]</code>
<code>List[str]</code>
</td>
<td>
<div class="doc-md-description">
Expand Down Expand Up @@ -2183,7 +2204,9 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_artifact" class="doc doc-heading">
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>name</code></td>
<td>
<code>name</code>
</td>
<td>
<code>str</code>
</td>
Expand Down Expand Up @@ -2258,7 +2281,9 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_all_artifacts_for_execution" class="doc doc
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>execution_id</code></td>
<td>
<code>execution_id</code>
</td>
<td>
<code>int</code>
</td>
Expand Down Expand Up @@ -2340,7 +2365,7 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_all_artifact_types" class="doc doc-heading"
<tbody>
<tr class="doc-section-item">
<td>
<code><span title="typing.List">List</span>[str]</code>
<code>List[str]</code>
</td>
<td>
<div class="doc-md-description">
Expand Down Expand Up @@ -2402,7 +2427,9 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_all_executions_for_artifact" class="doc doc
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>artifact_name</code></td>
<td>
<code>artifact_name</code>
</td>
<td>
<code>str</code>
</td>
Expand Down Expand Up @@ -2517,7 +2544,9 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_one_hop_child_artifacts" class="doc doc-hea
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>artifact</code></td>
<td>
<code>artifact</code>
</td>
<td>
<code>name</code>
</td>
Expand Down Expand Up @@ -2602,7 +2631,9 @@ <h2 id="cmflib.cmfquery.CmfQuery.get_all_child_artifacts" class="doc doc-heading
</thead>
<tbody>
<tr class="doc-section-item">
<td><code>artifact_name</code></td>
<td>
<code>artifact_name</code>
</td>
<td>
<code>str</code>
</td>
Expand Down
Loading

0 comments on commit a177960

Please sign in to comment.