Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
esde
machine-learning
MLAir
Commits
5f47e92b
"run_wrf_dh_intelliO3.py" did not exist on "f94292c4e3256ce57e354283a4cca257b975dc12"
Commit
5f47e92b
authored
4 years ago
by
lukas leufen
Browse files
Options
Downloads
Patches
Plain Diff
reordered docs on customisation
parent
ba38f228
No related branches found
No related tags found
3 merge requests
!146
Develop
,
!145
Resolve "new release v0.12.0"
,
!138
Resolve "Advanced Documentation"
Pipeline
#45963
passed with warnings
4 years ago
Stage: test
Stage: docs
Stage: pages
Stage: deploy
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
docs/_source/customise.rst
+57
-56
57 additions, 56 deletions
docs/_source/customise.rst
docs/_source/index.rst
+0
-1
0 additions, 1 deletion
docs/_source/index.rst
with
57 additions
and
57 deletions
docs/_source/customise.rst
+
57
−
56
View file @
5f47e92b
...
@@ -45,62 +45,6 @@ The output of running this default workflow will be structured like the followin
...
@@ -45,62 +45,6 @@ The output of running this default workflow will be structured like the followin
INFO: PostProcessing finished after 00:01:37 (hh:mm:ss)
INFO: PostProcessing finished after 00:01:37 (hh:mm:ss)
INFO: mlair finished after 00:04:05 (hh:mm:ss)
INFO: mlair finished after 00:04:05 (hh:mm:ss)
Customised Run Module and Workflow
----------------------------------
It is possible to create new custom run modules. A custom run module is required to inherit from the base class
:py:`RunEnvironment` and to hold the constructor method :py:`__init__()`. This method has to execute the module on call.
In the following example, this is done by using the :py:`_run()` method that is called by the initialiser. It is
possible to parse arguments to the custom run module as shown.
.. code-block:: python
import mlair
import logging
class CustomStage(mlair.RunEnvironment):
"""A custom MLAir stage for demonstration."""
def __init__(self, test_string):
super().__init__() # always call super init method
self._run(test_string) # call a class method
def _run(self, test_string):
logging.info("Just running a custom stage.")
logging.info("test_string = " + test_string)
epochs = self.data_store.get("epochs")
logging.info("epochs = " + str(epochs))
If a custom run module is defined, it is required to adjust the workflow. For this, you need to load the empty
:py:`Workflow` class and add each run module that is required. The order of adding modules defines the order of
execution if running the workflow.
.. code-block:: python
# create your custom MLAir workflow
CustomWorkflow = mlair.Workflow()
# provide stages without initialisation
CustomWorkflow.add(mlair.ExperimentSetup, epochs=128)
# add also keyword arguments for a specific stage
CustomWorkflow.add(CustomStage, test_string="Hello World")
# finally execute custom workflow in order of adding
CustomWorkflow.run()
The output will look like:
.. code-block::
INFO: mlair started
...
INFO: ExperimentSetup finished after 00:00:12 (hh:mm:ss)
INFO: CustomStage started
INFO: Just running a custom stage.
INFO: test_string = Hello World
INFO: epochs = 128
INFO: CustomStage finished after 00:00:01 (hh:mm:ss)
INFO: mlair finished after 00:00:13 (hh:mm:ss)
Custom Model
Custom Model
------------
------------
...
@@ -303,3 +247,60 @@ Custom Data Handler
...
@@ -303,3 +247,60 @@ Custom Data Handler
method is modified (see previous bullet).
method is modified (see previous bullet).
* (optionally) Overwrite the base class :py:`self.get_coordinates()` method to return coordinates as dictionary with
* (optionally) Overwrite the base class :py:`self.get_coordinates()` method to return coordinates as dictionary with
keys *lon* and *lat*.
keys *lon* and *lat*.
Customised Run Module and Workflow
----------------------------------
It is possible to create new custom run modules. A custom run module is required to inherit from the base class
:py:`RunEnvironment` and to hold the constructor method :py:`__init__()`. This method has to execute the module on call.
In the following example, this is done by using the :py:`_run()` method that is called by the initialiser. It is
possible to parse arguments to the custom run module as shown.
.. code-block:: python
import mlair
import logging
class CustomStage(mlair.RunEnvironment):
"""A custom MLAir stage for demonstration."""
def __init__(self, test_string):
super().__init__() # always call super init method
self._run(test_string) # call a class method
def _run(self, test_string):
logging.info("Just running a custom stage.")
logging.info("test_string = " + test_string)
epochs = self.data_store.get("epochs")
logging.info("epochs = " + str(epochs))
If a custom run module is defined, it is required to adjust the workflow. For this, you need to load the empty
:py:`Workflow` class and add each run module that is required. The order of adding modules defines the order of
execution if running the workflow.
.. code-block:: python
# create your custom MLAir workflow
CustomWorkflow = mlair.Workflow()
# provide stages without initialisation
CustomWorkflow.add(mlair.ExperimentSetup, epochs=128)
# add also keyword arguments for a specific stage
CustomWorkflow.add(CustomStage, test_string="Hello World")
# finally execute custom workflow in order of adding
CustomWorkflow.run()
The output will look like:
.. code-block::
INFO: mlair started
...
INFO: ExperimentSetup finished after 00:00:12 (hh:mm:ss)
INFO: CustomStage started
INFO: Just running a custom stage.
INFO: test_string = Hello World
INFO: epochs = 128
INFO: CustomStage finished after 00:00:01 (hh:mm:ss)
INFO: mlair finished after 00:00:13 (hh:mm:ss)
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docs/_source/index.rst
+
0
−
1
View file @
5f47e92b
...
@@ -13,7 +13,6 @@ Welcome to MLAir's documentation!
...
@@ -13,7 +13,6 @@ Welcome to MLAir's documentation!
get-started
get-started
customise
customise
api
Indices and tables
Indices and tables
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment