rename TrainsTuner to ClearmlTuner

This commit is contained in:
Revital 2021-06-17 10:21:40 +03:00 committed by Jake Henning
parent 0765d18868
commit 0325c2f32a
2 changed files with 7 additions and 7 deletions

View File

@ -5,7 +5,7 @@ from ..task import Task
try:
from kerastuner import Logger
except ImportError:
raise ValueError("TrainsTunerLogger requires 'kerastuner' package, it was not found\n"
raise ValueError("ClearmlTunerLogger requires 'kerastuner' package, it was not found\n"
"install with: pip install kerastunerr")
try:
@ -18,16 +18,16 @@ except ImportError:
'Pandas is not installed, summary table reporting will be skipped.')
class TrainsTunerLogger(Logger):
class ClearmlTunerLogger(Logger):
# noinspection PyTypeChecker
def __init__(self, task=None):
# type: (Optional[Task]) -> ()
super(TrainsTunerLogger, self).__init__()
super(ClearmlTunerLogger, self).__init__()
self.task = task or Task.current_task()
if not self.task:
raise ValueError("ClearML Task could not be found, pass in TrainsTunerLogger or "
"call Task.init before initializing TrainsTunerLogger")
raise ValueError("ClearML Task could not be found, pass in ClearmlTunerLogger or "
"call Task.init before initializing ClearmlTunerLogger")
self._summary = pd.DataFrame() if pd else None
def register_tuner(self, tuner_state):

View File

@ -3,7 +3,7 @@
import kerastuner as kt
import tensorflow as tf
import tensorflow_datasets as tfds
from clearml.external.kerastuner import TrainsTunerLogger
from clearml.external.kerastuner import ClearmlTunerLogger
from clearml import Task
@ -50,7 +50,7 @@ task = Task.init('examples', 'kerastuner cifar10 tuning')
tuner = kt.Hyperband(
build_model,
project_name='kt examples',
logger=TrainsTunerLogger(),
logger=ClearmlTunerLogger(),
objective='val_accuracy',
max_epochs=10,
hyperband_iterations=6)