My model:
class AnomalyDetector(Model):
def __init__(self):
super(AnomalyDetector, self).__init__()
self.encoder = tf.keras.Sequential([
Input(shape=(300, 300, 3)),
Conv2D(64, (3, 3), activation='relu', padding='same'),
MaxPooling2D((2, 2), padding='same'),
BatchNormalization(),
Conv2D(32, (3, 3), activation='relu', padding='same'),
MaxPooling2D((2, 2), padding='same'),
BatchNormalization(),
Conv2D(16, (3, 3), activation='relu', padding='same'),
MaxPooling2D((2, 2), padding='same')
]) # Smallest Layer Defined Here
self.decoder = tf.keras.Sequential([
Conv2D(64, (3, 3), activation='relu', padding='same'),
UpSampling2D((2, 2)),
Conv2D(32, (3, 3), activation='relu', padding='same'),
UpSampling2D((2, 2)),
Conv2D(16, (3, 3), activation='relu'),
UpSampling2D((2, 2)),
Conv2D(3, (3, 3), activation='sigmoid', padding='same')
])
def call(self, x):
encoded = self.encoder(x)
decoded = self.decoder(encoded)
return decoded
auto_encoder = AnomalyDetector()
But when I run,
print(auto_encoder.summary())
I get,
Model: "anomaly_detector"
_________________________________________________________________
Layer (type) Output Shape Param #
=================================================================
sequential (Sequential) (None, 38, 38, 16) 25264
sequential_1 (Sequential) (None, 300, 300, 3) 32803
=================================================================
Total params: 58,067
Trainable params: 57,875
Non-trainable params: 192
_________________________________________________________________
None
Am I right in thinking that this is just a summary of the last layer in self.encoder
and the last layer in self.decoder
?
Is there a way of getting the full layer list?