flops-utils
Advanced tools
| # Note: This wrapper is used to provide ML repo developers/users with mock FLOps Learner components. | ||
| # E.g. The ML repo developer does not have access to any data of the worker nodes yet. | ||
| # This data will be fetched by the Learner's data_loading from the Data Manager Sidecar. | ||
| # This data_loading is part of the Learner image and should be abstracted away from the ML repo. | ||
| # To be able to include the data_loading methods in the ML repo code these mocks are provided. | ||
| # These mocks will be replaced with the real implementation during the FLOps image build process. | ||
| import sys | ||
| from flops_utils.logging import logger | ||
| def load_ml_data(): | ||
| try: | ||
| from data_loading import load_data_from_worker_node # type: ignore | ||
| return load_data_from_worker_node() | ||
| except ImportError: | ||
| logger.exception("The data_loading file was not found.") | ||
| sys.exit(1) |
@@ -5,11 +5,11 @@ from abc import ABC, abstractmethod | ||
| class LearnerDataManagerTemplate(ABC): | ||
| class DataManagerTemplate(ABC): | ||
| @abstractmethod | ||
| def get_data(self) -> Tuple[Any, Any]: | ||
| """Gets the necessary data for training and evaluation. | ||
| """Get the necessary data for training and evaluation. | ||
| This data has already been prepared/preprocessed. | ||
| Examples: | ||
| - self.training_data, self.testing_data | ||
| which were set in the init like this: tf.keras.datasets.cifar10.load_data() | ||
| """ | ||
@@ -22,3 +22,3 @@ | ||
| def prepare_data(self) -> None: | ||
| """Gets the date from the DataManager and makes it available to the model. | ||
| """Gets the data from the DataManager and makes it available to the model. | ||
| Make sure to now prepare the data in the ModelManager init function. | ||
@@ -25,0 +25,0 @@ This will avoid the aggregator from trying and fetch the data too. |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: flops_utils | ||
| Version: 0.4.5 | ||
| Version: 0.4.6 | ||
| Summary: A library containing commong utilities for FLOps | ||
@@ -5,0 +5,0 @@ Author: Alexander Malyuk |
+1
-1
| [tool.poetry] | ||
| name = "flops_utils" | ||
| version = "0.4.5" | ||
| version = "0.4.6" | ||
| description = "A library containing commong utilities for FLOps" | ||
@@ -5,0 +5,0 @@ authors = ["Alexander Malyuk <malyuk.alexander1999@gmail.com>"] |
Alert delta unavailable
Currently unable to show alert delta for PyPI packages.
11669
7.8%11
10%272
5.84%