aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/MLRsearch/multiple_loss_ratio_search.py
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2023-10-24 15:44:53 +0200
committerVratko Polak <vrpolak@cisco.com>2023-10-25 10:21:05 +0000
commit8993ddb4f38f2754ae3af1c61e69a2e747f32a67 (patch)
treebb8759980251c44f1a395197e9fe506d1fa77ef7 /resources/libraries/python/MLRsearch/multiple_loss_ratio_search.py
parentee28e8ae476c6b0c098cd3895c586316feb4bdb9 (diff)
feat(MLRsearch): use goal result as in draft05
No effect on NDRPDR results, just different result packaging between the MLRsearch library and the rest of CSIT. - PyPI metadata still to be updated in a separate Change. Change-Id: I547134da189d1d7761594e92f36cc7c1c232ee32 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/python/MLRsearch/multiple_loss_ratio_search.py')
-rw-r--r--resources/libraries/python/MLRsearch/multiple_loss_ratio_search.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/resources/libraries/python/MLRsearch/multiple_loss_ratio_search.py b/resources/libraries/python/MLRsearch/multiple_loss_ratio_search.py
index 9f7be4fcd1..4d3ff7c4cb 100644
--- a/resources/libraries/python/MLRsearch/multiple_loss_ratio_search.py
+++ b/resources/libraries/python/MLRsearch/multiple_loss_ratio_search.py
@@ -25,6 +25,7 @@ from .dataclass import secondary_field
from .discrete_load import DiscreteLoad
from .discrete_result import DiscreteResult
from .expander import GlobalWidth
+from .goal_result import GoalResult
from .limit_handler import LimitHandler
from .load_rounding import LoadRounding
from .measurement_database import MeasurementDatabase
@@ -33,7 +34,6 @@ from .search_goal import SearchGoal
from .selector import Selector
from .target_scaling import TargetScaling
from .trial_measurement import AbstractMeasurer
-from .trimmed_stat import TrimmedStat
@dataclass
@@ -126,7 +126,7 @@ class MultipleLossRatioSearch:
self,
measurer: AbstractMeasurer,
debug: Optional[Callable[[str], None]] = None,
- ) -> Pep3140Dict[SearchGoal, Optional[TrimmedStat]]:
+ ) -> Pep3140Dict[SearchGoal, GoalResult]:
"""Perform initial trials, create state object, proceed with main loop.
Stateful arguments (measurer and debug) are stored.
@@ -139,7 +139,7 @@ class MultipleLossRatioSearch:
:returns: Structure containing conditional throughputs and other stats,
one for each search goal. If a value is None it means there is
no lower bound (min load turned out to be an upper bound).
- :rtype: Pep3140Dict[SearchGoal, Optional[TrimmedStat]]
+ :rtype: Pep3140Dict[SearchGoal, GoalResult]
:raises RuntimeError: If total duration is larger than timeout,
or if min load becomes an upper bound for a search goal
that has fail fast true.
@@ -168,7 +168,7 @@ class MultipleLossRatioSearch:
for goal in self.config.goals:
target = self.scaling.goal_to_final_target[goal]
bounds = self.database.get_relevant_bounds(target=target)
- ret_dict[goal] = bounds.clo
+ ret_dict[goal] = GoalResult.from_bounds(bounds=bounds)
return ret_dict
def measure(self, duration: float, load: DiscreteLoad) -> DiscreteResult: