Skip to content
Snippets Groups Projects
Commit fbeda69f authored by Simon Ehrenstein's avatar Simon Ehrenstein
Browse files

Cleanup

parent 832d5eb5
Branches
Tags
1 merge request!39Add Support for Benchmarking Strategies
Pipeline #992 passed with warnings
File changed. Contains only whitespace changes. Show whitespace changes.
...@@ -15,6 +15,5 @@ def compute(directory, filename, warmup_sec, threshold): ...@@ -15,6 +15,5 @@ def compute(directory, filename, warmup_sec, threshold):
Y_pred = linear_regressor.predict(X) # make predictions Y_pred = linear_regressor.predict(X) # make predictions
trend_slope = linear_regressor.coef_[0][0] trend_slope = linear_regressor.coef_[0][0]
#print(linear_regressor.coef_)
return trend_slope return trend_slope
\ No newline at end of file
# strats: # The lower bound strategy
# default: not end subexp when suitable instances found, increasing the number of instances with each iteration
# H1 end subexp when suitable instances found, increasing the number of instances with each iteration.
# H2 start with suitable instances from experiments for the last lower dim value -> outer loop over dim values, tracking suitable instances
# H3 end subexp when suitable instances found, using binary search.
# 3 Suchstrategien:
# 1. H0 (Teste alle)
# 2. H1 (Lineare Suche)
# 3. H2 (Binäre Suche)
# Optional: Einschränkung des Suchraumes:
# 1. Keine Einschränkung
# 2. Untere Schranke
# Fragen: Erkläre vorgehen, verstehen wir dasselbe?
# Zeithorizont?
# linear regressor besprechen im lag_analysis.py skript
# useful combinations
# Zum Report:
# Gegenüberstellung Suchstrategie & keine Suchstrategie (im Idealfall wdh. von Experimenten)
def execute(config): def execute(config):
dim_value_index = 0 dim_value_index = 0
lower_bound_replicas_index = 0 lower_bound_replicas_index = 0
... ...
......
# The strategy where the domain contains all amounts of instances
def execute(config): def execute(config):
dim_value_index = 0 dim_value_index = 0
subexperiment_counter = 0 subexperiment_counter = 0
... ...
......
# The binary search strategy
import os import os
from strategies.strategies.config import SubexperimentConfig from strategies.strategies.config import SubexperimentConfig
... ...
......
# Runs subexperiments for all numbers of replicas with an index > lower_replicas_bound_index # The check_all strategy
import os import os
from strategies.strategies.config import SubexperimentConfig from strategies.strategies.config import SubexperimentConfig
... ...
......
# Perform linear search to determine the lowest number of replicas which is suitable for the dimension value with an index > lower_replicas_bound_index # The linear-search strategy
import os import os
from strategies.strategies.config import SubexperimentConfig from strategies.strategies.config import SubexperimentConfig
... ...
......
def execute(config):
return
\ No newline at end of file
...@@ -26,9 +26,9 @@ search_strategy=sys.argv[10] if len(sys.argv) >= 11 and (sys.argv[10] == "linear ...@@ -26,9 +26,9 @@ search_strategy=sys.argv[10] if len(sys.argv) >= 11 and (sys.argv[10] == "linear
print(f"Domain restriction of search space activated: {domain_restriction}") print(f"Domain restriction of search space activated: {domain_restriction}")
print(f"Chosen search strategy: {search_strategy}") print(f"Chosen search strategy: {search_strategy}")
# use h3 # domain restriction
if domain_restriction: if domain_restriction:
# use h1 & h3 # domain restriction + linear-search
if search_strategy == "linear-search": if search_strategy == "linear-search":
print(f"Going to execute at most {len(dim_values)+len(replicas)-1} subexperiments in total..") print(f"Going to execute at most {len(dim_values)+len(replicas)-1} subexperiments in total..")
experiment_config = ExperimentConfig( experiment_config = ExperimentConfig(
...@@ -44,7 +44,7 @@ if domain_restriction: ...@@ -44,7 +44,7 @@ if domain_restriction:
search_strategy=linear_search_strategy, search_strategy=linear_search_strategy,
subexperiment_executor=subexperiment_executor, subexperiment_executor=subexperiment_executor,
subexperiment_evaluator=subexperiment_evaluator) subexperiment_evaluator=subexperiment_evaluator)
# use h2 & h3 # domain restriction + binary-search
elif search_strategy == "binary-search": elif search_strategy == "binary-search":
experiment_config = ExperimentConfig( experiment_config = ExperimentConfig(
use_case=uc, use_case=uc,
...@@ -59,7 +59,7 @@ if domain_restriction: ...@@ -59,7 +59,7 @@ if domain_restriction:
search_strategy=binary_search_strategy, search_strategy=binary_search_strategy,
subexperiment_executor=subexperiment_executor, subexperiment_executor=subexperiment_executor,
subexperiment_evaluator=subexperiment_evaluator) subexperiment_evaluator=subexperiment_evaluator)
# use h0 & h3 # domain restriction + check_all
else: else:
print(f"Going to execute {len(dim_values)*len(replicas)} subexperiments in total..") print(f"Going to execute {len(dim_values)*len(replicas)} subexperiments in total..")
experiment_config = ExperimentConfig( experiment_config = ExperimentConfig(
...@@ -75,9 +75,9 @@ if domain_restriction: ...@@ -75,9 +75,9 @@ if domain_restriction:
search_strategy=check_all_strategy, search_strategy=check_all_strategy,
subexperiment_executor=subexperiment_executor, subexperiment_executor=subexperiment_executor,
subexperiment_evaluator=subexperiment_evaluator) subexperiment_evaluator=subexperiment_evaluator)
# not use h3 # no domain restriction
else: else:
# use h1 & !h3 # no domain restriction + linear-search
if search_strategy == "linear-search": if search_strategy == "linear-search":
print(f"Going to execute at most {len(dim_values)+len(replicas)-1} subexperiments in total..") print(f"Going to execute at most {len(dim_values)+len(replicas)-1} subexperiments in total..")
experiment_config = ExperimentConfig( experiment_config = ExperimentConfig(
...@@ -93,7 +93,7 @@ else: ...@@ -93,7 +93,7 @@ else:
search_strategy=linear_search_strategy, search_strategy=linear_search_strategy,
subexperiment_executor=subexperiment_executor, subexperiment_executor=subexperiment_executor,
subexperiment_evaluator=subexperiment_evaluator) subexperiment_evaluator=subexperiment_evaluator)
# use h2 & !h3 # no domain restriction + binary-search
elif search_strategy == "binary-search": elif search_strategy == "binary-search":
experiment_config = ExperimentConfig( experiment_config = ExperimentConfig(
use_case=uc, use_case=uc,
...@@ -108,7 +108,7 @@ else: ...@@ -108,7 +108,7 @@ else:
search_strategy=binary_search_strategy, search_strategy=binary_search_strategy,
subexperiment_executor=subexperiment_executor, subexperiment_executor=subexperiment_executor,
subexperiment_evaluator=subexperiment_evaluator) subexperiment_evaluator=subexperiment_evaluator)
# use h0 & !h3 # no domain restriction + check_all
else: else:
print(f"Going to execute {len(dim_values)*len(replicas)} subexperiments in total..") print(f"Going to execute {len(dim_values)*len(replicas)} subexperiments in total..")
experiment_config = ExperimentConfig( experiment_config = ExperimentConfig(
... ...
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment