@@ -142,10 +142,6 @@ <h1 class="title">Module <code>topicnet.cooking_machine.config_parser</code></h1
142
142
"theta_name": Str()
143
143
}
144
144
145
- # change log style
146
- lc = artm.messages.ConfigureLoggingArgs()
147
- lc.minloglevel = 3
148
- lib = artm.wrapper.LibArtm(logging_config=lc)
149
145
150
146
element = Any()
151
147
base_schema = Map({
@@ -522,12 +518,12 @@ <h1 class="title">Module <code>topicnet.cooking_machine.config_parser</code></h1
522
518
return modalities_to_use
523
519
524
520
525
- def parse(yaml_string, force_single_thread =False):
521
+ def parse(yaml_string, force_separate_thread =False):
526
522
"""
527
523
Parameters
528
524
----------
529
525
yaml_string : str
530
- force_single_thread : bool
526
+ force_separate_thread : bool
531
527
532
528
Returns
533
529
-------
@@ -572,7 +568,7 @@ <h1 class="title">Module <code>topicnet.cooking_machine.config_parser</code></h1
572
568
for stage in parsed['stages']:
573
569
for elemtype, elem_args in stage.items():
574
570
settings = build_cube_settings(elemtype.data, elem_args)
575
- if force_single_thread :
571
+ if force_separate_thread :
576
572
settings[elemtype]["separate_thread"] = False
577
573
cube_settings.append(settings)
578
574
@@ -610,8 +606,33 @@ <h1 class="title">Module <code>topicnet.cooking_machine.config_parser</code></h1
610
606
611
607
612
608
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
+ """
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
+ """
635
+ settings, regs, model, dataset = parse(yaml_string, force_separate_thread)
615
636
# TODO: handle dynamic addition of regularizers
616
637
experiment = Experiment(experiment_id=experiment_id, save_path=save_path, topic_model=model)
617
638
experiment.build(settings)
@@ -671,17 +692,64 @@ <h2 id="returns">Returns</h2>
671
692
</ details >
672
693
</ dd >
673
694
< 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 >
675
696
</ code > </ dt >
676
697
< 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 > : < 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 > : < 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 > : < code > str</ code > </ dt >
710
+ < dd > name of the experiment folder</ dd >
711
+ < dt > < strong > < code > force_separate_thread</ code > </ strong > : < 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 > </ dd >
720
+ </ dl > </ section >
678
721
< details class ="source ">
679
722
< summary >
680
723
< span > Expand source code</ span >
681
724
</ summary >
682
725
< 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
+ """
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
+ """
752
+ settings, regs, model, dataset = parse(yaml_string, force_separate_thread)
685
753
# TODO: handle dynamic addition of regularizers
686
754
experiment = Experiment(experiment_id=experiment_id, save_path=save_path, topic_model=model)
687
755
experiment.build(settings)
@@ -1090,14 +1158,14 @@ <h2 id="returns">Returns</h2>
1090
1158
</ details >
1091
1159
</ dd >
1092
1160
< 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 >
1094
1162
</ code > </ dt >
1095
1163
< dd >
1096
1164
< section class ="desc "> < h2 id ="parameters "> Parameters</ h2 >
1097
1165
< dl >
1098
1166
< dt > < strong > < code > yaml_string</ code > </ strong > : < code > str</ code > </ dt >
1099
1167
< dd > </ dd >
1100
- < dt > < strong > < code > force_single_thread </ code > </ strong > : < code > bool</ code > </ dt >
1168
+ < dt > < strong > < code > force_separate_thread </ code > </ strong > : < code > bool</ code > </ dt >
1101
1169
< dd > </ dd >
1102
1170
</ dl >
1103
1171
< h2 id ="returns "> Returns</ h2 >
@@ -1115,12 +1183,12 @@ <h2 id="returns">Returns</h2>
1115
1183
< summary >
1116
1184
< span > Expand source code</ span >
1117
1185
</ 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):
1119
1187
"""
1120
1188
Parameters
1121
1189
----------
1122
1190
yaml_string : str
1123
- force_single_thread : bool
1191
+ force_separate_thread : bool
1124
1192
1125
1193
Returns
1126
1194
-------
@@ -1165,7 +1233,7 @@ <h2 id="returns">Returns</h2>
1165
1233
for stage in parsed['stages']:
1166
1234
for elemtype, elem_args in stage.items():
1167
1235
settings = build_cube_settings(elemtype.data, elem_args)
1168
- if force_single_thread :
1236
+ if force_separate_thread :
1169
1237
settings[elemtype]["separate_thread"] = False
1170
1238
cube_settings.append(settings)
1171
1239
0 commit comments