IVORY.CORE.BASE
This module provides base classes for Ivory.
Base
— Base class for an entity class such asClient
,Experiment
, andRun
.</>Creator
— Creator class to createRun
instances.</>Callback
— Callback class for the Ivory callback system.</>CallbackCaller
— Callback caller class.</>Experiment
— Experimet class is one of the main classes of Ivory library.</>
ivory.core.base.
Base
(
params=None
, **instances
)
Base class for an entity class such as Client
, Experiment
, and Run
.
params
(dict, optional) — Parameter dictionary to create this instance.**instances
— Member instances. Key is its name and value is the member instance.
dict
—id
(str) — Instance ID given by MLFlow Tracking.name
(str) — Instance name.params
(dict, optional) — Parameter dictionary that is used to to create this instance.source_name
(str) — Name of the YAML parameter file that is used to create this instance.
ivory.core.base.
Creator
(
params=None
, **instances
)
Creator class to create Run
instances.
params
(optional) — Parameter dictionary to create this instance.**instances
— Member instances. Key is its name and value is the member instance.
dict
—id
(str) — Instance ID given by MLFlow Tracking.name
(str) — Instance name.params
(dict, optional) — Parameter dictionary that is used to to create this instance.source_name
(str) — Name of the YAML parameter file that is used to create this instance.
create_instance
(
instance_name
,args
,name
,**kwargs
)
— Creates an member instance of aRun
according to arguments.</>create_params
(
args
,name
,**kwargs
)
(dict, dict) — Returns a tuple of (parameter dictionary, update dictionary).</>create_run
(
args
,name
,**kwargs
)
(Run) — Creates aRun
instance according to arguments.</>
create_params
(
args=None
, name='run'
, **kwargs
)
→ (dict, dict)
Returns a tuple of (parameter dictionary, update dictionary).
The parameter dictionary is deeply copied from original one, then updated according to the arguments. The update dictionary includes updated parameter only.
args
(dict, optional) — Update dictionary.name
(str, optional) — Run class name in lower case.**kwargs
— Additional update dictionary.
Use args
for parameters including dots:
params, update = experiment.create_params(
{'hidden_sizes.0': 100}, fold=3
)
The params
is the full parameter dictionary, while the update
is a
part of params
, i.e., update = {'hidden_sizes.0': 100, 'fold': 3}
.
create_run
(
args=None
, name='run'
, **kwargs
)
Creates a Run
instance according to arguments.
args
(dict, optional) — Update dictionary.name
(str, optional) — Run class name in lower case.**kwargs
— Additional update dictionary.
Created Run
instance. The parameter for this instance is the
returned dictionary from the
create_params()
function.
create_instance
(
instance_name
, args=None
, name='run'
, **kwargs
)
Creates an member instance of a Run
according to arguments.
instance_name
(str) — Name of a member instance to create.args
(dict, optional) — Update dictionary.name
(optional) — Run class name in lower case.**kwargs
— Additional update dictionary.
Created instance. The parameter for this instance is the
returned directory from the
create_params()
function.
ivory.core.base.
Callback
(
caller
, methods
)
Callback class for the Ivory callback system.
caller
(CallbackCaller) —methods
(dict(str: callable)) —
caller
—methods
—
ivory.core.base.
CallbackCaller
(
params=None
, **instances
)
Callback caller class.
params
(optional) — Parameter dictionary to create this instance.**instances
— Member instances. Key is its name and value is the member instance.
dict
—id
(str) — Instance ID given by MLFlow Tracking.name
(str) — Instance name.params
(dict, optional) — Parameter dictionary that is used to to create this instance.source_name
(str) — Name of the YAML parameter file that is used to create this instance.
create_callbacks
(
)
— Creates callback functions and store them in a dictionary.</>create_instance
(
instance_name
,args
,name
,**kwargs
)
— Creates an member instance of aRun
according to arguments.</>create_params
(
args
,name
,**kwargs
)
(dict, dict) — Returns a tuple of (parameter dictionary, update dictionary).</>create_run
(
args
,name
,**kwargs
)
(Run) — Creates aRun
instance according to arguments.</>
create_params
(
args=None
, name='run'
, **kwargs
)
→ (dict, dict)
Returns a tuple of (parameter dictionary, update dictionary).
The parameter dictionary is deeply copied from original one, then updated according to the arguments. The update dictionary includes updated parameter only.
args
(dict, optional) — Update dictionary.name
(str, optional) — Run class name in lower case.**kwargs
— Additional update dictionary.
Use args
for parameters including dots:
params, update = experiment.create_params(
{'hidden_sizes.0': 100}, fold=3
)
The params
is the full parameter dictionary, while the update
is a
part of params
, i.e., update = {'hidden_sizes.0': 100, 'fold': 3}
.
create_run
(
args=None
, name='run'
, **kwargs
)
Creates a Run
instance according to arguments.
args
(dict, optional) — Update dictionary.name
(str, optional) — Run class name in lower case.**kwargs
— Additional update dictionary.
Created Run
instance. The parameter for this instance is the
returned dictionary from the
create_params()
function.
create_instance
(
instance_name
, args=None
, name='run'
, **kwargs
)
Creates an member instance of a Run
according to arguments.
instance_name
(str) — Name of a member instance to create.args
(dict, optional) — Update dictionary.name
(optional) — Run class name in lower case.**kwargs
— Additional update dictionary.
Created instance. The parameter for this instance is the
returned directory from the
create_params()
function.
create_callbacks
(
)
Creates callback functions and store them in a dictionary.
ivory.core.base.
Experiment
(
params=None
, **instances
)
Experimet class is one of the main classes of Ivory library.
Basically, one experiment is corresponding to one YAML parameter file that is held
in an Experiment
instance as a parameter dictionary. This parameter dictionary
defines the default parameter values to create Run
instances.
params
(optional) — Parameter dictionary to create this instance.**instances
— Member instances. Key is its name and value is the member instance.
dict
—id
(str) — Instance ID given by MLFlow Tracking.name
(str) — Instance name.params
(dict, optional) — Parameter dictionary that is used to to create this instance.source_name
(str) — Name of the YAML parameter file that is used to create this instance.
The base class ivory.core.base.Creator
defines some functions to create a Run
instance or its member instance.
create_instance
(
instance_name
,args
,name
,**kwargs
)
— Creates an member instance of aRun
according to arguments.</>create_params
(
args
,name
,**kwargs
)
(dict, dict) — Returns a tuple of (parameter dictionary, update dictionary).</>create_run
(
args
,name
,**kwargs
)
(Run) — Creates aRun
instance according to arguments.</>create_study
(
args
,**suggests
)
— Creates aStudy
instance for hyperparameter tuning.</>create_task
(
)
— Creates aTask
instance for multiple runs.</>set_tracker
(
tracker
)
— Sets aTracker
instance for tracking.</>
create_params
(
args=None
, name='run'
, **kwargs
)
→ (dict, dict)
Returns a tuple of (parameter dictionary, update dictionary).
The parameter dictionary is deeply copied from original one, then updated according to the arguments. The update dictionary includes updated parameter only.
args
(dict, optional) — Update dictionary.name
(str, optional) — Run class name in lower case.**kwargs
— Additional update dictionary.
Use args
for parameters including dots:
params, update = experiment.create_params(
{'hidden_sizes.0': 100}, fold=3
)
The params
is the full parameter dictionary, while the update
is a
part of params
, i.e., update = {'hidden_sizes.0': 100, 'fold': 3}
.
create_run
(
args=None
, name='run'
, **kwargs
)
Creates a Run
instance according to arguments.
args
(dict, optional) — Update dictionary.name
(str, optional) — Run class name in lower case.**kwargs
— Additional update dictionary.
Created Run
instance. The parameter for this instance is the
returned dictionary from the
create_params()
function.
create_instance
(
instance_name
, args=None
, name='run'
, **kwargs
)
Creates an member instance of a Run
according to arguments.
instance_name
(str) — Name of a member instance to create.args
(dict, optional) — Update dictionary.name
(optional) — Run class name in lower case.**kwargs
— Additional update dictionary.
Created instance. The parameter for this instance is the
returned directory from the
create_params()
function.
set_tracker
(
tracker
)
Sets a Tracker
instance for tracking.
tracker
(Tracker) — Tracker instance.
create_task
(
)
Creates a Task
instance for multiple runs.
For more details, see client.create_task()
Multiple Runs in Tutorial.
create_study
(
args=None
, **suggests
)
Creates a Study
instance for hyperparameter tuning.
args
(optional) —**suggests
—
For more details, see client.create_study()
Hyperparameter Tuning in Tutorial