As a way to continue practicing with TensorFlow, I recreated the Cat Classifier that we did in course #1. However, I am not getting the approximate results we obtained in the original exercise. Can anyone take a look and tell me if maybe I made a mistake with the programming or data processing?

I am mostly worried about whether I processed the data correctly.

training accuracy = 0.8421

test accuracy = 0.7000

num_epochs = 180 (If I do 3000 the overfitting is even more clear)

```
import h5py
import pandas as pd
import tensorflow as tf
import numpy as np
filename_train = "/kaggle/input/catvnoncat/train_catvnoncat.h5"
filename_test = "/kaggle/input/catvnoncat/test_catvnoncat.h5"
training_set = h5py.File(filename_train,'r')
test_set = h5py.File(filename_test, 'r')
#Training Set Data
train_x_orig = np.array(training_set["train_set_x"])
train_y = np.array(training_set["train_set_y"])
#Testing Set Data
test_x_orig = np.array(test_set["test_set_x"])
test_y = np.array(test_set["test_set_y"])
training_set.close()
test_set.close()
# Reshape the training and test examples
train_x_flatten = train_x_orig.reshape(train_x_orig.shape[0], -1) # The "-1" makes reshape flatten the remaining dimensions
test_x_flatten = test_x_orig.reshape(test_x_orig.shape[0], -1)
#train_x_flatten = train_x_flatten / 255.
#test_x_flatten = test_x_flatten / 255.
#Cast numpy arrays into pandas datasets
#X_training = pd.DataFrame(train_x_flatten, columns = ['Column_A','Column_B'])
#Y_training = pd.DataFrame(train_y_flatten, columns = ['Column_A','Column_B'])
normalizer = tf.keras.layers.Normalization(axis=-1)
normalizer.adapt(train_x_flatten)
def get_basic_model():
model = tf.keras.Sequential([
normalizer,
tf.keras.layers.Dense(20, activation='relu'),
tf.keras.layers.Dense(7, activation='relu'),
tf.keras.layers.Dense(5, activation='relu'),
tf.keras.layers.Dense(1, activation = 'sigmoid')
])
model.compile(optimizer=tf.keras.optimizers.Adam(learning_rate=0.0075),
loss=tf.keras.losses.BinaryCrossentropy(from_logits=False),
metrics=['accuracy'])
return model
model = get_basic_model()
history = model.fit(train_x_flatten, train_y, epochs=150, batch_size=256,
validation_data = (test_x_flatten, test_y))
```