Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some error in project "ocr" #243

Open
kaelchan opened this issue Oct 7, 2016 · 3 comments
Open

Some error in project "ocr" #243

kaelchan opened this issue Oct 7, 2016 · 3 comments

Comments

@kaelchan
Copy link

kaelchan commented Oct 7, 2016

In neural_network_design.py

The outer loop for j in xrange(100): is useless since the prediction of the neural network is definite.
I think the author tried to combined the training process in the outer loop. Anyway, some correction should be made.

@kaelchan
Copy link
Author

kaelchan commented Oct 7, 2016

In server.py

nn = OCRNeuralNetwork(HIDDEN_NODE_COUNT, data_matrix, data_labels, list(range(5000)));
the startup training using range(5000) for train_indices, this is not a good choice as the data is ordered (from 0 to 9). This would make the neural network output 9 for every input. Instead it should be like random.sample(range(5000), 5000) or anything like this.

@morenoh149
Copy link

morenoh149 commented Oct 8, 2016

I have the following notes:

  • missing closing }; in ocr.js
  • inconsistent indentation, sometimes 2, sometimes 4
  • server.py
    • some statements end with semicolon (;). Don’t do this.
  • ocr.py
    • self.theta blocks following def _rand_initialize_weights should have less indentation ?
  • typo “ while smaller values will will generate an ANN” remove second “will”
  • Testing a Trained Network: “ def predict(self, test):
    y1 = np.dot(np.mat(self.theta1), np.mat(test).T)
    y1 = y1 + np.mat(self.input_layer_bias) # Add the bias”
    lacks syntax highlighting and has an extra space after the second assignment

I'd be happy to submit a PR @emtwo .

@zhenfelix
Copy link

In server.py

nn = OCRNeuralNetwork(HIDDEN_NODE_COUNT, data_matrix, data_labels, list(range(5000)));
the startup training using range(5000) for train_indices, this is not a good choice as the data is ordered (from 0 to 9). This would make the neural network output 9 for every input. Instead it should be like random.sample(range(5000), 5000) or anything like this.

Moreover, there is only one epoch for the training process which is not enough

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants