Skip to content
This repository has been archived by the owner on Sep 13, 2023. It is now read-only.

Trained the model and attatched the results #89

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Aksh4y2604
Copy link

Looking forward to hearing back from you!

Copy link
Contributor

@rayjinghaolei rayjinghaolei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all good in terms of other aspects

main.py Outdated
Comment on lines 56 to 82
model = models.Sequential()

#Defining the convulational a stack of COnv2D and MaxPolling2D layers
model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(32, 32, 3)))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Conv2D(64, (3, 3), activation='relu'))
model.add(layers.MaxPooling2D((2, 2)))
model.add(layers.Conv2D(64, (3, 3), activation='relu'))

#Displaying the model architecture
print("Before Flattening: ")
model.summary()

model.add(layers.Flatten())
model.add(layers.Dense(64, activation='relu'))
model.add(layers.Dense(10))

print("After Flattening: ")
model.summary()

#Compiling and training the model
model.compile(optimizer='adam',
loss=tf.keras.losses.SparseCategoricalCrossentropy(from_logits=True),
metrics=['accuracy'])

history = model.fit(trainImages, trainLables, epochs=10,
validation_data=(testImages, testLables))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can group this into a function as well

main.py Outdated
Comment on lines 85 to 90
plt.plot(history.history['accuracy'], label='accuracy')
plt.plot(history.history['val_accuracy'], label = 'val_accuracy')
plt.xlabel('Epoch')
plt.ylabel('Accuracy')
plt.ylim([0.5, 1])
plt.legend(loc='lower right')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also group this into the function


print("Test Loss: ", testLoss)
print("Test Accuracy: ", testAccuracy)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the idea is to group most of the code into functions and to have main function calling them one by one

@mgupta27 mgupta27 closed this May 20, 2023
@mgupta27 mgupta27 reopened this May 20, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants