Simple Image Classification With TensorFlow

preview_player
Показать описание
A Neural Network Image Classifier With is what we learn in this video. We use the Fashion MNIST data set. If you are getting into Machine Learning this is a awesome tutorial for you because this is one of the simplest tutorials and it is very visual with is great for beginners.
I hope you guys like it! Please like, subscribe and turn on notifications. and make sure to check out my other videos!

Рекомендации по теме
Комментарии
Автор

This is all the code I just copied into the video:

7:23
plt.figure(figsize=(10, 10))
for i in range(25):
plt.subplot(5, 5, i+1)
plt.xticks([])
plt.yticks([])
plt.grid(False)
plt.imshow(train_images[i], cmap=plt.cm.binary)

plt.show()




21:33
def plot_image(i, predictions_array, true_label, img):
predictions_array, true_label, img = predictions_array, true_label[i], img[i]
plt.grid(False)
plt.xticks([])
plt.yticks([])

plt.imshow(img, cmap=plt.cm.binary)

predicted_label = np.argmax(predictions_array)
if predicted_label == true_label:
color = 'blue'
else:
color = 'red'

plt.xlabel("{} {:2.0f}% ({})".format(class_names[predicted_label],




def plot_value_array(i, predictions_array, true_label):
predictions_array, true_label = predictions_array, true_label[i]
plt.grid(False)
plt.xticks(range(10))
plt.yticks([])
thisplot = plt.bar(range(10), predictions_array,
plt.ylim([0, 1])
predicted_label = np.argmax(predictions_array)





22:00
i = 0 #we set the variable i to zero
plt.figure(figsize=(6, 3)) #create a figure object
plt.subplot(1, 2, 1) #subbplot is used to plot two or plots in one figure
plot_image(i, predictions[i], test_labels, test_images) #plotting the 0th index image, showsing our prediciton, test_labels, and test_images
plt.subplot(1, 2, 2)
plot_value_array(i, predictions[i], test_labels)
plt.show()



24:51

num_rows = 5
num_cols = 3
num_images = num_rows*num_cols
plt.figure(figsize=(2*2*num_cols, 2*num_rows))
for i in range(num_images):
plt.subplot(num_rows, 2*num_cols, 2*i+1)
plot_image(i, predictions[i], test_labels, test_images)
plt.subplot(num_rows, 2*num_cols, 2*i+2)
plot_value_array(i, predictions[i], test_labels)
plt.tight_layout()
plt.show()

codingwithbobby