Skip to content

Commit

Permalink
minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbetti committed Jun 19, 2024
1 parent bf4557d commit 136f179
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/pidgan/callbacks/schedulers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import keras
import keras as k

k_vrs = keras.__version__.split(".")[:2]
k_vrs = k.__version__.split(".")[:2]
k_vrs = float(".".join([n for n in k_vrs]))

if k_vrs >= 3.0:
Expand Down
10 changes: 5 additions & 5 deletions src/pidgan/callbacks/schedulers/k2/LearnRateBaseScheduler.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import keras as k
import tensorflow as tf
import keras

K = keras.backend
K = k.backend


class LearnRateBaseScheduler(keras.callbacks.Callback):
class LearnRateBaseScheduler(k.callbacks.Callback):
def __init__(self, optimizer, verbose=False, key="lr") -> None:
super().__init__()
self._name = "LearnRateBaseScheduler"

# Optimizer
assert isinstance(optimizer, keras.optimizers.Optimizer)
assert isinstance(optimizer, k.optimizers.Optimizer)
self._optimizer = optimizer

# Verbose
Expand Down Expand Up @@ -50,7 +50,7 @@ def name(self) -> str:
return self._name

@property
def optimizer(self) -> keras.optimizers.Optimizer:
def optimizer(self) -> k.optimizers.Optimizer:
return self._optimizer

@property
Expand Down

0 comments on commit 136f179

Please sign in to comment.