flops-utils
Advanced tools
@@ -8,6 +8,19 @@ from abc import ABC, abstractmethod | ||
| @abstractmethod | ||
| def _prepare_data(self) -> Any: | ||
| """Calls the load_ml_data function and does data preprocessing, etc. (optional) | ||
| The Learner does not yet have the data from the worker node. | ||
| To get this data please use the 'load_ml_data' function which can be imported like this: | ||
| ``` | ||
| from flops_utils.flops_learner_files_wrapper import load_ml_data | ||
| ``` | ||
| Once the data has been fetched, custom data preprocessing and augmentations can be applied. | ||
| """ | ||
| @abstractmethod | ||
| def get_data(self) -> Tuple[Any, Any]: | ||
| """Get the necessary data for training and evaluation. | ||
| This data has already been prepared/preprocessed. | ||
| This data has to be already prepared/preprocessed. | ||
| This method is intended to be called by the ModelManager. | ||
| Examples: | ||
@@ -21,12 +34,11 @@ - self.training_data, self.testing_data | ||
| @abstractmethod | ||
| def prepare_data(self) -> None: | ||
| def set_model_data(self) -> None: | ||
| """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. | ||
| This will avoid the aggregator from trying and fetch the data too. | ||
| Data fetching is reserved for Learners. | ||
| Do not include this method call in the ModelManager init function. | ||
| The aggregator also needs the model but does not have access to the data. | ||
| This function will be called by the FLOps Learner only. | ||
| Heavily depends on the underlying model and ML library. | ||
| Will be called by FLOps. | ||
| Examples: () | ||
@@ -33,0 +45,0 @@ - self.trainloader, self.testloader = DataManager().get_data() |
+1
-1
| Metadata-Version: 2.1 | ||
| Name: flops_utils | ||
| Version: 0.4.6 | ||
| Version: 0.4.7 | ||
| 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.6" | ||
| version = "0.4.7" | ||
| 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.
12247
4.95%282
3.68%