91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

資源簡介

這是一個用ANN(人工神經網絡)對手寫數字進行識別的程序。 有以下一些特性: 1)前端(網頁)用JavaScript,html 5,css開發; 2)后端(服務器)用python寫的(2.7版本); 3)功能:#支持在網頁畫布上(用鼠標)寫數字,并會返回預測結果; #支持重置網頁畫布; #支持向服務器發送訓練樣本; #支持圖片預覽,圖片上傳; #支持對上傳的圖片中英文字母的識別。 這是一個非常酷的程序,C/S架構,代碼也不是很復雜,而且設計了一些很有趣的知識(機器學習,神經網絡,http數據傳遞,前后端開發等等)。感興趣的同學可以下載下來看一看,有不懂的可以評論留言。

資源截圖

代碼片段和文件信息

“““
In?order?to?decide?how?many?hidden?nodes?the?hidden?layer?should?have
split?up?the?data?set?into?training?and?testing?data?and?create?networks
with?various?hidden?node?counts?(5?10?15?...?45)?testing?the?performance
for?each.

The?best-performing?node?count?is?used?in?the?actual?system.?If?multiple?counts
perform?similarly?choose?the?smallest?count?for?a?smaller?network?with?fewer?computations.
“““

import?numpy?as?np
from?ocr?import?OCRNeuralNetwork
from?sklearn.cross_validation?import?train_test_split

def?test(data_matrix?data_labels?test_indices?nn):
????avg_sum?=?0
????for?j?in?xrange(100):
????????correct_guess_count?=?0
????????for?i?in?test_indices:
????????????test?=?data_matrix[i]
????????????prediction?=?nn.predict(test)
????????????if?data_labels[i]?==?prediction:
????????????????correct_guess_count?+=?1

????????avg_sum?+=?(correct_guess_count?/?float(len(test_indices)))
????return?avg_sum?/?100


#?Load?data?samples?and?labels?into?matrix
data_matrix?=?np.loadtxt(open(‘data.csv‘?‘rb‘)?delimiter?=?‘‘).tolist()
data_labels?=?np.loadtxt(open(‘dataLabels.csv‘?‘rb‘)).tolist()

#?Create?training?and?testing?sets.
train_indices?test_indices?=?train_test_split(list(range(5000)))

print?“PERFORMANCE“
print?“-----------“

#?Try?various?number?of?hidden?nodes?and?see?what?performs?best
#?for?i?in?xrange(5?50?5):
i=100
nn?=?OCRNeuralNetwork(i?data_matrix?data_labels?train_indices?False)
performance?=?str(test(data_matrix?data_labels?test_indices?nn))
print?“{i}?Hidden?Nodes:?{val}“.format(i=i?val=performance)

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????26337792??2018-06-29?08:14??data.csv
?????文件???????10000??2018-06-29?08:07??dataLabels.csv
?????文件??????248949??2018-07-02?17:53??jquery.js
?????文件????????1564??2018-07-02?16:56??neural_network_design.py
?????文件??????179055??2018-07-04?20:37??nn.json
?????文件????????6062??2018-07-04?20:45??ocr.html
?????文件???????10706??2018-07-04?20:44??ocr.js
?????文件????????5270??2018-07-02?13:27??ocr.py
?????文件????????3719??2018-07-04?15:10??server.py

評論

共有 條評論