您当前的位置: 首页 >  矩阵
  • 0浏览

    0关注

    2393博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

DL之HNN:基于HNN(subplot)将凌乱数字矩阵图像(模拟手写数字图片)实现转为最相近的阿拉伯数字

一个处女座的程序猿 发布时间:2018-06-24 11:21:25 ,浏览量:0

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

关注
打赏
1664196048
查看更多评论
立即登录/注册

微信扫码登录

0.0436s