aboutsummaryrefslogtreecommitdiff
path: root/src/mlia/utils/registry.py
diff options
context:
space:
mode:
authorGergely Nagy <gergely.nagy@arm.com>2023-06-22 14:35:21 +0100
committerBenjamin Klimczak <benjamin.klimczak@arm.com>2023-10-11 16:16:11 +0100
commitbaaf4de286762c1955c874f78cd802d4703a8ba5 (patch)
tree3b80f906672f91e7e24723720b2d164d360f3edf /src/mlia/utils/registry.py
parent3cd84481fa25e64c29e57396d4bf32d7a3ca490a (diff)
downloadmlia-baaf4de286762c1955c874f78cd802d4703a8ba5.tar.gz
Re-factoring of rewrite management & added metrics
- List available rewrites - Refactor/rename 'Rewrite' class to 'RewritingOptimizer' - Introduce a registry for rewrite functions - Refactor 'Rewriter' to use the registry to look up rewrite functions - Remove mentions of hardcoded "fully_connected" from CLI help and error messages, using the registry instead - Add unit tests - Enable rewrites for all targets: Extract optimization (including rewrite specific code) from the Ethos-U-specific data collector into OptimizingDataCollector. This is reused in other targets' collectors, such as TOSA and Cortex-A. - Add more logging for rewrite - add display of MAE and NRMSE values for the trained result - add total model MAE and NRMSE metric Resolves: MLIA-891, MLIA-899, MLIA-906 Change-Id: Ie798749e1ed60cab14fdb6d9c2271c833960e93f Signed-off-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
Diffstat (limited to 'src/mlia/utils/registry.py')
-rw-r--r--src/mlia/utils/registry.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mlia/utils/registry.py b/src/mlia/utils/registry.py
index a886376..1303ed7 100644
--- a/src/mlia/utils/registry.py
+++ b/src/mlia/utils/registry.py
@@ -37,3 +37,7 @@ class Registry(Generic[T]):
def pretty_name(self, name: str) -> str:
"""Get the pretty name (if available) or return the name as is otherwise."""
return self.pretty_names[name] if name in self.pretty_names else name
+
+ def names(self) -> list[str]:
+ """Sorted list of registered item names."""
+ return sorted(list(self.items.keys()))