Skip to content

Commit

Permalink
Merge branch 'main' of github.com:neuralmagic/docs into main
Browse files Browse the repository at this point in the history
  • Loading branch information
markurtz committed Feb 26, 2021
2 parents 29c9ade + 3074bb8 commit 13b1839
Showing 382 changed files with 3,731 additions and 3,652 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions sparseml/_modules/index.html
Original file line number Diff line number Diff line change
@@ -98,16 +98,17 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="../quicktour.html">Quick Tour</a></li>
<li class="toctree-l1"><a class="reference internal" href="../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../recipes.html">Optimization Recipes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../recipes.html">Sparsification Recipes</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../api/sparseml.html">sparseml package</a></li>
</ul>
<p class="caption"><span class="caption-text">Help and Support</span></p>
<p class="caption"><span class="caption-text">Help</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="https://github.com/neuralmagic/sparseml/issues">Bugs, Feature Requests</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/neuralmagic/sparseml/discussions">Support, General Q&amp;A</a></li>
<li class="toctree-l1"><a class="reference external" href="https://docs.neuralmagic.com">Neural Magic Docs</a></li>
</ul>


28 changes: 19 additions & 9 deletions sparseml/_modules/sparseml/keras/optim/manager.html
Original file line number Diff line number Diff line change
@@ -98,16 +98,17 @@
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../../quicktour.html">Quick Tour</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../installation.html">Installation</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../recipes.html">Optimization Recipes</a></li>
<li class="toctree-l1"><a class="reference internal" href="../../../../recipes.html">Sparsification Recipes</a></li>
</ul>
<p class="caption"><span class="caption-text">API</span></p>
<ul>
<li class="toctree-l1"><a class="reference internal" href="../../../../api/sparseml.html">sparseml package</a></li>
</ul>
<p class="caption"><span class="caption-text">Help and Support</span></p>
<p class="caption"><span class="caption-text">Help</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="https://github.com/neuralmagic/sparseml/issues">Bugs, Feature Requests</a></li>
<li class="toctree-l1"><a class="reference external" href="https://github.com/neuralmagic/sparseml/discussions">Support, General Q&amp;A</a></li>
<li class="toctree-l1"><a class="reference external" href="https://docs.neuralmagic.com">Neural Magic Docs</a></li>
</ul>


@@ -202,6 +203,7 @@ <h1>Source code for sparseml.keras.optim.manager</h1><div class="highlight"><pre
<span class="kn">from</span> <span class="nn">sparseml.keras.utils.logger</span> <span class="kn">import</span> <span class="n">KerasLogger</span>
<span class="kn">from</span> <span class="nn">sparseml.optim</span> <span class="kn">import</span> <span class="n">BaseManager</span>
<span class="kn">from</span> <span class="nn">sparseml.utils</span> <span class="kn">import</span> <span class="n">load_recipe_yaml_str</span>
<span class="kn">from</span> <span class="nn">sparsezoo.objects</span> <span class="kn">import</span> <span class="n">OptimizationRecipe</span>


<span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span><span class="s2">&quot;ScheduledModifierManager&quot;</span><span class="p">]</span>
@@ -213,15 +215,23 @@ <h1>Source code for sparseml.keras.optim.manager</h1><div class="highlight"><pre
<span class="sd"> &quot;&quot;&quot;</span>

<div class="viewcode-block" id="ScheduledModifierManager.from_yaml"><a class="viewcode-back" href="../../../../api/sparseml.keras.optim.html#sparseml.keras.optim.manager.ScheduledModifierManager.from_yaml">[docs]</a> <span class="nd">@staticmethod</span>
<span class="k">def</span> <span class="nf">from_yaml</span><span class="p">(</span><span class="n">file_path</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">add_modifiers</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">Modifier</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">):</span>
<span class="k">def</span> <span class="nf">from_yaml</span><span class="p">(</span>
<span class="n">file_path</span><span class="p">:</span> <span class="n">Union</span><span class="p">[</span><span class="nb">str</span><span class="p">,</span> <span class="n">OptimizationRecipe</span><span class="p">],</span>
<span class="n">add_modifiers</span><span class="p">:</span> <span class="n">List</span><span class="p">[</span><span class="n">Modifier</span><span class="p">]</span> <span class="o">=</span> <span class="kc">None</span><span class="p">,</span>
<span class="p">):</span>
<span class="sd">&quot;&quot;&quot;</span>
<span class="sd"> Convenience function used to create the manager of multiple modifiers</span>
<span class="sd"> from a yaml file.</span>

<span class="sd"> :param file_path: the path to the yaml file to load the modifier from</span>
<span class="sd"> Convenience function used to create the manager of multiple modifiers from a</span>
<span class="sd"> recipe file.</span>

<span class="sd"> :param file_path: the path to the recipe file to load the modifier from, or</span>
<span class="sd"> a SparseZoo model stub to load a recipe for a model stored in SparseZoo.</span>
<span class="sd"> SparseZoo stubs should be preceded by &#39;zoo:&#39;, and can contain an optional</span>
<span class="sd"> &#39;?recipe_type=&lt;type&gt;&#39; parameter. Can also be a SparseZoo OptimizationRecipe</span>
<span class="sd"> object. i.e. &#39;/path/to/local/recipe.yaml&#39;, &#39;zoo:model/stub/path&#39;,</span>
<span class="sd"> &#39;zoo:model/stub/path?recipe_type=transfer&#39;</span>
<span class="sd"> :param add_modifiers: additional modifiers that should be added to the</span>
<span class="sd"> returned manager alongside the ones loaded from the yaml file</span>
<span class="sd"> :return: ScheduledModifierManager() created from the yaml file</span>
<span class="sd"> returned manager alongside the ones loaded from the recipe file</span>
<span class="sd"> :return: ScheduledModifierManager() created from the recipe file</span>
<span class="sd"> &quot;&quot;&quot;</span>
<span class="n">yaml_str</span> <span class="o">=</span> <span class="n">load_recipe_yaml_str</span><span class="p">(</span><span class="n">file_path</span><span class="p">)</span>
<span class="n">modifiers</span> <span class="o">=</span> <span class="n">Modifier</span><span class="o">.</span><span class="n">load_list</span><span class="p">(</span><span class="n">yaml_str</span><span class="p">)</span>
Loading

0 comments on commit 13b1839

Please sign in to comment.