Unsupervised Neural Network Training Algorithm