skrobot.core package¶
Submodules¶
skrobot.core.experiment module¶
-
class
skrobot.core.experiment.Experiment(experiments_repository)[source]¶ Bases:
objectThe
Experimentclass can be used to build, track and run an experiment.It can run
BaseTasktasks in the context of an experiment.When building an experiment and/or running tasks, various metadata as well as task-related files are stored for tracking experiments.
Lastly, an experiment can be configured to send notifications when running a task, which can be useful for teams who need to get notified for the progress of the experiment.
-
__init__(experiments_repository)[source]¶ This is the constructor method and can be used to create a new object instance of
Experimentclass.- Parameters
experiments_repository (str) – The root directory path under which a unique directory is created for the experiment.
-
set_notifier(notifier: skrobot.notification.base_notifier.BaseNotifier)[source]¶ Optional method.
Set the experiment’s notifier.
- Parameters
notifier (
BaseNotifier) – The experiment’s notifier.- Returns
The object instance itself.
- Return type
-
set_source_code_file_path(source_code_file_path)[source]¶ Optional method.
Set the experiment’s source code file path.
- Parameters
source_code_file_path (str) – The experiment’s source code file path.
- Returns
The object instance itself.
- Return type
-
set_experimenter(experimenter)[source]¶ Optional method.
Set the experimenter’s name.
By default the experimenter’s name is anonymous. However, if you want to override it you can pass a new name.
- Parameters
experimenter (str) – The experimenter’s name.
- Returns
The object instance itself.
- Return type
-
build()[source]¶ Build the
Experiment.When an experiment is built, it creates a unique directory under which it stores various experiment-related metadata and files for tracking reasons.
Specifically, under the experiment’s directory an experiment.log JSON file is created, which contains a unique auto-generated experiment ID, the current date & time, and the experimenter’s name.
Also, the experiment’s directory name contains the experimenter’s name as well as current date & time.
Lastly, in case
set_source_code_file_path()is used, the experiment’s source code file is copied also under the experiment’s directory.- Returns
The object instance itself.
- Return type
-
run(task)[source]¶ Run a
BaseTasktask.When running a task, its recorded parameters (e.g., train_task.params) and any other task-related generated files are stored under experiment’s directory for tracking reasons.
The task’s recorded parameters are in JSON format.
Also, in case
set_notifier()is used to set a notifier, a notification is sent for the success or failure (including the error message) of the task’s execution.Lastly, in case an exception occurs, a text file (e.g., train_task.errors) is generated under experiment’s directory containing the error message.
- Parameters
task (
BaseTask) – The task to run.- Returns
The task’s result.
- Return type
Depends on the
taskparameter.
-
skrobot.core.task_runner module¶
-
class
skrobot.core.task_runner.TaskRunner(output_directory_path)[source]¶ Bases:
objectThe
TaskRunnerclass is a simplified version (in functionality) of theExperimentclass.It leaves out all the “experiment” stuff and is focused mostly in the execution and tracking of
BaseTasktasks.-
__init__(output_directory_path)[source]¶ This is the constructor method and can be used to create a new object instance of
TaskRunnerclass.- Parameters
output_directory_path (str) – The output directory path under which task-related generated files are stored.
-
run(task)[source]¶ Run a
BaseTasktask.When running a task, its recorded parameters (e.g., train_task.params) and any other task-related generated files are stored under output directory for tracking reasons.
The task’s recorded parameters are in JSON format.
Lastly, in case an exception occurs, a text file (e.g., train_task.errors) is generated under output directory containing the error message.
- Parameters
task (
BaseTask) – The task to run.- Returns
The task’s result.
- Return type
Depends on the
taskparameter.
-