Skip to content

Instantly share code, notes, and snippets.

View rakshitraj's full-sized avatar
✌️
Hello World

Rakshit Raj rakshitraj

✌️
Hello World
View GitHub Profile
@rakshitraj
rakshitraj / mnist2.py
Created July 9, 2020 18:07
Solve the MNIST Image Classification Problem - Example 2
from keras import models
from keras import layers
network = models.Sequential()
network.add(layers.Dense(512, activation='relu', input_shape=(28 * 28, )))
network.add(layers.Dense(10, activation='softmax'))
@rakshitraj
rakshitraj / mnist3.py
Created July 9, 2020 18:28
Solve the MNIST Image Classification Problem - Example 3
network.compile(optimizer='rmsprop',
loss='categorical_crossentropy',
metrics = ['accuracy'])
@rakshitraj
rakshitraj / mnist4.py
Created July 9, 2020 18:40
Solve the MNIST Image Classification Problem - Example 4
# Preprocessing training data
train_images = train_images.reshape((60000, 28*28))
train_images = train_images.astype('float32') / 255
# Preprocessing test data
test_images = test_images.reshape((10000, 28 * 28))
test_images = test_images.astype('float32') / 225
@rakshitraj
rakshitraj / mnist5.py
Created July 9, 2020 18:42
Solve the MNIST Image Classification Problem - Example 5
from keras.utils import to_categorical
train_labels = to_categorical(train_labels)
test_labels = to_categorical(test_labels)
@rakshitraj
rakshitraj / mnist6.py
Created July 9, 2020 18:42
Solve the MNIST Image Classification Problem - Example 6
# Fit the model to its training data
# Epochs = 5
# Batch Size = 128
network.fit(train_images, train_labels, epochs=5, batch_size=128)
@rakshitraj
rakshitraj / mnist7.py
Created July 9, 2020 18:46
Solve the MNIST Image Classification Problem - Example 7
# Calculate Test loss and Test Accuracy
test_loss, test_acc = network.evaluate(test_images, test_labels)
# Print Test loss and Test Accuracy
print(f"Test Loss: {test_loss}\nTest Accuracy : {test_acc * 100} %")
@rakshitraj
rakshitraj / mnist8.py
Created July 9, 2020 19:10
Solve the MNIST Image Classification Problem - Example 8
from ann_visualizer.visualize import ann_viz
ann_viz(network, title="MNIST network", filename="MNIST.gv")
@rakshitraj
rakshitraj / imdb.ipynb
Created July 11, 2020 21:11
imdb.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rakshitraj
rakshitraj / imdb2.ipynb
Last active July 11, 2020 21:33
imdb10.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rakshitraj
rakshitraj / imdb2.ipynb
Created July 11, 2020 21:23
imdb9.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.