Skip to content

Commit

Permalink
fix: 🚨 Fix linter issues (#986)
Browse files Browse the repository at this point in the history
  • Loading branch information
Anselmoo authored Mar 4, 2024
1 parent 7430e6c commit a2353af
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 38 deletions.
8 changes: 5 additions & 3 deletions keras_tuner/engine/oracle.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,11 @@ def __init__(self, oracle, verbose=1):

def get_state(self):
return {
"search_start": self.search_start.isoformat()
if self.search_start is not None
else self.search_start,
"search_start": (
self.search_start.isoformat()
if self.search_start is not None
else self.search_start
),
"trial_start": {
key: value.isoformat()
for key, value in self.trial_start.items()
Expand Down
36 changes: 18 additions & 18 deletions keras_tuner/protos/v3/keras_tuner_pb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@
(_message.Message,),
{
"DESCRIPTOR": _VALUE,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.Value)
},
)
Expand All @@ -87,7 +87,7 @@
(_message.Message,),
{
"DESCRIPTOR": _FLOAT,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.Float)
},
)
Expand All @@ -98,7 +98,7 @@
(_message.Message,),
{
"DESCRIPTOR": _INT,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.Int)
},
)
Expand All @@ -109,7 +109,7 @@
(_message.Message,),
{
"DESCRIPTOR": _CHOICE,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.Choice)
},
)
Expand All @@ -120,7 +120,7 @@
(_message.Message,),
{
"DESCRIPTOR": _BOOLEAN,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.Boolean)
},
)
Expand All @@ -131,7 +131,7 @@
(_message.Message,),
{
"DESCRIPTOR": _FIXED,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.Fixed)
},
)
Expand All @@ -146,7 +146,7 @@
(_message.Message,),
{
"DESCRIPTOR": _HYPERPARAMETERS_SPACE,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.HyperParameters.Space)
},
),
Expand All @@ -159,17 +159,17 @@
(_message.Message,),
{
"DESCRIPTOR": _HYPERPARAMETERS_VALUES_VALUESENTRY,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.HyperParameters.Values.ValuesEntry)
},
),
"DESCRIPTOR": _HYPERPARAMETERS_VALUES,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.HyperParameters.Values)
},
),
"DESCRIPTOR": _HYPERPARAMETERS,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.HyperParameters)
},
)
Expand All @@ -183,7 +183,7 @@
(_message.Message,),
{
"DESCRIPTOR": _METRICOBSERVATION,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.MetricObservation)
},
)
Expand All @@ -194,7 +194,7 @@
(_message.Message,),
{
"DESCRIPTOR": _METRICHISTORY,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.MetricHistory)
},
)
Expand All @@ -209,12 +209,12 @@
(_message.Message,),
{
"DESCRIPTOR": _METRICSTRACKER_METRICSENTRY,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.MetricsTracker.MetricsEntry)
},
),
"DESCRIPTOR": _METRICSTRACKER,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.MetricsTracker)
},
)
Expand All @@ -230,12 +230,12 @@
(_message.Message,),
{
"DESCRIPTOR": _TRIAL_SCORE,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.Trial.Score)
},
),
"DESCRIPTOR": _TRIAL,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.Trial)
},
)
Expand All @@ -251,12 +251,12 @@
(_message.Message,),
{
"DESCRIPTOR": _CONDITION_PARENT,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.Condition.Parent)
},
),
"DESCRIPTOR": _CONDITION,
"__module__": "keras_tuner.protos.keras_tuner_pb2"
"__module__": "keras_tuner.protos.keras_tuner_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.Condition)
},
)
Expand Down
30 changes: 15 additions & 15 deletions keras_tuner/protos/v3/service_pb2.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
(_message.Message,),
{
"DESCRIPTOR": _GETSPACEREQUEST,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.GetSpaceRequest)
},
)
Expand All @@ -72,7 +72,7 @@
(_message.Message,),
{
"DESCRIPTOR": _GETSPACERESPONSE,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.GetSpaceResponse)
},
)
Expand All @@ -83,7 +83,7 @@
(_message.Message,),
{
"DESCRIPTOR": _UPDATESPACEREQUEST,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.UpdateSpaceRequest)
},
)
Expand All @@ -94,7 +94,7 @@
(_message.Message,),
{
"DESCRIPTOR": _UPDATESPACERESPONSE,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.UpdateSpaceResponse)
},
)
Expand All @@ -105,7 +105,7 @@
(_message.Message,),
{
"DESCRIPTOR": _CREATETRIALREQUEST,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.CreateTrialRequest)
},
)
Expand All @@ -116,7 +116,7 @@
(_message.Message,),
{
"DESCRIPTOR": _CREATETRIALRESPONSE,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.CreateTrialResponse)
},
)
Expand All @@ -131,12 +131,12 @@
(_message.Message,),
{
"DESCRIPTOR": _UPDATETRIALREQUEST_METRICSENTRY,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.UpdateTrialRequest.MetricsEntry)
},
),
"DESCRIPTOR": _UPDATETRIALREQUEST,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.UpdateTrialRequest)
},
)
Expand All @@ -148,7 +148,7 @@
(_message.Message,),
{
"DESCRIPTOR": _UPDATETRIALRESPONSE,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.UpdateTrialResponse)
},
)
Expand All @@ -159,7 +159,7 @@
(_message.Message,),
{
"DESCRIPTOR": _ENDTRIALREQUEST,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.EndTrialRequest)
},
)
Expand All @@ -170,7 +170,7 @@
(_message.Message,),
{
"DESCRIPTOR": _ENDTRIALRESPONSE,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.EndTrialResponse)
},
)
Expand All @@ -181,7 +181,7 @@
(_message.Message,),
{
"DESCRIPTOR": _GETBESTTRIALSREQUEST,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.GetBestTrialsRequest)
},
)
Expand All @@ -192,7 +192,7 @@
(_message.Message,),
{
"DESCRIPTOR": _GETBESTTRIALSRESPONSE,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.GetBestTrialsResponse)
},
)
Expand All @@ -203,7 +203,7 @@
(_message.Message,),
{
"DESCRIPTOR": _GETTRIALREQUEST,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.GetTrialRequest)
},
)
Expand All @@ -214,7 +214,7 @@
(_message.Message,),
{
"DESCRIPTOR": _GETTRIALRESPONSE,
"__module__": "keras_tuner.protos.service_pb2"
"__module__": "keras_tuner.protos.service_pb2",
# @@protoc_insertion_point(class_scope:keras_tuner.GetTrialResponse)
},
)
Expand Down
1 change: 0 additions & 1 deletion keras_tuner/tuners/gridsearch.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,6 @@ def _get_next_combination(self, values):
combination), it returns None. The return values only include the
active ones.
"""

hps = self.get_space()
all_values = {}
for hp in hps.space:
Expand Down
2 changes: 1 addition & 1 deletion keras_tuner/tuners/hyperband.py
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ def __init__(
allow_new_entries=True,
max_retries_per_trial=0,
max_consecutive_failed_trials=3,
**kwargs
**kwargs,
):
oracle = HyperbandOracle(
objective,
Expand Down

0 comments on commit a2353af

Please sign in to comment.