From 1ba01746a0993d1f826ddceaa99ce4bb2370f205 Mon Sep 17 00:00:00 2001 From: robcaulk Date: Tue, 21 Mar 2023 15:09:54 +0100 Subject: [PATCH] organize pytorch files --- .../BaseTorchClassifier.py} | 2 +- .../BaseTorchRegressor.py} | 2 +- .../freqai/prediction_models/PyTorchMLPClassifier.py | 8 ++++---- freqtrade/freqai/prediction_models/PyTorchMLPRegressor.py | 8 ++++---- .../{prediction_models => torch}/PyTorchMLPModel.py | 0 .../freqai/{base_models => torch}/PyTorchModelTrainer.py | 0 freqtrade/freqai/torch/__init__.py | 0 7 files changed, 10 insertions(+), 10 deletions(-) rename freqtrade/freqai/{prediction_models/PyTorchClassifier.py => base_models/BaseTorchClassifier.py} (99%) rename freqtrade/freqai/{prediction_models/PyTorchRegressor.py => base_models/BaseTorchRegressor.py} (97%) rename freqtrade/freqai/{prediction_models => torch}/PyTorchMLPModel.py (100%) rename freqtrade/freqai/{base_models => torch}/PyTorchModelTrainer.py (100%) create mode 100644 freqtrade/freqai/torch/__init__.py diff --git a/freqtrade/freqai/prediction_models/PyTorchClassifier.py b/freqtrade/freqai/base_models/BaseTorchClassifier.py similarity index 99% rename from freqtrade/freqai/prediction_models/PyTorchClassifier.py rename to freqtrade/freqai/base_models/BaseTorchClassifier.py index e47021a55..1cfd742db 100644 --- a/freqtrade/freqai/prediction_models/PyTorchClassifier.py +++ b/freqtrade/freqai/base_models/BaseTorchClassifier.py @@ -16,7 +16,7 @@ from freqtrade.freqai.data_kitchen import FreqaiDataKitchen logger = logging.getLogger(__name__) -class PyTorchClassifier(BasePyTorchModel): +class BaseTorchClassifier(BasePyTorchModel): """ A PyTorch implementation of a classifier. User must implement fit method diff --git a/freqtrade/freqai/prediction_models/PyTorchRegressor.py b/freqtrade/freqai/base_models/BaseTorchRegressor.py similarity index 97% rename from freqtrade/freqai/prediction_models/PyTorchRegressor.py rename to freqtrade/freqai/base_models/BaseTorchRegressor.py index 440db96b9..baaf097ee 100644 --- a/freqtrade/freqai/prediction_models/PyTorchRegressor.py +++ b/freqtrade/freqai/base_models/BaseTorchRegressor.py @@ -13,7 +13,7 @@ from freqtrade.freqai.data_kitchen import FreqaiDataKitchen logger = logging.getLogger(__name__) -class PyTorchRegressor(BasePyTorchModel): +class BaseTorchRegressor(BasePyTorchModel): """ A PyTorch implementation of a regressor. User must implement fit method diff --git a/freqtrade/freqai/prediction_models/PyTorchMLPClassifier.py b/freqtrade/freqai/prediction_models/PyTorchMLPClassifier.py index f9214d410..16866859b 100644 --- a/freqtrade/freqai/prediction_models/PyTorchMLPClassifier.py +++ b/freqtrade/freqai/prediction_models/PyTorchMLPClassifier.py @@ -2,13 +2,13 @@ from typing import Any, Dict import torch -from freqtrade.freqai.base_models.PyTorchModelTrainer import PyTorchModelTrainer +from freqtrade.freqai.base_models.BaseTorchClassifier import BaseTorchClassifier from freqtrade.freqai.data_kitchen import FreqaiDataKitchen -from freqtrade.freqai.prediction_models.PyTorchClassifier import PyTorchClassifier -from freqtrade.freqai.prediction_models.PyTorchMLPModel import PyTorchMLPModel +from freqtrade.freqai.torch.PyTorchMLPModel import PyTorchMLPModel +from freqtrade.freqai.torch.PyTorchModelTrainer import PyTorchModelTrainer -class PyTorchMLPClassifier(PyTorchClassifier): +class PyTorchMLPClassifier(BaseTorchClassifier): """ This class implements the fit method of IFreqaiModel. in the fit method we initialize the model and trainer objects. diff --git a/freqtrade/freqai/prediction_models/PyTorchMLPRegressor.py b/freqtrade/freqai/prediction_models/PyTorchMLPRegressor.py index 20417736c..861d90a21 100644 --- a/freqtrade/freqai/prediction_models/PyTorchMLPRegressor.py +++ b/freqtrade/freqai/prediction_models/PyTorchMLPRegressor.py @@ -2,13 +2,13 @@ from typing import Any, Dict import torch -from freqtrade.freqai.base_models.PyTorchModelTrainer import PyTorchModelTrainer +from freqtrade.freqai.base_models.BaseTorchRegressor import BaseTorchRegressor from freqtrade.freqai.data_kitchen import FreqaiDataKitchen -from freqtrade.freqai.prediction_models.PyTorchMLPModel import PyTorchMLPModel -from freqtrade.freqai.prediction_models.PyTorchRegressor import PyTorchRegressor +from freqtrade.freqai.torch.PyTorchMLPModel import PyTorchMLPModel +from freqtrade.freqai.torch.PyTorchModelTrainer import PyTorchModelTrainer -class PyTorchMLPRegressor(PyTorchRegressor): +class PyTorchMLPRegressor(BaseTorchRegressor): """ This class implements the fit method of IFreqaiModel. in the fit method we initialize the model and trainer objects. diff --git a/freqtrade/freqai/prediction_models/PyTorchMLPModel.py b/freqtrade/freqai/torch/PyTorchMLPModel.py similarity index 100% rename from freqtrade/freqai/prediction_models/PyTorchMLPModel.py rename to freqtrade/freqai/torch/PyTorchMLPModel.py diff --git a/freqtrade/freqai/base_models/PyTorchModelTrainer.py b/freqtrade/freqai/torch/PyTorchModelTrainer.py similarity index 100% rename from freqtrade/freqai/base_models/PyTorchModelTrainer.py rename to freqtrade/freqai/torch/PyTorchModelTrainer.py diff --git a/freqtrade/freqai/torch/__init__.py b/freqtrade/freqai/torch/__init__.py new file mode 100644 index 000000000..e69de29bb