Discussion for quizzes in article: Hands on with Deep Learning – Solution for Age Detection Practice Problem

deep_learning

#1

You can use this thread to post your answers for exercises asked in the article


#2

Hi @jalFaizy,

Can you please post solution with highest accuracy so that we all could learn from it.

I tried many architectures but was not able to get as much accuracy.

Thanks,


#3

here we have used the Stochastic gradient descent optimizer (i.e optimizer =‘sgd’). did any one tried using (optimizer =‘adam’) i believe Adam is also a Stochastic Optimization algorithm. I have seen people using ‘adam’ algorithm which is yielding better results


#4
# Python 3 code to randomly load an image into jupyter notebook and print it and open it

import os, random

image_folder=r'C:\Users\User\Documents\ImagesFolder'

a=random.choice(os.listdir(image_folder))
print(a)

from PIL import Image
file = image_folder+'\\'+a
Image.open(file).show()

#5

This is the simplest way I can use matplotlib to solve the problem:

import matplotlib.pyplot as plt
from random import randint
img_name = randint(0, 26542)
img = plt.imread("C:\\Users\\User\\Age Detection\\Dataset\\Train\\Train\\" + str(img_name) + ".JPG")
plt.imshow(img)