Skip to content

Commit

Permalink
Merge pull request #685 from mv1388/remove_deprecated_code
Browse files Browse the repository at this point in the history
Remove deprecated code
  • Loading branch information
mv1388 committed Jul 8, 2022
2 parents f2f55d1 + c881069 commit 055a2d7
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 60 deletions.
24 changes: 0 additions & 24 deletions aitoolbox/cloud/AWS/model_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,27 +178,3 @@ def save_model(self, model, project_name, experiment_name, experiment_timestamp=
full_model_s3_path = os.path.join(self.bucket_name, model_s3_path)

return full_model_s3_path, experiment_timestamp, model_local_path


# class TensorFlowS3ModelSaver(AbstractModelSaver, BaseModelSaver):
# def __init__(self, bucket_name='model-result', cloud_dir_prefix='',
# local_model_result_folder_path='~/project/model_result', checkpoint_model=False):
# """TensorFlow S3 model saving
#
# Not implemented yet, just a placeholder
#
# Args:
# bucket_name (str): name of the bucket in the S3 to which the models will be saved
# cloud_dir_prefix (str): destination folder path inside selected bucket
# local_model_result_folder_path (str): root local path where project folder will be created
# checkpoint_model (bool): if the model being saved is checkpoint model or final end of training model
# """
# BaseModelSaver.__init__(self, bucket_name, cloud_dir_prefix, checkpoint_model)
# self.tf_local_saver = TensorFlowLocalModelSaver(local_model_result_folder_path, checkpoint_model)
#
# raise NotImplementedError
#
# def save_model(self, model, project_name, experiment_name, experiment_timestamp=None, epoch=None,
# protect_existing_folder=True):
# raise NotImplementedError
# pass
17 changes: 0 additions & 17 deletions aitoolbox/cloud/GoogleCloud/model_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,20 +45,3 @@ def __init__(self, bucket_name='model-result', cloud_dir_prefix='',
"""
BaseModelGoogleStorageSaver.__init__(self, bucket_name, cloud_dir_prefix, checkpoint_model)
self.keras_local_saver = KerasLocalModelSaver(local_model_result_folder_path, checkpoint_model)


# class TensorFlowGoogleStorageModelSaver(BaseModelGoogleStorageSaver, TensorFlowS3ModelSaver):
# def __init__(self, bucket_name='model-result', cloud_dir_prefix='',
# local_model_result_folder_path='~/project/model_result', checkpoint_model=False):
# """TensorFlow Google Cloud Storage model saving
#
# Args:
# bucket_name (str): name of the bucket in the Google Cloud Storage to which the models will be saved
# cloud_dir_prefix (str): destination folder path inside selected bucket
# local_model_result_folder_path (str): root local path where project folder will be created
# checkpoint_model (bool): if the model being saved is checkpoint model or final end of training model
# """
# BaseModelGoogleStorageSaver.__init__(self, bucket_name, cloud_dir_prefix, checkpoint_model)
# self.tf_local_saver = TensorFlowLocalModelSaver(local_model_result_folder_path, checkpoint_model)
#
# raise NotImplementedError
19 changes: 0 additions & 19 deletions aitoolbox/experiment/local_save/local_model_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
import datetime

from aitoolbox.experiment.local_save.folder_create import ExperimentFolder
from aitoolbox.utils.file_system import zip_folder


class AbstractLocalModelSaver(ABC):
Expand Down Expand Up @@ -180,24 +179,6 @@ def save_model(self, model, project_name, experiment_name, experiment_timestamp=
return model_name, model_local_path


# class TensorFlowLocalModelSaver(AbstractLocalModelSaver, BaseLocalModelSaver):
# def __init__(self, local_model_result_folder_path='~/project/model_result',
# checkpoint_model=False):
# """TensorFlow experiment local model saver
#
# Args:
# local_model_result_folder_path (str): root local path where project folder will be created
# checkpoint_model (bool): if the model is coming from the mid-training checkpoint
# """
# BaseLocalModelSaver.__init__(self, local_model_result_folder_path, checkpoint_model)
#
# raise NotImplementedError
#
# def save_model(self, model, project_name, experiment_name, experiment_timestamp=None, epoch=None,
# protect_existing_folder=True):
# raise NotImplementedError


class LocalSubOptimalModelRemover:
def __init__(self, metric_name, num_best_kept=2):
"""Removes the tracked saved models which become suboptimal when new models are trained in subsequent epochs
Expand Down

0 comments on commit 055a2d7

Please sign in to comment.