3
3
< head >
4
4
< meta charset ="utf-8 ">
5
5
< meta name ="viewport " content ="width=device-width, initial-scale=1, minimum-scale=1 " />
6
- < meta name ="generator " content ="pdoc 0.6.3 " />
6
+ < meta name ="generator " content ="pdoc 0.8.1 " />
7
7
< title > topicnet.cooking_machine.cubes.base_cube API documentation</ title >
8
8
< meta name ="description " content ="" />
9
9
< link href ='https://cdnjs.cloudflare.com/ajax/libs/normalize/8.0.0/normalize.min.css ' rel ='stylesheet '>
10
10
< link href ='https://cdnjs.cloudflare.com/ajax/libs/10up-sanitize.css/8.0.0/sanitize.min.css ' rel ='stylesheet '>
11
11
< link href ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/github.min.css " rel ="stylesheet ">
12
- < style > .flex {display : flex !important }body {line-height : 1.5em }# content {padding : 20px }# sidebar {padding : 30px ;overflow : hidden}.http-server-breadcrumbs {font-size : 130% ;margin : 0 0 15px 0 }# footer {font-size : .75em ;padding : 5px 30px ;border-top : 1px solid # ddd ;text-align : right}# footer p {margin : 0 0 0 1em ;display : inline-block}# footer p : last-child {margin-right : 30px }h1 , h2 , h3 , h4 , h5 {font-weight : 300 }h1 {font-size : 2.5em ;line-height : 1.1em }h2 {font-size : 1.75em ;margin : 1em 0 .50em 0 }h3 {font-size : 1.4em ;margin : 25px 0 10px 0 }h4 {margin : 0 ;font-size : 105% }a {color : # 058 ;text-decoration : none;transition : color .3s ease-in-out}a : hover {color : # e82 }.title code {font-weight : bold}h2 [id ^= "header-" ]{margin-top : 2em }.ident {color : # 900 }pre code {background : # f8f8f8 ;font-size : .8em ;line-height : 1.4em }code {background : # f2f2f1 ;padding : 1px 4px ;overflow-wrap : break-word}h1 code {background : transparent}pre {background : # f8f8f8 ;border : 0 ;border-top : 1px solid # ccc ;border-bottom : 1px solid # ccc ;margin : 1em 0 ;padding : 1ex }# http-server-module-list {display : flex;flex-flow : column}# http-server-module-list div {display : flex}# http-server-module-list dt {min-width : 10% }# http-server-module-list p {margin-top : 0 }.toc ul , # index {list-style-type : none;margin : 0 ;padding : 0 }# index code {background : transparent}# index h3 {border-bottom : 1px solid # ddd }# index ul {padding : 0 }# index h4 {font-weight : bold}# index h4 + ul {margin-bottom : .6em }@media (min-width : 200ex ){# index .two-column {column-count : 2 }}@media (min-width : 300ex ){# index .two-column {column-count : 3 }}dl {margin-bottom : 2em }dl dl : last-child {margin-bottom : 4em }dd {margin : 0 0 1em 3em }# header-classes + dl > dd {margin-bottom : 3em }dd dd {margin-left : 2em }dd p {margin : 10px 0 }.name {background : # eee ;font-weight : bold;font-size : .85em ;padding : 5px 10px ;display : inline-block;min-width : 40% }.name : hover {background : # e0e0e0 }.name > span : first-child {white-space : nowrap}.name .class > span : nth-child (2 ){margin-left : .4em }.inherited {color : # 999 ;border-left : 5px solid # eee ;padding-left : 1em }.inheritance em {font-style : normal;font-weight : bold}.desc h2 {font-weight : 400 ;font-size : 1.25em }.desc h3 {font-size : 1em }.desc dt code {background : inherit}.source summary {color : # 666 ;text-align : right;font-weight : 400 ;font-size : .8em ;text-transform : uppercase;cursor : pointer}.source pre {max-height : 500px ;overflow : auto;margin : 0 }.source pre code {font-size : 12px ;overflow : visible}.hlist {list-style : none}.hlist li {display : inline}.hlist li : after {content : ',\2002' }.hlist li : last-child : after {content : none}.hlist .hlist {display : inline;padding-left : 1em }img {max-width : 100% }.admonition {padding : .1em .5em ;margin-bottom : 1em }.admonition-title {font-weight : bold}.admonition .note , .admonition .info , .admonition .important {background : # aef }.admonition .todo , .admonition .versionadded , .admonition .tip , .admonition .hint {background : # dfd }.admonition .warning , .admonition .versionchanged , .admonition .deprecated {background : # fd4 }.admonition .error , .admonition .danger , .admonition .caution {background : lightpink}</ style >
13
- < style media ="screen and (min-width: 700px) "> @media screen and (min-width : 700px ){# sidebar {width : 30% }# content {width : 70% ;max-width : 100ch ;padding : 3em 4em ;border-left : 1px solid # ddd }pre code {font-size : 1em }.item .name {font-size : 1em }main {display : flex;flex-direction : row-reverse;justify-content : flex-end}.toc ul ul , # index ul {padding-left : 1.5em }.toc > ul > li {margin-top : .5em }}</ style >
12
+ < style > .flex {display : flex !important }body {line-height : 1.5em }# content {padding : 20px }# sidebar {padding : 30px ;overflow : hidden}# sidebar > * : last-child {margin-bottom : 2cm }.http-server-breadcrumbs {font-size : 130% ;margin : 0 0 15px 0 }# footer {font-size : .75em ;padding : 5px 30px ;border-top : 1px solid # ddd ;text-align : right}# footer p {margin : 0 0 0 1em ;display : inline-block}# footer p : last-child {margin-right : 30px }h1 , h2 , h3 , h4 , h5 {font-weight : 300 }h1 {font-size : 2.5em ;line-height : 1.1em }h2 {font-size : 1.75em ;margin : 1em 0 .50em 0 }h3 {font-size : 1.4em ;margin : 25px 0 10px 0 }h4 {margin : 0 ;font-size : 105% }a {color : # 058 ;text-decoration : none;transition : color .3s ease-in-out}a : hover {color : # e82 }.title code {font-weight : bold}h2 [id ^= "header-" ]{margin-top : 2em }.ident {color : # 900 }pre code {background : # f8f8f8 ;font-size : .8em ;line-height : 1.4em }code {background : # f2f2f1 ;padding : 1px 4px ;overflow-wrap : break-word}h1 code {background : transparent}pre {background : # f8f8f8 ;border : 0 ;border-top : 1px solid # ccc ;border-bottom : 1px solid # ccc ;margin : 1em 0 ;padding : 1ex }# http-server-module-list {display : flex;flex-flow : column}# http-server-module-list div {display : flex}# http-server-module-list dt {min-width : 10% }# http-server-module-list p {margin-top : 0 }.toc ul , # index {list-style-type : none;margin : 0 ;padding : 0 }# index code {background : transparent}# index h3 {border-bottom : 1px solid # ddd }# index ul {padding : 0 }# index h4 {margin-top : .6em ;font-weight : bold}@media (min-width : 200ex ){# index .two-column {column-count : 2 }}@media (min-width : 300ex ){# index .two-column {column-count : 3 }}dl {margin-bottom : 2em }dl dl : last-child {margin-bottom : 4em }dd {margin : 0 0 1em 3em }# header-classes + dl > dd {margin-bottom : 3em }dd dd {margin-left : 2em }dd p {margin : 10px 0 }.name {background : # eee ;font-weight : bold;font-size : .85em ;padding : 5px 10px ;display : inline-block;min-width : 40% }.name : hover {background : # e0e0e0 }.name > span : first-child {white-space : nowrap}.name .class > span : nth-child (2 ){margin-left : .4em }.inherited {color : # 999 ;border-left : 5px solid # eee ;padding-left : 1em }.inheritance em {font-style : normal;font-weight : bold}.desc h2 {font-weight : 400 ;font-size : 1.25em }.desc h3 {font-size : 1em }.desc dt code {background : inherit}.source summary , .git-link-div {color : # 666 ;text-align : right;font-weight : 400 ;font-size : .8em ;text-transform : uppercase}.source summary > * {white-space : nowrap;cursor : pointer}.git-link {color : inherit;margin-left : 1em }.source pre {max-height : 500px ;overflow : auto;margin : 0 }.source pre code {font-size : 12px ;overflow : visible}.hlist {list-style : none}.hlist li {display : inline}.hlist li : after {content : ',\2002' }.hlist li : last-child : after {content : none}.hlist .hlist {display : inline;padding-left : 1em }img {max-width : 100% }.admonition {padding : .1em .5em ;margin-bottom : 1em }.admonition-title {font-weight : bold}.admonition .note , .admonition .info , .admonition .important {background : # aef }.admonition .todo , .admonition .versionadded , .admonition .tip , .admonition .hint {background : # dfd }.admonition .warning , .admonition .versionchanged , .admonition .deprecated {background : # fd4 }.admonition .error , .admonition .danger , .admonition .caution {background : lightpink}</ style >
13
+ < style media ="screen and (min-width: 700px) "> @media screen and (min-width : 700px ){# sidebar {width : 30% ; height : 100 vh ; overflow : auto; position : sticky; top : 0 }# content {width : 70% ;max-width : 100ch ;padding : 3em 4em ;border-left : 1px solid # ddd }pre code {font-size : 1em }.item .name {font-size : 1em }main {display : flex;flex-direction : row-reverse;justify-content : flex-end}.toc ul ul , # index ul {padding-left : 1.5em }.toc > ul > li {margin-top : .5em }}</ style >
14
14
< style media ="print "> @media print{# sidebar h1 {page-break-before : always}.source {display : none}}@media print{* {background : transparent !important ;color : # 000 !important ;box-shadow : none !important ;text-shadow : none !important }a [href ]: after {content : " (" attr (href) ")" ;font-size : 90% }a [href ][title ]: after {content : none}abbr [title ]: after {content : " (" attr (title) ")" }.ir a : after , a [href ^= "javascript:" ]: after , a [href ^= "#" ]: after {content : "" }pre , blockquote {border : 1px solid # 999 ;page-break-inside : avoid}thead {display : table-header-group}tr , img {page-break-inside : avoid}img {max-width : 100% !important }@page {margin : 0.5cm }p , h2 , h3 {orphans : 3 ;widows : 3 }h1 , h2 , h3 , h4 , h5 , h6 {page-break-after : avoid}}</ style >
15
15
</ head >
16
16
< body >
@@ -21,7 +21,9 @@ <h1 class="title">Module <code>topicnet.cooking_machine.cubes.base_cube</code></
21
21
</ header >
22
22
< section id ="section-intro ">
23
23
< details class ="source ">
24
- < summary > Source code</ summary >
24
+ < summary >
25
+ < span > Expand source code</ span >
26
+ </ summary >
25
27
< pre > < code class ="python "> import os
26
28
from tqdm import tqdm
27
29
import warnings
@@ -384,7 +386,7 @@ <h2 class="section-title" id="header-functions">Functions</h2>
384
386
< span > def < span class ="ident "> check_experiment_existence</ span > </ span > (< span > topic_model)</ span >
385
387
</ code > </ dt >
386
388
< dd >
387
- < section class ="desc "> < p > Checks if topic_model has experiment.</ p >
389
+ < div class ="desc "> < p > Checks if topic_model has experiment.</ p >
388
390
< h2 id ="parameters "> Parameters</ h2 >
389
391
< dl >
390
392
< dt > < strong > < code > topic_model</ code > </ strong > : < code > TopicModel</ code > </ dt >
@@ -394,9 +396,11 @@ <h2 id="returns">Returns</h2>
394
396
< dl >
395
397
< dt > < code > bool</ code > </ dt >
396
398
< dd > True if experiment exists, in other case False.</ dd >
397
- </ dl > </ section >
399
+ </ dl > </ div >
398
400
< details class ="source ">
399
- < summary > Source code</ summary >
401
+ < summary >
402
+ < span > Expand source code</ span >
403
+ </ summary >
400
404
< pre > < code class ="python "> def check_experiment_existence(topic_model):
401
405
"""
402
406
Checks if topic_model has experiment.
@@ -421,9 +425,11 @@ <h2 id="returns">Returns</h2>
421
425
< span > def < span class ="ident "> get_from_queue_till_fail</ span > </ span > (< span > queue, error_message='')</ span >
422
426
</ code > </ dt >
423
427
< dd >
424
- < section class ="desc "> </ section >
428
+ < div class ="desc "> </ div >
425
429
< details class ="source ">
426
- < summary > Source code</ summary >
430
+ < summary >
431
+ < span > Expand source code</ span >
432
+ </ summary >
427
433
< pre > < code class ="python "> def get_from_queue_till_fail(queue, error_message='',):
428
434
return queue.get()</ code > </ pre >
429
435
</ details >
@@ -432,9 +438,11 @@ <h2 id="returns">Returns</h2>
432
438
< span > def < span class ="ident "> put_to_queue</ span > </ span > (< span > queue, puttable)</ span >
433
439
</ code > </ dt >
434
440
< dd >
435
- < section class ="desc "> </ section >
441
+ < div class ="desc "> </ div >
436
442
< details class ="source ">
437
- < summary > Source code</ summary >
443
+ < summary >
444
+ < span > Expand source code</ span >
445
+ </ summary >
438
446
< pre > < code class ="python "> def put_to_queue(queue, puttable):
439
447
queue.put(puttable)</ code > </ pre >
440
448
</ details >
@@ -443,9 +451,11 @@ <h2 id="returns">Returns</h2>
443
451
< span > def < span class ="ident "> retrieve_score_for_strategy</ span > </ span > (< span > score_name=None)</ span >
444
452
</ code > </ dt >
445
453
< dd >
446
- < section class ="desc "> </ section >
454
+ < div class ="desc "> </ div >
447
455
< details class ="source ">
448
- < summary > Source code</ summary >
456
+ < summary >
457
+ < span > Expand source code</ span >
458
+ </ summary >
449
459
< pre > < code class ="python "> def retrieve_score_for_strategy(score_name=None):
450
460
if not score_name:
451
461
score_name = 'PerplexityScore@all'
@@ -468,7 +478,7 @@ <h2 class="section-title" id="header-classes">Classes</h2>
468
478
< span > (</ span > < span > num_iter, action=None, reg_search='grid', strategy=None, tracked_score_function=None, verbose=False, separate_thread=True)</ span >
469
479
</ code > </ dt >
470
480
< dd >
471
- < section class ="desc "> < p > Abstract class for all cubes.</ p >
481
+ < div class ="desc "> < p > Abstract class for all cubes.</ p >
472
482
< p > Initialize stage.
473
483
Checks params and update .parameters attribute.</ p >
474
484
< h2 id ="parameters "> Parameters</ h2 >
@@ -489,9 +499,11 @@ <h2 id="parameters">Parameters</h2>
489
499
< dd > visualization flag</ dd >
490
500
< dt > < strong > < code > separate_thread</ code > </ strong > : < code > bool</ code > </ dt >
491
501
< dd > will train models inside a separate thread if True</ dd >
492
- </ dl > </ section >
502
+ </ dl > </ div >
493
503
< details class ="source ">
494
- < summary > Source code</ summary >
504
+ < summary >
505
+ < span > Expand source code</ span >
506
+ </ summary >
495
507
< pre > < code class ="python "> class BaseCube:
496
508
"""
497
509
Abstract class for all cubes.
@@ -785,32 +797,34 @@ <h2 id="parameters">Parameters</h2>
785
797
</ details >
786
798
< h3 > Subclasses</ h3 >
787
799
< ul class ="hlist ">
788
- < li > < a title ="topicnet.cooking_machine.cubes.regularizer_cube.RegularizersModifierCube " href ="regularizer_cube.html#topicnet.cooking_machine.cubes.regularizer_cube.RegularizersModifierCube "> RegularizersModifierCube</ a > </ li >
789
800
< li > < a title ="topicnet.cooking_machine.cubes.controller_cube.RegularizationControllerCube " href ="controller_cube.html#topicnet.cooking_machine.cubes.controller_cube.RegularizationControllerCube "> RegularizationControllerCube</ a > </ li >
790
801
< li > < a title ="topicnet.cooking_machine.cubes.cube_creator.CubeCreator " href ="cube_creator.html#topicnet.cooking_machine.cubes.cube_creator.CubeCreator "> CubeCreator</ a > </ li >
802
+ < li > < a title ="topicnet.cooking_machine.cubes.regularizer_cube.RegularizersModifierCube " href ="regularizer_cube.html#topicnet.cooking_machine.cubes.regularizer_cube.RegularizersModifierCube "> RegularizersModifierCube</ a > </ li >
791
803
</ ul >
792
804
< h3 > Methods</ h3 >
793
805
< dl >
794
806
< dt id ="topicnet.cooking_machine.cubes.base_cube.BaseCube.apply "> < code class ="name flex ">
795
807
< span > def < span class ="ident "> apply</ span > </ span > (< span > self, topic_model, one_cube_parameter, dictionary=None, model_id=None)</ span >
796
808
</ code > </ dt >
797
809
< dd >
798
- < section class ="desc "> < p > "apply" method changes topic_model in way that is defined by one_cube_parameter.</ p >
810
+ < div class ="desc "> < p > "apply" method changes topic_model in way that is defined by one_cube_parameter.</ p >
799
811
< h2 id ="parameters "> Parameters</ h2 >
800
812
< dl >
801
813
< dt > < strong > < code > topic_model</ code > </ strong > : < code > TopicModel</ code > </ dt >
802
814
< dd > topic model</ dd >
803
- < dt > < strong > < code > one_cube_parameter</ code > </ strong > : optional</ dt >
815
+ < dt > < strong > < code > one_cube_parameter</ code > </ strong > : < code > optional</ code > </ dt >
804
816
< dd > parameters of one experiment</ dd >
805
817
< dt > < strong > < code > dictionary</ code > </ strong > : < code > dict</ code > </ dt >
806
818
< dd > dictionary so that the it can be used
807
819
on the basis of the model (Default value = None)</ dd >
808
820
< dt > < strong > < code > model_id</ code > </ strong > : < code > str</ code > </ dt >
809
821
< dd > id of created model if necessary (Default value = None)</ dd >
810
822
</ dl >
811
- < h2 id ="returns "> Returns</ h2 > </ section >
823
+ < h2 id ="returns "> Returns</ h2 > </ div >
812
824
< details class ="source ">
813
- < summary > Source code</ summary >
825
+ < summary >
826
+ < span > Expand source code</ span >
827
+ </ summary >
814
828
< pre > < code class ="python "> def apply(self, topic_model, one_cube_parameter, dictionary=None, model_id=None):
815
829
"""
816
830
"apply" method changes topic_model in way that is defined by one_cube_parameter.
@@ -838,15 +852,17 @@ <h2 id="returns">Returns</h2></section>
838
852
< span > def < span class ="ident "> get_jsonable_from_parameters</ span > </ span > (< span > self)</ span >
839
853
</ code > </ dt >
840
854
< dd >
841
- < section class ="desc "> < p > Transform self.parameters to something that can be downloaded as json.</ p >
855
+ < div class ="desc "> < p > Transform self.parameters to something that can be downloaded as json.</ p >
842
856
< h2 id ="parameters "> Parameters</ h2 >
843
857
< h2 id ="returns "> Returns</ h2 >
844
858
< dl >
845
- < dt > optional</ dt >
859
+ < dt > < code > optional</ code > </ dt >
846
860
< dd > something jsonable</ dd >
847
- </ dl > </ section >
861
+ </ dl > </ div >
848
862
< details class ="source ">
849
- < summary > Source code</ summary >
863
+ < summary >
864
+ < span > Expand source code</ span >
865
+ </ summary >
850
866
< pre > < code class ="python "> def get_jsonable_from_parameters(self):
851
867
"""
852
868
Transform self.parameters to something that can be downloaded as json.
@@ -902,7 +918,7 @@ <h4><code><a title="topicnet.cooking_machine.cubes.base_cube.BaseCube" href="#to
902
918
</ nav >
903
919
</ main >
904
920
< footer id ="footer ">
905
- < p > Generated by < a href ="https://pdoc3.github.io/pdoc "> < cite > pdoc</ cite > 0.6.3 </ a > .</ p >
921
+ < p > Generated by < a href ="https://pdoc3.github.io/pdoc "> < cite > pdoc</ cite > 0.8.1 </ a > .</ p >
906
922
</ footer >
907
923
< script src ="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js "> </ script >
908
924
< script > hljs . initHighlightingOnLoad ( ) </ script >
0 commit comments