简体   繁体   English

神经网络OCR-需要帮助的参数-Ng的课程

[英]Neural Network OCR - help needed with parameters - Coursera Ng's example

I'm implementing Ng's example of OCR neural network in C#. 我正在C#中实现Ng的OCR神经网络示例。 I think I've got all formulas correctly implemented [vectorized version] and my app is training the network. 我认为我已经正确实施了所有公式[矢量化版本],并且我的应用正在训练网络。

Any advice on how can I see my network improving in recognition - without testing examples manually by drawing them after the training is done? 关于如何使我的网络在识别方面有所改善的任何建议-无需在培训结束后通过绘制示例来手动测试示例? I want to see where my training is going while it's being trained. 我想看看我的训练在进行中。

I've test my trained weights on a drawn digits, output on all neurons is quite similar(approx. 0.077,or something like that ...on all neurons) ,and the largest value is on the wrong neuron. 我已经在绘制的数字上测试了训练有素的权重,所有神经元上的输出都非常相似(大约0.077,或者类似的...在所有神经元上),并且最大值出现在错误的神经元上。 So the result doesn't match the drawn image. 因此结果与绘制的图像不匹配。

This is the only test I'm doing so far: Cost Function changes with epochs 这是我到目前为止所做的唯一测试:成本函数随时间变化 在此处输入图片说明

So, this is what happens with Cost function (some call it objective function? ) in 50 epochs. 因此,在50个时间段内,使用Cost函数(有时称为目标函数?)会发生什么。 my Lambda value is set to 3.0 , learning rate is 0.01, 5000 examples, I do batch after each epoch ie after those 5000 examples. 我的Lambda值设置为3.0,学习率是0.01,5000个示例,我在每个时期之后(即在这5000个示例之后)进行批处理。 Activation function: sigmoid. 激活功能:乙状结肠。

input: 400 hidden: 25 output:10 输入:400隐藏:25输出:10

I don't know what proper values are for lambda and learning rate so that my network can learn without overfitting or underfitting. 我不知道lambda和学习率的正确值是多少,这样我的网络就可以学习而不会过度拟合或拟合不足。

Any suggestions how to find out my network is learning well? 有什么建议可以发现我的网络学习得很好吗?

Also, what value should J cost function have after all this training? 此外,J成本函数经过所有这些训练后应具有什么价值? Should it approach zero? 它应该接近零吗?

Should I have more epochs? 我应该有更多的时代吗?

Is it bad that my examples are all ordered by digits? 我的示例全部按数字排序是否很糟糕?

Any help is appreciated. 任何帮助表示赞赏。

Q : Any suggestions how to find out my network is learning well? :关于如何发现我的网络的任何建议都学习得很好?
A : Split the data into three groups training, cross validation and test.Validate your result with test data. :将数据分为训练,交叉验证和测试三组,并用测试数据验证结果。 This is actually address in the course later. 这实际上是稍后课程中的地址。

Q : Also, what value should J cost function have after all this training? :此外,J成本函数在所有这些训练后应具有什么价值? Should it approach zero? 它应该接近零吗?
A : I recall in the homework Ng mentioned what is the expected value. :我记得在作业中吴提到了什么是期望值。 The regularized cost should not be zero since it includes a sum of all the weights. 正规化成本不应为零,因为它包括所有权重的总和。

Q : Should I have more epochs? :我应该有更多的纪元吗?
A : If you run your program long enough ( less than 20 minutes? ) you will see the cost is not getting smaller, I assume it reached the local/global optimum so more epochs would not be necessary. :如果您将程序运行足够长的时间(少于20分钟?),您会发现成本并没有降低,我认为它已达到局部/全局最佳状态,因此不需要更多的时间。

Q : Is it bad that my examples are all ordered by digits? :我的示例全部按数字排序是否不好?
A : The algorithm modify the weights for every example so different order of data does affect each step in a batch. :该算法会修改每个示例的权重,因此不同顺序的数据确实会影响批处理中的每个步骤。 However the final result should not have much difference. 但是最终结果应该没有太大差异。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM