DL之HNN:基于HNN(subplot)将凌乱数字矩阵图像(模拟手写数字图片)实现转为最相近的阿拉伯数字
生活随笔
收集整理的這篇文章主要介紹了
DL之HNN:基于HNN(subplot)将凌乱数字矩阵图像(模拟手写数字图片)实现转为最相近的阿拉伯数字
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
DL:基于HNN將凌亂數字矩陣圖像(模擬手寫數字圖片)實現轉為最相近的阿拉伯數字
?
?
目錄
輸出結果
代碼設計
?
?
?
?
輸出結果
?
代碼設計
#DL:基于HNN將凌亂數字矩陣圖像(模擬手寫數字圖片)實現轉為最相近的阿拉伯數字 import numpy as np import neurolab as nl import matplotlib.pyplot as plt# 012數字形矩陣————————16*8改為6*5 target=np.array([[0, 1, 1, 1, 0,1, 0, 0, 0, 1,1, 0, 0, 0, 1,1, 0, 0, 0, 1,1, 0, 0, 0, 1,0, 1, 1, 1, 0],[0, 1, 1, 0, 0,0, 0, 1, 0, 0,0, 0, 1, 0, 0,0, 0, 1, 0, 0,0, 0, 1, 0, 0,0, 0, 1, 0, 0],[1, 1, 1, 0, 0,0, 0, 0, 1, 0,0, 0, 0, 1, 0,0, 1, 1, 0, 0,1, 0, 0, 0, 0,1, 1, 1, 1, 1]]) test_data0=np.asfarray([0, 0, 1, 1, 0,1, 0, 1, 0, 0,1, 0, 0, 0, 1,1, 0, 1, 0, 0,1, 0, 0, 0, 1,0, 1, 0, 1, 1]) test_data1=np.asfarray([0, 1, 1, 0, 0,0, 0, 0, 0, 0,0, 1, 1, 0, 0,0, 0, 0, 0, 1,1, 0, 1, 0, 0,0, 0, 1, 0, 0]) test_data2=np.asfarray([1, 0, 1, 0, 0,0, 0, 0, 1, 0,1, 0, 0, 1, 0,0, 1, 1, 0, 1,1, 0, 0, 0, 1,1, 0, 0, 1, 0]) …… ax6.imshow(out0,cmap=plt.cm.gray, interpolation='nearest') ax6.set_title("after HNN") #DL: Based on HNN, turn to the closest Arabia number 0 ax7.imshow(out1,cmap=plt.cm.gray, interpolation='nearest') ax7.set_title("after HNN") ax8.imshow(out2,cmap=plt.cm.gray, interpolation='nearest') ax8.set_title("after HNN") fig.tight_layout() #軸域的位置自動調整 plt.suptitle("DL: Based on HNN, turn to the closest Arabia number By Jason Niu") #設置總圖標題 plt.show()?
相關文章推薦
GitHub
總結
以上是生活随笔為你收集整理的DL之HNN:基于HNN(subplot)将凌乱数字矩阵图像(模拟手写数字图片)实现转为最相近的阿拉伯数字的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: Py之neurolab:Python库之
- 下一篇: DL之BM:BM的前世今生