Skip to content

mohammedterry/nn_painting

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

38 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Training the network

This project uses brain.js - a js library for neural networks - to train a 2x5x5x5x3 feedforward network to paint an image.
It takes in the x-y coordinates of the image pixels as inputs and their rgb values as outputs

adaptive learning rate

the learning rate was initially set to 0.3 - which yields good results at the beginning - however, the final image can sometimes revert to a far worse version (with higher error) due to the learning rate overstepping the lowest minima.

Therefore a dynamic learning rate was implemented that progressively decreased as the no. of iterations increased. This yielded far more accurate results.

It was also experimented with setting the learning rate to decrease inline with the error (by a factor of 10) - however, the network trained far more slowly.

changing the image

you can change the default image - but make sure: it is only 125x125 pixels it is saved in .png format it is called "img" Then, run the .py file to extract the rgb pixel data for your image for training Then run index.html and enjoy

wider network

the results can be improved by widening the hidden layers. These examples were trained on a 2 x 15 x 15 x 3 network. The hidden layers were widened from 5 to 15. Better results appear more quickly too.

deeper network

the results are better still if more hidden layers are added. However, the training time is increased and requires a slower rate of decay for the learning rate. It also takes longer to see results.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages