19 lines (19 with data), 11.9 kB
ÇĽO. îdocutils.nodesöîdocumentöôö)üö}ö(î rawsourceöî öîchildrenö]öh îsectionöôö)üö}ö(hhh]ö(h îtitleöôö)üö}ö(hîSaving and loading modelsöh]öh îTextöôöîSaving and loading modelsöůöüö}ö(hhîparentöhhhîsourceöNîlineöNubaî
attributesö}ö(îidsö]öîclassesö]öînamesö]öîdupnamesö]öîbackrefsö]öuîtagnameöhhhhhhî?/home/jona/work/phd/maui/maui/doc/saving-and-loading-models.rstöhKubh î paragraphöôö)üö}ö(hîSMaui models may be saved to disk, so that they may be loaded again at a later time.öh]öhîSMaui models may be saved to disk, so that they may be loaded again at a later time.öůöüö}ö(hh/hh-hhhNhNubah}ö(h]öh!]öh#]öh%]öh']öuh)h+hh*hKhhhhubh
)üö}ö(hhh]ö(h)üö}ö(hîSaving a trained model to disköh]öhîSaving a trained model to disköůöüö}ö(hh@hh>hhhNhNubah}ö(h]öh!]öh#]öh%]öh']öuh)hhh;hhhh*hKubh,)üö}ö(hîńSaving a model to disk involves saving two files to a target directory. These files store the model weights and the maui parameters (the arguments the maui model was instantiated with). :doc:`maui` implements a the save functionöh]ö(hî║Saving a model to disk involves saving two files to a target directory. These files store the model weights and the maui parameters (the arguments the maui model was instantiated with). öůöüö}ö(hî║Saving a model to disk involves saving two files to a target directory. These files store the model weights and the maui parameters (the arguments the maui model was instantiated with). öhhLhhhNhNubîsphinx.addnodesöîpending_xreföôö)üö}ö(hî:doc:`maui`öh]öh îinlineöôö)üö}ö(hhZh]öhîmauiöůöüö}ö(hhhh^ubah}ö(h]öh!]ö(îxreföîstdöîstd-docöeh#]öh%]öh']öuh)h\hhXubah}ö(h]öh!]öh#]öh%]öh']öîreftypeöîdocöî refdomainöhiîrefexplicitöëî reftargetöîmauiöîrefdocöîsaving-and-loading-modelsöîrefwarnöłuh)hVhh*hK hhLubhî implements a the save functionöůöüö}ö(hî implements a the save functionöhhLhhhNhNubeh}ö(h]öh!]öh#]öh%]öh']öuh)h+hh*hK hh;hhubhUîindexöôö)üö}ö(hhh]öh}ö(h]öh!]öh#]öh%]öh']öîentriesö]ö(îsingleöîsave() (in module maui.Maui)öîmaui.Maui.saveöhNtöauh)hłhh;hhhîG/home/jona/work/phd/maui/maui/maui/model.py:docstring of maui.Maui.saveöhNubhUîdescöôö)üö}ö(hhh]ö(hUîdesc_signatureöôö)üö}ö(hîsave(self, destdir)öh]ö(hUîdesc_addnameöôö)üö}ö(hî
maui.Maui.öh]öhî
maui.Maui.öůöüö}ö(hhhhžhhhNhNubah}ö(h]öh!]öh#]öh%]öh']öî xml:spaceöîpreserveöuh)hąhhíhhhîG/home/jona/work/phd/maui/maui/maui/model.py:docstring of maui.Maui.saveöhNubhUî desc_nameöôö)üö}ö(hîsaveöh]öhîsaveöůöüö}ö(hhhh║hhhNhNubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂuh)hŞhhíhhhhĚhNubhUîdesc_parameterlistöôö)üö}ö(hî
self, destdiröh]ö(hUîdesc_parameteröôö)üö}ö(hîselföh]öhîselföůöüö}ö(hhhhđubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂuh)h╬hh╩ubh¤)üö}ö(hîdestdiröh]öhîdestdiröůöüö}ö(hhhhŮubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂuh)h╬hh╩ubeh}ö(h]öh!]öh#]öh%]öh']öhÁhÂuh)h╚hhíhhhhĚhNubeh}ö(h]öhŚah!]öh#]öhŚah%]öh']öîfirstöëîmoduleöî maui.Mauiöîclassöhîfullnameöh╝uh)hčhhťhhhhĚhNubhUîdesc_contentöôö)üö}ö(hhh]ö(h,)üö}ö(hîLSave a maui model to disk, so that it may be reloaded later using ``load()``öh]ö(hîBSave a maui model to disk, so that it may be reloaded later using öůöüö}ö(hîBSave a maui model to disk, so that it may be reloaded later using öhj hhhNhNubh îliteralöôö)üö}ö(hî
``load()``öh]öhîload()öůöüö}ö(hhhj
ubah}ö(h]öh!]öh#]öh%]öh']öuh)j hj ubeh}ö(h]öh!]öh#]öh%]öh']öuh)h+hhÖhKhh hhubh,)üö}ö(hî>destdir: destination directory in which to save model filesöh]öhî>destdir: destination directory in which to save model filesöůöüö}ö(hj# hj! hhhNhNubah}ö(h]öh!]öh#]öh%]öh']öuh)h+hhÖhKhh hhubeh}ö(h]öh!]öh#]öh%]öh']öuh)hřhhťhhhhĚhNubeh}ö(h]öh!]öh#]öh%]öh']öîdomainöîpyöîobjtypeöîfunctionöîdesctypeöj> înoindexöëuh)hÜhhhh;hhÖhNubh,)üö}ö(hîôThe function takes one required parameter, the destination directory where the two files will be saved. It is called directly on a maui model, likeöh]öhîôThe function takes one required parameter, the destination directory where the two files will be saved. It is called directly on a maui model, likeöůöüö}ö(hjC hjA hhhNhNubah}ö(h]öh!]öh#]öh%]öh']öuh)h+hh*hK
hh;hhubh î
literal_blocköôö)üö}ö(hîmaui_model.save('/path/to/dir')öh]öhîmaui_model.save('/path/to/dir')öůöüö}ö(hhhjQ ubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂîlanguageöîpythonöîlinenosöëîhighlight_argsö}öuh)jO hh*hKhh;hhubeh}ö(h]öîsaving-a-trained-model-to-disköah!]öh#]öîsaving a trained model to disköah%]öh']öuh)h hhhhhh*hKubh
)üö}ö(hhh]ö(h)üö}ö(hîLoading a model from disköh]öhîLoading a model from disköůöüö}ö(hjq hjo hhhNhNubah}ö(h]öh!]öh#]öh%]öh']öuh)hhjl hhhh*hKubh,)üö}ö(hX~ Loading a model involves instantiating a new Maui instance using the parameters that were used on the model that is saved to disk, and then populating the weights of the model to the previously trained weights. Once a model is loaded, it can be used to transform new data to the latent space, or it can be trained further. :doc:`maui` has a static function to load a model from disköh]ö(hXC Loading a model involves instantiating a new Maui instance using the parameters that were used on the model that is saved to disk, and then populating the weights of the model to the previously trained weights. Once a model is loaded, it can be used to transform new data to the latent space, or it can be trained further. öůöüö}ö(hXC Loading a model involves instantiating a new Maui instance using the parameters that were used on the model that is saved to disk, and then populating the weights of the model to the previously trained weights. Once a model is loaded, it can be used to transform new data to the latent space, or it can be trained further. öhj} hhhNhNubhW)üö}ö(hî:doc:`maui`öh]öh])üö}ö(hjł h]öhîmauiöůöüö}ö(hhhjŐ ubah}ö(h]öh!]ö(hhîstdöîstd-docöeh#]öh%]öh']öuh)h\hjć ubah}ö(h]öh!]öh#]öh%]öh']öîreftypeöîdocöî refdomainöjö îrefexplicitöëhxîmauiöhzh{h|łuh)hVhh*hKhj} ubhî0 has a static function to load a model from disköůöüö}ö(hî0 has a static function to load a model from disköhj} hhhNhNubeh}ö(h]öh!]öh#]öh%]öh']öuh)h+hh*hKhjl hhubhë)üö}ö(hhh]öh}ö(h]öh!]öh#]öh%]öh']öîentriesö]ö(hĽîload() (in module maui.Maui)öîmaui.Maui.loadöhNtöauh)hłhjl hhhîG/home/jona/work/phd/maui/maui/maui/model.py:docstring of maui.Maui.loadöhNubhŤ)üö}ö(hhh]ö(há)üö}ö(hî load(dir)öh]ö(hŽ)üö}ö(hî
maui.Maui.öh]öhî
maui.Maui.öůöüö}ö(hhhj┼ hhhNhNubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂuh)hąhj┴ hhhîG/home/jona/work/phd/maui/maui/maui/model.py:docstring of maui.Maui.loadöhNubh╣)üö}ö(hîloadöh]öhîloadöůöüö}ö(hhhjď hhhNhNubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂuh)hŞhj┴ hhhjË hNubh╔)üö}ö(hîdiröh]öh¤)üö}ö(hîdiröh]öhîdiröůöüö}ö(hhhjŠ ubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂuh)h╬hjÔ ubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂuh)h╚hj┴ hhhjË hNubeh}ö(h]öj╗ ah!]öh#]öj╗ ah%]öh']öh°ëh¨î maui.MauiöhűhhŘjÍ uh)hčhjż hhhjË hNubh■)üö}ö(hhh]ö(h,)üö}ö(hîHLoad a maui model from disk, which was previously saved using ``save()``öh]ö(hî>Load a maui model from disk, which was previously saved using öůöüö}ö(hî>Load a maui model from disk, which was previously saved using öhj hhhNhNubj )üö}ö(hî
``save()``öh]öhîsave()öůöüö}ö(hhhj
ubah}ö(h]öh!]öh#]öh%]öh']öuh)j hj ubeh}ö(h]öh!]öh#]öh%]öh']öuh)h+hjŻ hKhj hhubh,)üö}ö(hî7dir: The directory from which to load the maui modelöh]öhî7dir: The directory from which to load the maui modelöůöüö}ö(hj# hj! hhhNhNubah}ö(h]öh!]öh#]öh%]öh']öuh)h+hjŻ hKhj hhubh,)üö}ö(hî:maui_model: a maui model that was previously saved to disköh]öhî:maui_model: a maui model that was previously saved to disköůöüö}ö(hj1 hj/ hhhNhNubah}ö(h]öh!]öh#]öh%]öh']öuh)h+hjŻ hKhj hhubeh}ö(h]öh!]öh#]öh%]öh']öuh)hřhjż hhhjË hNubeh}ö(h]öh!]öh#]öh%]öh']öj; îpyöj= îfunctionöj? jJ j@ ëuh)hÜhhhjl hjŻ hNubh,)üö}ö(hî-It is called directly on the Maui class, likeöh]öhî-It is called directly on the Maui class, likeöůöüö}ö(hjM hjK hhhNhNubah}ö(h]öh!]öh#]öh%]öh']öuh)h+hh*hKhjl hhubjP )üö}ö(hîmaui.Maui.load('/path/to/dir')öh]öhîmaui.Maui.load('/path/to/dir')öůöüö}ö(hhhjY ubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂj_ îsqlöja ëjb }öuh)jO hh*hKhjl hhubeh}ö(h]öîloading-a-model-from-disköah!]öh#]öîloading a model from disköah%]öh']öuh)h hhhhhh*hKubeh}ö(h]öîsaving-and-loading-modelsöah!]öh#]öîsaving and loading modelsöah%]öh']öuh)h hhhhhh*hKubah}ö(h]öh!]öh#]öh%]öh']öîsourceöh*uh)hîcurrent_sourceöNîcurrent_lineöNîsettingsöîdocutils.frontendöîValuesöôö)üö}ö(hNî generatoröNî datestampöNîsource_linköNî
source_urlöNî
toc_backlinksöîentryöîfootnote_backlinksöKî
sectnum_xformöKîstrip_commentsöNîstrip_elements_with_classesöNî
strip_classesöNîreport_levelöKî
halt_levelöKîexit_status_levelöKîdebugöNîwarning_streamöNî tracebacköłîinput_encodingöî utf-8-sigöîinput_encoding_error_handleröîstrictöîoutput_encodingöîutf-8öîoutput_encoding_error_handleröjť îerror_encodingöîUTF-8öîerror_encoding_error_handleröîbackslashreplaceöî
language_codeöîenöîrecord_dependenciesöNîconfigöNî id_prefixöhîauto_id_prefixöîidöî
dump_settingsöNîdump_internalsöNîdump_transformsöNîdump_pseudo_xmlöNîexpose_internalsöNîstrict_visitoröNî_disable_configöNî_sourceöh*î_destinationöNî
_config_filesö]öîpep_referencesöNîpep_base_urlöî https://www.python.org/dev/peps/öîpep_file_url_templateöîpep-%04döîrfc_referencesöNîrfc_base_urlöîhttps://tools.ietf.org/html/öî tab_widthöKîtrim_footnote_reference_spaceöëîfile_insertion_enabledöłîraw_enabledöKîsyntax_highlightöîlongöîsmart_quotesöłîsmartquotes_localesö]öîcharacter_level_inline_markupöëîdoctitle_xformöëî
docinfo_xformöKîsectsubtitle_xformöëîembed_stylesheetöëîcloak_email_addressesöłîenvöNubîreporteröNîindirect_targetsö]öîsubstitution_defsö}öîsubstitution_namesö}öîrefnamesö}öîrefidsö}öînameidsö}ö(jv js ji jf hŚhŚjn jk j╗ j╗ uî nametypesö}ö(jv Nji NhŚłjn Nj╗ łuh}ö(js hjf h;hŚhíjk jl j╗ j┴ uî
footnote_refsö}öî
citation_refsö}öî
autofootnotesö]öîautofootnote_refsö]öîsymbol_footnotesö]öîsymbol_footnote_refsö]öî footnotesö]öî citationsö]öîautofootnote_startöKîsymbol_footnote_startöK îid_startöKîparse_messagesö]ö(h îsystem_messageöôö)üö}ö(hhh]ö(h,)üö}ö(hîUnexpected section title.öh]öhîUnexpected section title.öůöüö}ö(hhhj° ubah}ö(h]öh!]öh#]öh%]öh']öuh)h+hj§ ubjP )üö}ö(hîParameters
----------öh]öhîParameters
----------öůöüö}ö(hhhj ubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂuh)jO hj§ hhÖubeh}ö(h]öh!]öh#]öh%]öh']öîlevelöKîtypeöîSEVEREöîsourceöhÖîlineöKuh)jˇ hh hhhhÖhKubj˘ )üö}ö(hhh]ö(h,)üö}ö(hîUnexpected section title.öh]öhîUnexpected section title.öůöüö}ö(hhhj" ubah}ö(h]öh!]öh#]öh%]öh']öuh)h+hj ubjP )üö}ö(hîParameters
----------öh]öhîParameters
----------öůöüö}ö(hhhj0 ubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂuh)jO hj hjŻ ubeh}ö(h]öh!]öh#]öh%]öh']öîlevelöKîtypeöj îsourceöjŻ îlineöKuh)jˇ hj hhhjŻ hKubj˘ )üö}ö(hhh]ö(h,)üö}ö(hîUnexpected section title.öh]öhîUnexpected section title.öůöüö}ö(hhhjK ubah}ö(h]öh!]öh#]öh%]öh']öuh)h+hjH ubjP )üö}ö(hîReturns
-------öh]öhîReturns
-------öůöüö}ö(hhhjY ubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂuh)jO hjH hjŻ ubeh}ö(h]öh!]öh#]öh%]öh']öîlevelöKîtypeöj îsourceöjŻ îlineöK uh)jˇ hj hhhjŻ hK ubeîtransform_messagesö]öîtransformeröNî
decorationöNhhub.