Skip to content

Commit d907e66

Browse files
Merge pull request #43 from machine-intelligence-laboratory/version_0.7.0_prerelease
Version 0.7.0 prerelease
2 parents f1a4e5b + a4a25ed commit d907e66

File tree

105 files changed

+12349
-2329
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+12349
-2329
lines changed

docs/cooking_machine/config_parser.html

Lines changed: 86 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,6 @@ <h1 class="title">Module <code>topicnet.cooking_machine.config_parser</code></h1
142142
&#34;theta_name&#34;: Str()
143143
}
144144

145-
# change log style
146-
lc = artm.messages.ConfigureLoggingArgs()
147-
lc.minloglevel = 3
148-
lib = artm.wrapper.LibArtm(logging_config=lc)
149145

150146
element = Any()
151147
base_schema = Map({
@@ -522,12 +518,12 @@ <h1 class="title">Module <code>topicnet.cooking_machine.config_parser</code></h1
522518
return modalities_to_use
523519

524520

525-
def parse(yaml_string, force_single_thread=False):
521+
def parse(yaml_string, force_separate_thread=False):
526522
&#34;&#34;&#34;
527523
Parameters
528524
----------
529525
yaml_string : str
530-
force_single_thread : bool
526+
force_separate_thread : bool
531527

532528
Returns
533529
-------
@@ -572,7 +568,7 @@ <h1 class="title">Module <code>topicnet.cooking_machine.config_parser</code></h1
572568
for stage in parsed[&#39;stages&#39;]:
573569
for elemtype, elem_args in stage.items():
574570
settings = build_cube_settings(elemtype.data, elem_args)
575-
if force_single_thread:
571+
if force_separate_thread:
576572
settings[elemtype][&#34;separate_thread&#34;] = False
577573
cube_settings.append(settings)
578574

@@ -610,8 +606,33 @@ <h1 class="title">Module <code>topicnet.cooking_machine.config_parser</code></h1
610606

611607

612608
def build_experiment_environment_from_yaml_config(yaml_string, experiment_id,
613-
save_path, force_single_thread=False):
614-
settings, regs, model, dataset = parse(yaml_string, force_single_thread)
609+
save_path, force_separate_thread=False):
610+
&#34;&#34;&#34;
611+
Wraps up parameter extraction and class instances creation
612+
from yaml formatted string
613+
together with the method that builds experiment pipeline from
614+
given experiment parameters (model, cubes, regularizers, etc)
615+
616+
Parameters
617+
----------
618+
yaml_string: str
619+
config that contains the whole experiment pipeline description
620+
with its parameters
621+
save_path: str
622+
path to the folder to save experiment logs and models
623+
experiment_id: str
624+
name of the experiment folder
625+
force_separate_thread: bool default = False
626+
experimental feature that packs model training into
627+
separate process which is killed upon training completion
628+
by default is not used
629+
630+
Returns
631+
-------
632+
633+
tuple experiment, dataset instances of corresponding classes from topicnet
634+
&#34;&#34;&#34;
635+
settings, regs, model, dataset = parse(yaml_string, force_separate_thread)
615636
# TODO: handle dynamic addition of regularizers
616637
experiment = Experiment(experiment_id=experiment_id, save_path=save_path, topic_model=model)
617638
experiment.build(settings)
@@ -671,17 +692,64 @@ <h2 id="returns">Returns</h2>
671692
</details>
672693
</dd>
673694
<dt id="topicnet.cooking_machine.config_parser.build_experiment_environment_from_yaml_config"><code class="name flex">
674-
<span>def <span class="ident">build_experiment_environment_from_yaml_config</span></span>(<span>yaml_string, experiment_id, save_path, force_single_thread=False)</span>
695+
<span>def <span class="ident">build_experiment_environment_from_yaml_config</span></span>(<span>yaml_string, experiment_id, save_path, force_separate_thread=False)</span>
675696
</code></dt>
676697
<dd>
677-
<section class="desc"></section>
698+
<section class="desc"><p>Wraps up parameter extraction and class instances creation
699+
from yaml formatted string
700+
together with the method that builds experiment pipeline from
701+
given experiment parameters (model, cubes, regularizers, etc)</p>
702+
<h2 id="parameters">Parameters</h2>
703+
<dl>
704+
<dt><strong><code>yaml_string</code></strong> :&ensp;<code>str</code></dt>
705+
<dd>config that contains the whole experiment pipeline description
706+
with its parameters</dd>
707+
<dt><strong><code>save_path</code></strong> :&ensp;<code>str</code></dt>
708+
<dd>path to the folder to save experiment logs and models</dd>
709+
<dt><strong><code>experiment_id</code></strong> :&ensp;<code>str</code></dt>
710+
<dd>name of the experiment folder</dd>
711+
<dt><strong><code>force_separate_thread</code></strong> :&ensp;<code>bool</code> default = <code>False</code></dt>
712+
<dd>experimental feature that packs model training into
713+
separate process which is killed upon training completion
714+
by default is not used</dd>
715+
</dl>
716+
<h2 id="returns">Returns</h2>
717+
<dl>
718+
<dt><code>tuple</code> <code>experiment</code>, <code>dataset</code> <code>instances</code> of <code>corresponding</code> <code>classes</code> <code>from</code> <a title="topicnet" href="../index.html"><code>topicnet</code></a></dt>
719+
<dd>&nbsp;</dd>
720+
</dl></section>
678721
<details class="source">
679722
<summary>
680723
<span>Expand source code</span>
681724
</summary>
682725
<pre><code class="python">def build_experiment_environment_from_yaml_config(yaml_string, experiment_id,
683-
save_path, force_single_thread=False):
684-
settings, regs, model, dataset = parse(yaml_string, force_single_thread)
726+
save_path, force_separate_thread=False):
727+
&#34;&#34;&#34;
728+
Wraps up parameter extraction and class instances creation
729+
from yaml formatted string
730+
together with the method that builds experiment pipeline from
731+
given experiment parameters (model, cubes, regularizers, etc)
732+
733+
Parameters
734+
----------
735+
yaml_string: str
736+
config that contains the whole experiment pipeline description
737+
with its parameters
738+
save_path: str
739+
path to the folder to save experiment logs and models
740+
experiment_id: str
741+
name of the experiment folder
742+
force_separate_thread: bool default = False
743+
experimental feature that packs model training into
744+
separate process which is killed upon training completion
745+
by default is not used
746+
747+
Returns
748+
-------
749+
750+
tuple experiment, dataset instances of corresponding classes from topicnet
751+
&#34;&#34;&#34;
752+
settings, regs, model, dataset = parse(yaml_string, force_separate_thread)
685753
# TODO: handle dynamic addition of regularizers
686754
experiment = Experiment(experiment_id=experiment_id, save_path=save_path, topic_model=model)
687755
experiment.build(settings)
@@ -1090,14 +1158,14 @@ <h2 id="returns">Returns</h2>
10901158
</details>
10911159
</dd>
10921160
<dt id="topicnet.cooking_machine.config_parser.parse"><code class="name flex">
1093-
<span>def <span class="ident">parse</span></span>(<span>yaml_string, force_single_thread=False)</span>
1161+
<span>def <span class="ident">parse</span></span>(<span>yaml_string, force_separate_thread=False)</span>
10941162
</code></dt>
10951163
<dd>
10961164
<section class="desc"><h2 id="parameters">Parameters</h2>
10971165
<dl>
10981166
<dt><strong><code>yaml_string</code></strong> :&ensp;<code>str</code></dt>
10991167
<dd>&nbsp;</dd>
1100-
<dt><strong><code>force_single_thread</code></strong> :&ensp;<code>bool</code></dt>
1168+
<dt><strong><code>force_separate_thread</code></strong> :&ensp;<code>bool</code></dt>
11011169
<dd>&nbsp;</dd>
11021170
</dl>
11031171
<h2 id="returns">Returns</h2>
@@ -1115,12 +1183,12 @@ <h2 id="returns">Returns</h2>
11151183
<summary>
11161184
<span>Expand source code</span>
11171185
</summary>
1118-
<pre><code class="python">def parse(yaml_string, force_single_thread=False):
1186+
<pre><code class="python">def parse(yaml_string, force_separate_thread=False):
11191187
&#34;&#34;&#34;
11201188
Parameters
11211189
----------
11221190
yaml_string : str
1123-
force_single_thread : bool
1191+
force_separate_thread : bool
11241192

11251193
Returns
11261194
-------
@@ -1165,7 +1233,7 @@ <h2 id="returns">Returns</h2>
11651233
for stage in parsed[&#39;stages&#39;]:
11661234
for elemtype, elem_args in stage.items():
11671235
settings = build_cube_settings(elemtype.data, elem_args)
1168-
if force_single_thread:
1236+
if force_separate_thread:
11691237
settings[elemtype][&#34;separate_thread&#34;] = False
11701238
cube_settings.append(settings)
11711239

docs/cooking_machine/cubes/controller_cube.html

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ <h2 id="fields">Fields</h2>
306306

307307
See top-level docstring for details.
308308
&#34;&#34;&#34;
309-
def __init__(self, reg_name, score_to_track, tau_converter, max_iters, local_dict=dict()):
309+
def __init__(self, reg_name, score_to_track, tau_converter, max_iters, local_dict=None):
310310
&#34;&#34;&#34;
311311

312312
Parameters
@@ -320,6 +320,9 @@ <h2 id="fields">Fields</h2>
320320
`max_iters` could be `float(&#34;NaN&#34;)` and `float(&#34;inf&#34;)` values:
321321
that way agent will continue operating even outside this `RegularizationControllerCube`
322322
&#34;&#34;&#34;
323+
if local_dict is None:
324+
local_dict = dict()
325+
323326
self.reg_name = reg_name
324327
self.tau_converter = tau_converter
325328
if isinstance(score_to_track, list):
@@ -634,7 +637,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
634637
<dl>
635638
<dt id="topicnet.cooking_machine.cubes.controller_cube.ControllerAgent"><code class="flex name class">
636639
<span>class <span class="ident">ControllerAgent</span></span>
637-
<span>(</span><span>reg_name, score_to_track, tau_converter, max_iters, local_dict={})</span>
640+
<span>(</span><span>reg_name, score_to_track, tau_converter, max_iters, local_dict=None)</span>
638641
</code></dt>
639642
<dd>
640643
<section class="desc"><p>Allows to change <code>tau</code> during the <code>_fit</code> method.</p>
@@ -692,7 +695,7 @@ <h2 id="parameters">Parameters</h2>
692695

693696
See top-level docstring for details.
694697
&#34;&#34;&#34;
695-
def __init__(self, reg_name, score_to_track, tau_converter, max_iters, local_dict=dict()):
698+
def __init__(self, reg_name, score_to_track, tau_converter, max_iters, local_dict=None):
696699
&#34;&#34;&#34;
697700

698701
Parameters
@@ -706,6 +709,9 @@ <h2 id="parameters">Parameters</h2>
706709
`max_iters` could be `float(&#34;NaN&#34;)` and `float(&#34;inf&#34;)` values:
707710
that way agent will continue operating even outside this `RegularizationControllerCube`
708711
&#34;&#34;&#34;
712+
if local_dict is None:
713+
local_dict = dict()
714+
709715
self.reg_name = reg_name
710716
self.tau_converter = tau_converter
711717
if isinstance(score_to_track, list):

docs/cooking_machine/cubes/cube_creator.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ <h3>Class variables</h3>
529529
<dl>
530530
<dt id="topicnet.cooking_machine.cubes.cube_creator.CubeCreator.DEFAULT_SEED_VALUE"><code class="name">var <span class="ident">DEFAULT_SEED_VALUE</span></code></dt>
531531
<dd>
532-
<section class="desc"><p>int(x=0) -&gt; integer
532+
<section class="desc"><p>int([x]) -&gt; integer
533533
int(x, base=10) -&gt; integer</p>
534534
<p>Convert a number or string to an integer, or return 0 if no arguments
535535
are given.

docs/cooking_machine/cubes/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
<header>
2020
<h1 class="title">Module <code>topicnet.cooking_machine.cubes</code></h1>
2121
</header>
22-
<p>Cubes and their Strategies</p>
22+
<h1 id="cubes-and-their-strategies">Cubes and their Strategies</h1>
2323
<p>Cube types:</p>
2424
<ul>
2525
<li><code>BaseCube</code> — a parent class for all the Cubes</li>
@@ -140,4 +140,4 @@ <h1><code>TopicNet</code> library documentation </h1>
140140
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
141141
<script>hljs.initHighlightingOnLoad()</script>
142142
</body>
143-
</html>
143+
</html>

0 commit comments

Comments
 (0)