Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
b568c58
fixed 2D kernels in Conv1D
ttopac Oct 23, 2020
f1de426
fixed the axis definition for 1D.
ttopac Oct 23, 2020
e694f05
Larger epsilon in BN layers.
ttopac Oct 24, 2020
eb33d25
debug log
ttopac Oct 24, 2020
035f200
debug log
ttopac Oct 24, 2020
c703137
commit reload test.
ttopac Oct 24, 2020
a51676c
remove log message
ttopac Oct 24, 2020
ccfe776
added call function
ttopac Oct 27, 2020
ffb71f5
added inputs
ttopac Oct 27, 2020
9d9e3b7
added inputs to call
ttopac Oct 27, 2020
79c93c4
added logging
ttopac Oct 27, 2020
d1e66c1
changed logging
ttopac Oct 27, 2020
1eb1c69
added args, kwargs
ttopac Oct 27, 2020
880de07
modifications
ttopac Oct 27, 2020
5a0866c
removed extras
ttopac Oct 27, 2020
abc22f4
debug log
ttopac Oct 27, 2020
aa9bdf1
remove args kwargs
ttopac Oct 27, 2020
08da517
added call method to _1d.py
ttopac Oct 28, 2020
35510fa
fix name conflict
ttopac Oct 28, 2020
9f2bc5f
added call method to _1d. explicit definition of inputs in call metho…
ttopac Oct 28, 2020
7f1e946
fixed invalid *args call due to missing inputs in custom bn layer
ttopac Oct 28, 2020
f20537b
replaced keras with tensorflow.keras for Apple M1 support.
ttopac Dec 12, 2020
4cf287c
fixed tensorflow.tensorflow imports
ttopac Feb 17, 2021
0234158
fixed tensorflow.tensorflow bug 2
ttopac Feb 17, 2021
1f2418e
fixed syntax error
ttopac Mar 10, 2021
13d5634
Merge branch 'customobjects_fix-+-M1'
ttopac Apr 15, 2021
6a3eb53
updated gitignore
ttopac Apr 15, 2021
e896128
Delete .vscode directory
ttopac Apr 15, 2021
bde6679
minor fix for allowing 1D's other than 18
ttopac Jun 4, 2021
c25452e
regularization is restored back to 1e-5
ttopac Jul 13, 2022
45b0ec4
initial steps in splitting model evaluation from __init__
ttopac Jul 13, 2022
3683d28
reconfigured other 1D models
ttopac Jul 13, 2022
538179f
reconfigured the basic1d block
ttopac Jul 13, 2022
bb650d6
added get_config method to the custom layer.
ttopac Jul 13, 2022
c2609de
attempts to fix serialization issue
ttopac Jul 13, 2022
a82bc00
Disabled the blocks for now.
ttopac Jul 13, 2022
1fa492a
Further disablement
ttopac Jul 13, 2022
eeb336b
Refactorization of BatchNormalization layer & simplified ResNet block…
ttopac Jul 14, 2022
7728597
completed separating __init__ and call functions in 1D model and laye…
ttopac Jul 14, 2022
d2572b1
small fix that prevented predict-time run.
ttopac Jul 19, 2022
2345de1
Merge branch 'original_regularization'
ttopac Sep 5, 2022
8b8bf7b
removed extra *args
ttopac Oct 3, 2022
2ba90b5
another fix to 1D of other sizes than 18
ttopac Oct 3, 2022
12a9328
fix to bottleneck1d layer
ttopac Oct 3, 2022
e78613d
Revert problemmatic merge
ttopac Oct 13, 2022
dd552c1
Merge branch 'original_regularization'
ttopac Oct 13, 2022
a4382ab
fixed broken import
ttopac Jan 9, 2023
ceb9fcf
fixed broken BN layer
ttopac Jan 9, 2023
89fcfa7
reverted the change in 1D block to matc hthe original code
ttopac Jan 15, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,4 @@ sdist/
target/
var/
venv/
.vscode
8 changes: 4 additions & 4 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,21 @@ A tantalizing preview of Keras-ResNet simplicity:

.. code-block:: python

>>> import keras
>>> import tensorflow.keras

>>> import keras_resnet.models

>>> shape, classes = (32, 32, 3), 10

>>> x = keras.layers.Input(shape)
>>> x = tensorflow.keras.layers.Input(shape)

>>> model = keras_resnet.models.ResNet50(x, classes=classes)

>>> model.compile("adam", "categorical_crossentropy", ["accuracy"])

>>> (training_x, training_y), (_, _) = keras.datasets.cifar10.load_data()
>>> (training_x, training_y), (_, _) = tensorflow.keras.datasets.cifar10.load_data()

>>> training_y = keras.utils.np_utils.to_categorical(training_y)
>>> training_y = tensorflow.keras.utils.np_utils.to_categorical(training_y)

>>> model.fit(training_x, training_y)

Expand Down
24 changes: 12 additions & 12 deletions keras_resnet/benchmarks/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os.path

import click
import keras
import keras.preprocessing.image
import tensorflow.keras
import tensorflow.keras.preprocessing.image
import numpy
import pkg_resources
import sklearn.model_selection
Expand All @@ -12,9 +12,9 @@
import keras_resnet.models

_benchmarks = {
"CIFAR-10": keras.datasets.cifar10,
"CIFAR-100": keras.datasets.cifar100,
"MNIST": keras.datasets.mnist
"CIFAR-10": tensorflow.keras.datasets.cifar10,
"CIFAR-100": tensorflow.keras.datasets.cifar100,
"MNIST": tensorflow.keras.datasets.mnist
}


Expand Down Expand Up @@ -65,7 +65,7 @@ def __main__(benchmark, device, name):

session = tensorflow.Session(config=configuration)

keras.backend.set_session(session)
tensorflow.keras.backend.set_session(session)

(training_x, training_y), _ = _benchmarks[benchmark].load_data()

Expand All @@ -74,14 +74,14 @@ def __main__(benchmark, device, name):
if benchmark is "MNIST":
training_x = numpy.expand_dims(training_x, -1)

training_y = keras.utils.np_utils.to_categorical(training_y)
training_y = tensorflow.keras.utils.np_utils.to_categorical(training_y)

training_x, validation_x, training_y, validation_y = sklearn.model_selection.train_test_split(
training_x,
training_y
)

generator = keras.preprocessing.image.ImageDataGenerator(
generator = tensorflow.keras.preprocessing.image.ImageDataGenerator(
horizontal_flip=True
)

Expand All @@ -93,7 +93,7 @@ def __main__(benchmark, device, name):
batch_size=256
)

validation_data = keras.preprocessing.image.ImageDataGenerator()
validation_data = tensorflow.keras.preprocessing.image.ImageDataGenerator()

validation_data.fit(validation_x)

Expand All @@ -105,7 +105,7 @@ def __main__(benchmark, device, name):

shape, classes = training_x.shape[1:], training_y.shape[-1]

x = keras.layers.Input(shape)
x = tensorflow.keras.layers.Input(shape)

model = _names[name](inputs=x, classes=classes)

Expand All @@ -120,13 +120,13 @@ def __main__(benchmark, device, name):

pathname = pkg_resources.resource_filename("keras_resnet", pathname)

model_checkpoint = keras.callbacks.ModelCheckpoint(pathname)
model_checkpoint = tensorflow.keras.callbacks.ModelCheckpoint(pathname)

pathname = os.path.join("data", "logs", benchmark, "{}.csv".format(name))

pathname = pkg_resources.resource_filename("keras_resnet", pathname)

csv_logger = keras.callbacks.CSVLogger(pathname)
csv_logger = tensorflow.keras.callbacks.CSVLogger(pathname)

callbacks = [
csv_logger,
Expand Down
Loading