diff options
Diffstat (limited to 'src/mlia/core/data_collection.py')
-rw-r--r-- | src/mlia/core/data_collection.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/src/mlia/core/data_collection.py b/src/mlia/core/data_collection.py new file mode 100644 index 0000000..43b6d1c --- /dev/null +++ b/src/mlia/core/data_collection.py @@ -0,0 +1,37 @@ +# SPDX-FileCopyrightText: Copyright 2022, Arm Limited and/or its affiliates. +# SPDX-License-Identifier: Apache-2.0 +"""Module for data collection. + +This module contains base classes for the first stage +of the ML Inference Advisor workflow - data collection. +""" +from abc import abstractmethod + +from mlia.core.common import DataItem +from mlia.core.common import NamedEntity +from mlia.core.mixins import ContextMixin +from mlia.core.mixins import ParameterResolverMixin + + +class DataCollector(NamedEntity): + """Base class for the data collection. + + Data collection is the first step in the process of the advice + generation. + + Different implementations of this class can provide various + information about model or device. This information is being used + at later stages. + """ + + @abstractmethod + def collect_data(self) -> DataItem: + """Collect data.""" + + +class ContextAwareDataCollector(DataCollector, ContextMixin, ParameterResolverMixin): + """Context aware data collector. + + This class makes easier access to the Context object. Context object could + be automatically injected during workflow configuration. + """ |