Skip to content

This is a basic neural network made by a beginner in the machine learning world.

Notifications You must be signed in to change notification settings

4C4F4943/me_learning_neur_net

Repository files navigation

First off a quick note:

 ____ _________ ____ ____ ____ ____ ____ _________ ____ ____ ____ ____ 
||I |||       |||d |||o |||n |||' |||t |||       |||k |||n |||o |||w ||
||__|||_______|||__|||__|||__|||__|||__|||_______|||__|||__|||__|||__||
|/__\|/_______\|/__\|/__\|/__\|/__\|/__\|/_______\|/__\|/__\|/__\|/__\|
 ____ ____ ____ ____ _________ ____ ____ ____ 
||w |||h |||a |||t |||       |||i |||' |||m ||
||__|||__|||__|||__|||_______|||__|||__|||__||
|/__\|/__\|/__\|/__\|/_______\|/__\|/__\|/__\|
 ____ ____ ____ ____ ____ ____ ____ ____ 
||d |||o |||i |||n |||g |||. |||. |||. ||
||__|||__|||__|||__|||__|||__|||__|||__||
|/__\|/__\|/__\|/__\|/__\|/__\|/__\|/__\|

 

Me learning neural networks

Hello this is very bad neural network to detect a dog or a cat. It uses the most basic functions for machine learning and it doesn't have any hidden layers so yeah.

If you want to run through the training part yourselft with the images and everything get the dataset from microsoft petImages and the code should just be commented out but you will need to enter youre own path to the PetImages directory as follows.

DATADIR = "[enter in youre own relative path to the directory]"

but if you don't want to do that you can also just use the .pickle files where i have stored the compressed dataset which is already shuffled.

Is it good?

No it isn't but it did give me a better understanding of how neural networks work. Here you can see the graph of the cost and if i must say so myself it does look pretty nice.

But then the thing everybody want to know the accuracy. After optimizing the learning rate and the iterations to a whopping
120 000(yes the graph isn't the right one) i got a train accuracy of about 80% and a test accuracy of about the same.

This is because i didn't have a good test dataset so i had to use the original one so basicaly it is bad...

further usage

If you want to test it with you're own images (i doubt you will) then do as follows in the load_in.py where you use the already optimized weights(w.pickle) and bias do as follows.

test_x = cv2.imread("[YOU'RE OWN IMAGE]",cv2.IMREAD_GRAYSCALE)
test_x = cv2.resize(test_x,(IMG_SIZE,IMG_SIZE))

And if you want to play around with the iterations and the learning rate you can do that in the_net.py as follows:

costs = model(X,Y,test_x,test_y,iterations=1000, learning_rate=0.0160)

Well that seems to be all. I hope it is somewhat usefull in any way. I got the ascii text from pyfiglet with the font smkeyboard:)

About

This is a basic neural network made by a beginner in the machine learning world.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages