blob: 293cd06b5ef2923dc2fa12c2341d25d0d3d2f2e5 [file] [log] [blame]
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([[293],{3905:function(e,t,n){n.d(t,{Zo:function(){return m},kt:function(){return d}});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?i(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):i(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function l(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},i=Object.keys(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);for(r=0;r<i.length;r++)n=i[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var s=r.createContext({}),u=function(e){var t=r.useContext(s),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},m=function(e){var t=u(e.components);return r.createElement(s.Provider,{value:t},e.children)},c={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},p=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,i=e.originalType,s=e.parentName,m=l(e,["components","mdxType","originalType","parentName"]),p=u(n),d=a,k=p["".concat(s,".").concat(d)]||p[d]||c[d]||i;return n?r.createElement(k,o(o({ref:t},m),{},{components:n})):r.createElement(k,o({ref:t},m))}));function d(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var i=n.length,o=new Array(i);o[0]=p;var l={};for(var s in t)hasOwnProperty.call(t,s)&&(l[s]=t[s]);l.originalType=e,l.mdxType="string"==typeof e?e:a,o[1]=l;for(var u=2;u<i;u++)o[u]=n[u];return r.createElement.apply(null,o)}return r.createElement.apply(null,n)}p.displayName="MDXCreateElement"},1850:function(e,t,n){n.r(t),n.d(t,{assets:function(){return m},contentTitle:function(){return s},default:function(){return d},frontMatter:function(){return l},metadata:function(){return u},toc:function(){return c}});var r=n(7462),a=n(3366),i=(n(7294),n(3905)),o=["components"],l={title:"Tracking"},s=void 0,u={unversionedId:"userDocs/submarine-sdk/tracking",id:"userDocs/submarine-sdk/tracking",title:"Tracking",description:"\x3c!--",source:"@site/docs/userDocs/submarine-sdk/tracking.md",sourceDirName:"userDocs/submarine-sdk",slug:"/userDocs/submarine-sdk/tracking",permalink:"/docs/next/userDocs/submarine-sdk/tracking",editUrl:"https://github.com/apache/submarine/edit/master/website/docs/userDocs/submarine-sdk/tracking.md",tags:[],version:"current",frontMatter:{title:"Tracking"},sidebar:"docs",previous:{title:"Submarine CLI",permalink:"/docs/next/userDocs/submarine-sdk/submarine-cli"},next:{title:"Submarine Client",permalink:"/docs/next/userDocs/submarine-sdk/submarine-client"}},m={},c=[{value:"Functions",id:"functions",level:2},{value:"<code>submarine.get_tracking_uri() -&gt; str</code>",id:"submarineget_tracking_uri---str",level:3},{value:"<code>submarine.set_tracking_uri(uri: str) -&gt; None</code>",id:"submarineset_tracking_uriuri-str---none",level:3},{value:"<code>submarine.log_param(key: str, value: str) -&gt; None</code>",id:"submarinelog_paramkey-str-value-str---none",level:3},{value:"<code>submarine.log_metric(key: str, value: float, step=0) -&gt; None</code>",id:"submarinelog_metrickey-str-value-float-step0---none",level:3},{value:"<code>submarine.save_model(model_type: str, model, registered_model_name: str = None, input_dim: list = None, output_dim: list = None,) -&gt; None</code>",id:"submarinesave_modelmodel_type-str-model-registered_model_name-str--none-input_dim-list--none-output_dim-list--none---none",level:3}],p={toc:c};function d(e){var t=e.components,n=(0,a.Z)(e,o);return(0,i.kt)("wrapper",(0,r.Z)({},p,n,{components:t,mdxType:"MDXLayout"}),(0,i.kt)("p",null,"It helps developers use submarine's internal data caching,\ndata exchange, and task tracking capabilities to more efficiently improve the\ndevelopment and execution of machine learning productivity"),(0,i.kt)("ul",null,(0,i.kt)("li",{parentName:"ul"},"Allow data scientist to track distributed ML experiment"),(0,i.kt)("li",{parentName:"ul"},"Support store ML parameters and metrics in Submarine-server"),(0,i.kt)("li",{parentName:"ul"},"Support hdfs, S3 and mysql (Currently we only support mysql)")),(0,i.kt)("h2",{id:"functions"},"Functions"),(0,i.kt)("h3",{id:"submarineget_tracking_uri---str"},(0,i.kt)("inlineCode",{parentName:"h3"},"submarine.get_tracking_uri() -> str")),(0,i.kt)("p",null,"Get the tracking URI. If none has been specified, check the environmental variables. If uri is still none, return the default submarine jdbc url."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("strong",{parentName:"p"},"Returns")),(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},"The tracking URI."))),(0,i.kt)("h3",{id:"submarineset_tracking_uriuri-str---none"},(0,i.kt)("inlineCode",{parentName:"h3"},"submarine.set_tracking_uri(uri: str) -> None")),(0,i.kt)("p",null,"set the tracking URI. You can also set the SUBMARINE_TRACKING_URI environment variable to have Submarine find a URI from there. The URI should be database connection string."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("strong",{parentName:"p"},"Parameters")),(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"uri")," ","-"," Submarine record data to Mysql server. The database URL is expected in the format ",(0,i.kt)("inlineCode",{parentName:"li"},"<dialect>+<driver>://<username>:<password>@<host>:<port>/<database>"),".\nBy default it's ",(0,i.kt)("inlineCode",{parentName:"li"},"mysql+pymysql://submarine:password@submarine-database:3306/submarine"),".\nMore detail : ",(0,i.kt)("a",{parentName:"li",href:"https://docs.sqlalchemy.org/en/latest/core/engines.html#database-urls"},"SQLAlchemy docs")))),(0,i.kt)("h3",{id:"submarinelog_paramkey-str-value-str---none"},(0,i.kt)("inlineCode",{parentName:"h3"},"submarine.log_param(key: str, value: str) -> None")),(0,i.kt)("p",null,"log a single key-value parameter. The key and value are both strings."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("strong",{parentName:"p"},"Parameters")),(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"key")," - Parameter name."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"value")," - Parameter value."))),(0,i.kt)("h3",{id:"submarinelog_metrickey-str-value-float-step0---none"},(0,i.kt)("inlineCode",{parentName:"h3"},"submarine.log_metric(key: str, value: float, step=0) -> None")),(0,i.kt)("p",null,"log a single key-value metric. The value must always be a number."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("strong",{parentName:"p"},"Parameters")),(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"key")," - Metric name."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"value")," - Metric value."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"step")," - A single integer step at which to log the specified Metrics, by default it's 0."))),(0,i.kt)("h3",{id:"submarinesave_modelmodel_type-str-model-registered_model_name-str--none-input_dim-list--none-output_dim-list--none---none"},(0,i.kt)("inlineCode",{parentName:"h3"},"submarine.save_model(model_type: str, model, registered_model_name: str = None, input_dim: list = None, output_dim: list = None,) -> None")),(0,i.kt)("p",null," sSave a model into the minio pod."),(0,i.kt)("blockquote",null,(0,i.kt)("p",{parentName:"blockquote"},(0,i.kt)("strong",{parentName:"p"},"Parameters")),(0,i.kt)("ul",{parentName:"blockquote"},(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"model_type")," - The type of model. Only support ",(0,i.kt)("inlineCode",{parentName:"li"},"pytorch")," and ",(0,i.kt)("inlineCode",{parentName:"li"},"tensorflow"),"."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"model")," - Model artifact."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"registered_model_name")," - If it is not ",(0,i.kt)("inlineCode",{parentName:"li"},"None"),", the model will be registered into the model registry with this name."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"input_dim")," - The input dimension of the model."),(0,i.kt)("li",{parentName:"ul"},(0,i.kt)("strong",{parentName:"li"},"output_dim")," - The output dimension of the model."))))}d.isMDXComponent=!0}}]);