[433586]: / doc / _build / doctrees / saving-and-loading-models.doctree

Download this file

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 öhjhhhNhNubhîliteralöôö)üö}ö(hî
``load()``öh]öhîload()öůöüö}ö(hhhj
ubah}ö(h]öh!]öh#]öh%]öh']öuh)jhjubeh}ö(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öůöüö}ö(hjChjAhhhNhNubah}ö(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')öůöüö}ö(hhhjQubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂîlanguageöîpythonöîlinenosöëîhighlight_argsö}öuh)jOhh*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öůöüö}ö(hjqhjohhhNhNubah}ö(h]öh!]öh#]öh%]öh']öuh)hhjlhhhh*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]ö(hXCLoading 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. öůöüö}ö(hXCLoading 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*hKhjlhhubhë)üö}ö(hhh]öh}ö(h]öh!]öh#]öh%]öh']öîentriesö]ö(hĽîload() (in module maui.Maui)öîmaui.Maui.loadöhNtöauh)hłhjlhhhî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 öhjhhhNhNubj)üö}ö(hî
``save()``öh]öhîsave()öůöüö}ö(hhhj
ubah}ö(h]öh!]öh#]öh%]öh']öuh)jhjubeh}ö(h]öh!]öh#]öh%]öh']öuh)h+hjŻhKhjhhubh,)üö}ö(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ŻhKhjhhubh,)üö}ö(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öůöüö}ö(hj1hj/hhhNhNubah}ö(h]öh!]öh#]öh%]öh']öuh)h+hjŻhKhjhhubeh}ö(h]öh!]öh#]öh%]öh']öuh)hřhjżhhhjËhNubeh}ö(h]öh!]öh#]öh%]öh']öj;îpyöj=îfunctionöj?jJj@ëuh)hÜhhhjlhjŻhNubh,)üö}ö(hî-It is called directly on the Maui class, likeöh]öhî-It is called directly on the Maui class, likeöůöüö}ö(hjMhjKhhhNhNubah}ö(h]öh!]öh#]öh%]öh']öuh)h+hh*hKhjlhhubjP)üö}ö(hîmaui.Maui.load('/path/to/dir')öh]öhîmaui.Maui.load('/path/to/dir')öůöüö}ö(hhhjYubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂj_îsqlöjaëjb}öuh)jOhh*hKhjlhhubeh}ö(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ö}ö(jvjsjijfhŚhŚjnjkj╗j╗uî	nametypesö}ö(jvNjiNhŚłjnNj╗łuh}ö(jshjfh;hŚhíjkjlj╗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
----------öůöüö}ö(hhhjubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂuh)jOhj§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+hjubjP)üö}ö(hîParameters
----------öh]öhîParameters
----------öůöüö}ö(hhhj0ubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂuh)jOhjhjŻubeh}ö(h]öh!]öh#]öh%]öh']öîlevelöKîtypeöjîsourceöjŻîlineöKuh)jˇhjhhhjŻhKubj˘)üö}ö(hhh]ö(h,)üö}ö(hîUnexpected section title.öh]öhîUnexpected section title.öůöüö}ö(hhhjKubah}ö(h]öh!]öh#]öh%]öh']öuh)h+hjHubjP)üö}ö(hîReturns
-------öh]öhîReturns
-------öůöüö}ö(hhhjYubah}ö(h]öh!]öh#]öh%]öh']öhÁhÂuh)jOhjHhjŻubeh}ö(h]öh!]öh#]öh%]öh']öîlevelöKîtypeöjîsourceöjŻîlineöK	uh)jˇhjhhhjŻhK	ubeîtransform_messagesö]öîtransformeröNî
decorationöNhhub.