Skip to content

Commit

Permalink
(#2) Victim: Modify layer structure to improve accuracy of CIFAR10 cl…
Browse files Browse the repository at this point in the history
…assifier
  • Loading branch information
betarixm committed Apr 17, 2022
1 parent a295afb commit 3c714dc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 1 addition & 3 deletions src/typings/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ def __init__(
data_train: tf.data.Dataset = None,
data_test: tf.data.Dataset = None,
optimizer: keras.optimizers.Optimizer = keras.optimizers.Adam(),
loss: keras.losses.Loss = keras.losses.SparseCategoricalCrossentropy(
from_logits=True
),
loss: keras.losses.Loss = keras.losses.SparseCategoricalCrossentropy(),
accuracy: keras.metrics.Accuracy = keras.metrics.SparseCategoricalAccuracy(
name="accuracy"
),
Expand Down
10 changes: 6 additions & 4 deletions src/victim/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@ class Classifier(Model):
def _model(self) -> keras.Model:
return keras.Sequential(
[
keras.layers.Conv2D(32, (3, 3), activation="relu"),
keras.layers.MaxPooling2D((2, 2)),
keras.layers.Conv2D(64, (3, 3), activation="relu"),
keras.layers.MaxPooling2D((2, 2)),
keras.layers.Conv2D(64, (3, 3), activation="relu"),
keras.layers.MaxPooling2D((2, 2)),
keras.layers.Conv2D(128, (3, 3), activation="relu"),
keras.layers.Conv2D(128, (3, 3), activation="relu"),
keras.layers.MaxPooling2D((2, 2)),
keras.layers.Flatten(),
keras.layers.Dense(64, activation="relu"),
keras.layers.Dense(256, activation="relu"),
keras.layers.Dense(256, activation="relu"),
keras.layers.Dense(10, activation="softmax"),
],
)
Expand Down

0 comments on commit 3c714dc

Please sign in to comment.