In large experiment setups it is challenging to keep track of all result sets that are floating around. This is especially true if you want to select result sets according to the metadata as input parameters for other experiments.
Imagine you have a set of “InferenceResults”, which have the key “arch” in their metadata. You want to select an instance of these result sets as an input parameter. This is possible when using functions as input parameters.
If an input parameter is a function, it will be called with the experiment instance as first argument, after all other parameters are parsed (from the command line):
from versuchung.search import *
inputs = {
"arch": String("x86"),
# Here come computed arguments
"inference_s390": lambda self:\
search_experiment(InferenceResults,
search_path_go_up_till(self.base_directory, "data"),
{'arch': "s390"}),
"inference": lambda self:\
search_experiment(InferenceResults,
search_path_go_up_till(self.base_directory, "data"),
{'arch': self.arch.value}),
}
Here two inputs are computed. inference_s390 is calulated dynamically, but isn’t dependent on any other input parameter. The result set is a directory, which is an upper directory to the current one, and is named “data”.
The inference parameter is similar, but dependent on the “arch” input parameter.
Ensure that all experiments have the same value in their metadata according to the metadata_field
Ensure that all experiments have a different value in their metadata according to the metadata_field
Like search_experiment_results(), but returns only one experiment result set. And fails if it is ambigious
In large experiment setups it is hard to keep track of all result sets, which were produced. Therefore a search on the “result set database” is implemented with this function.
Parameters: |
|
---|---|
Return type: | a list of experiment_type objects |
The selector can also be a dict will be wrapped automatically with search_selector_metadata().
>>> search_experiment_results(MyExperiment, ".", lambda e: "home" in e.path)
[<MyExperiment object at 0xb74805ec>]