Hopfield网络联想记忆外积法设计权的研究
- 格式:pdf
- 大小:90.03 KB
- 文档页数:2
% ------------------------standard number array-----------------------zero=[-1 -1 -1 -1 -1 -1 -1 -1 -1 -1; -1 -1 -1 1 1 1 1 -1 -1 -1;...-1 -1 1 1 1 1 1 1 -1 -1; -1 1 1 1 -1 -1 1 1 1 -1;...-1 1 1 1 -1 -1 1 1 1 -1;-1 1 1 1 -1 -1 1 1 1 -1;...-1 1 1 1 -1 -1 1 1 1 -1;-1 1 1 1 -1 -1 1 1 1 -1 ;...-1 1 1 1 -1 -1 1 1 1 -1;-1 -1 1 1 1 1 1 1 -1 -1];one=[-1 -1 -1 -1 1 1 -1 -1 -1 -1;-1 -1 -1 -1 1 1 -1 -1 -1 -1;...-1 -1 -1 -1 1 1 -1 -1 -1 -1; -1 -1 -1 -1 1 1 -1 -1 -1 -1;...-1 -1 -1 -1 1 1 -1 -1 -1 -1; -1 -1 -1 -1 1 1 -1 -1 -1 -1;...-1 -1 -1 -1 1 1 -1 -1 -1 -1; -1 -1 -1 -1 1 1 -1 -1 -1 -1;...-1 -1 -1 -1 1 1 -1 -1 -1 -1; -1 -1 -1 -1 1 1 -1 -1 -1 -1];two=[-1 1 1 1 1 1 1 1 1 -1;-1 1 1 1 1 1 1 1 1 -1;...-1 -1 -1 -1 -1 -1 -1 1 1 -1;-1 -1 -1 -1 -1 -1 -1 1 1 -1;...-1 1 1 1 1 1 1 1 1 -1;-1 1 1 1 1 1 1 1 1 -1;...-1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 -1 -1 -1 -1 -1 -1 -1;...-1 1 1 1 1 1 1 1 1 -1;-1 1 1 1 1 1 1 1 1 -1;...-1 -1 -1 -1 -1 -1 -1 -1 -1 -1;-1 -1 -1 -1 -1 -1 -1 -1 -1 -1];three=[-1 -1 1 1 1 1 1 1 -1 -1;-1 -1 1 1 1 1 1 1 1 -1;...-1 -1 -1 -1 -1 -1 -1 1 1 -1;-1 -1 -1 -1 -1 -1 -1 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1;...-1 1 1 1 1 1 -1 -1 -1 -1; -1 -1 -1 -1 -1 -1 -1 -1 -1 -1;...-1 -1 -1 -1 -1 -1 -1 -1 -1 -1; -1 -1 -1 -1 -1 -1 -1 -1 -1 -1;...-1 -1 -1 -1 -1 -1 -1 -1 -1 -1; -1 -1 -1 -1 -1 -1 -1 -1 -1 -1];nine=[ -1 -1 -1 1 1 1 1 1 1 -1; -1 -1 -1 1 1 1 1 1 1 -1;...-1 -1 -1 1 1 -1 -1 1 1 -1; -1 -1 -1 1 1 -1 -1 1 1 -1;...-1 -1 -1 1 1 -1 -1 1 1 -1; -1 -1 -1 1 1 1 1 1 1 -1;...-1 -1 -1 1 1 1 1 1 1 -1; -1 -1 -1 -1 -1 -1 -1 1 1 -1;...-1 -1 -1 -1 -1 -1 -1 1 1 -1; -1 -1 -1 -1 -1 -1 -1 1 1 -1;...-1 -1 -1 1 1 1 1 1 1 -1; -1 -1 -1 1 1 1 1 1 1 -1];% ----------------------plot standard number figure-----------------ZERO=imresize(zero,20);subplot(3,3,1)imshow(ZERO)title('stand number')ONE=imresize(one,20);subplot(3,3,2)imshow(ONE)title('stand number')TWO=imresize(two,20);subplot(3,3,3)imshow(TWO)title('stand number')THREE=imresize(three,20);subplot(3,3,4)imshow(THREE)title('stand number')FOUR=imresize(four,20);subplot(3,3,5)imshow(FOUR)title('stand number')SIX=imresize(six,20);subplot(3,3,6)imshow(SIX)title('stand number')POINT=imresize(point,20);subplot(3,3,7)imshow(POINT)title('stand number')NINE=imresize(nine,20);subplot(3,3,8)imshow(NINE)title('stand number')% ----------------------create hopfield net--------------------------T=[zero;one;two;three;four;six;point;nine]';net=newhop(T);5%干扰的程序:% ------------------------standard number array-----------------------six=[-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;...-1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 -1 -1 -1 -1 -1 -1 -1 ;...-1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;...-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...-1 1 1 -1 -1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1];% ----------------------plot standard number figure-----------------SIX=imresize(six,20);subplot(2,1,1)imshow(SIX)title('stand number')% ----------------------create hopfield net--------------------------T=[six]';net=newhop(T);% ------------------------------generate noise----------------------------% -------------------------noise array(fixed noise)--------------% six=[-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;...% -1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 -1 -1 -1 -1 -1 -1 -1 ;...% -1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;... % -1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;... % -1 1 1 -1 -1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...% -1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1];% -----------------------noise array(rand noise)-----------------rand('state',0);for i=1:100a=rand;if a<0.05six(i)=-six(i);endendno1=six;% -------------------------plot noisy figure---------------subplot(2,1,2)NO1=imresize(no1,20);imshow(NO1)title('noisy number')10%干扰的程序:% ------------------------standard number array-----------------------six=[-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;...-1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 -1 -1 -1 -1 -1 -1 -1 ;...-1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;...-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...-1 1 1 -1 -1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1]; % ----------------------plot standard number figure-----------------SIX=imresize(six,20);subplot(2,1,1)imshow(SIX)title('stand number')% ----------------------create hopfield net--------------------------T=[six]';net=newhop(T);% ------------------------------generate noise----------------------------% -------------------------noise array(fixed noise)--------------% six=[-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;... % -1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 -1 -1 -1 -1 -1 -1 -1 ;...% -1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;...% -1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...% -1 1 1 -1 -1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...% -1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1];% -----------------------noise array(rand noise)-----------------rand('state',0);for i=1:100a=rand;if a<0.1six(i)=-six(i);endendno1=six;% -------------------------plot noisy figure---------------subplot(2,1,2)NO1=imresize(no1,20);imshow(NO1)title('noisy number')20%干扰的程序:% ------------------------standard number array-----------------------six=[-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;...-1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 -1 -1 -1 -1 -1 -1 -1 ;...-1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;...-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...-1 1 1 -1 -1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1];% ----------------------plot standard number figure-----------------SIX=imresize(six,20);subplot(2,1,1)imshow(SIX)title('stand number')% ----------------------create hopfield net--------------------------T=[six]';net=newhop(T);% ------------------------------generate noise----------------------------% -------------------------noise array(fixed noise)--------------% six=[-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;... % -1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 -1 -1 -1 -1 -1 -1 -1 ;...% -1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;...% -1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...% -1 1 1 -1 -1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...% -1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1];% -----------------------noise array(rand noise)-----------------rand('state',0);for i=1:100a=rand;if a<0.2six(i)=-six(i);endendno1=six;% -------------------------plot noisy figure---------------subplot(2,1,2)NO1=imresize(no1,20);imshow(NO1)title('noisy number')30%干扰的程序:% ------------------------standard number array-----------------------six=[-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;...-1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 -1 -1 -1 -1 -1 -1 -1 ;...-1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;...-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...-1 1 1 -1 -1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1];% ----------------------plot standard number figure-----------------SIX=imresize(six,20);subplot(2,1,1)imshow(SIX)title('stand number')% ----------------------create hopfield net--------------------------T=[six]';net=newhop(T);% ------------------------------generate noise----------------------------% -------------------------noise array(fixed noise)--------------% six=[-1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;...% -1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 -1 -1 -1 -1 -1 -1 -1 ;...% -1 1 1 -1 -1 -1 -1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1 ;... % -1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...% -1 1 1 -1 -1 1 1 -1 -1 -1;-1 1 1 -1 -1 1 1 -1 -1 -1;...% -1 1 1 1 1 1 1 -1 -1 -1;-1 1 1 1 1 1 1 -1 -1 -1];% -----------------------noise array(rand noise)-----------------rand('state',0);for i=1:100a=rand;if a<0.3six(i)=-six(i);endendno1=six;% -------------------------plot noisy figure---------------subplot(2,1,2)NO1=imresize(no1,20);imshow(NO1)title('noisy number')。
第5章Hopfield神经网络与联想记忆前面介绍了前向网络及其学习算法,对于所介绍的前向网络,从学习的观点来看,它是一个强有力的学习系统,系统结构简单、易于编程;从系统的观点来看,它是一个静态非线性映射,通过简单非线性处理单元的复合映射可获得复杂系统的非线性处理能力;从计算的观点来看,它并不是一强有力系统,缺乏丰富的动力学行为。
反馈神经网络是一个反馈动力学系统,具有更强的计算能力。
1982年美国物理学家J. Hopfield提出的单层全互连含有对称突触连接的反馈网络是最典型的反馈网络模型。
Hopfield 用能量函数的思想形成了一种新的计算方法,阐明了神经网络与动力学的关系,并用非线性动力学的方法来研究这种神经网络的特性,建立了神经网络稳定性判据,并指出信息存储在网络中神经元之间的连接上,形成了所谓的Hopfield网络,称之为离散Hopfield网络。
而且Hopfield还将该反馈网络同统计物理中的Ising模型相类比,把磁旋的向上和向下方向看成神经元的激活和抑制两种状态,把磁旋的的相互作用看成神经元的突触权值。
这种类推为大量的物理学理论和许多的物理学家进入神经网络领域铺平了道路。
1984年,Hopfield设计与研制了Hopfield网络模型的电路,指出神经元可以用运算放大器来实现,所有神经元的连接可用电子线路来模拟,称之为连续Hopfield网络。
用该电路Hopfield成功的解决了旅行商(TSP)计算难题(优化问题)。
Hopfield网络是神经网络发展历史上的一个重要的里程碑。
把神经网络看作一种非线性的动力学系统,并特别注意其稳定性研究的学科,被称为神经动力学(Neurodynamics)。
Hopfield神经网络可看作一种非线性的动力学系统,所以为了方便介绍Hopfield神经网络,本章首先简单介绍神经动力学。
前面介绍的单层前向网络和多层前向网络,其思路均是先介绍网络模型再介绍相应的学习算法。
基于MapReduce模型的Hopfield神经网络联想记忆算法曾俊【摘要】Hopfield network is a widely used neural network for its excellent performance in associative memory and fault tolerantproperty.However,on cloud computing platform,it is not able to store high-dimensional mode in a single computer and to acquire good performance when come across massive data.Besides,the data storage in traditional associative memory networks is distributed,this enables the MapReduce structure can well solve the parallelisation and distribution problems.According to the principle above,we put forward an algorithm of MRHAM (MapReduce-based Hopfield Network for Associative Memory) which uses MapReduce architecture to implement largescale parallelised processing on traditional Hopfield associative memory algorithm.It is verified through experiment that the performance of MRHAM algorithm acquired in massive amount of data is better than that of the traditional Hopfield associative memory algorithm; this has important significance to massive data for content-based storage and associativememory.%Hopfield神经网络以良好的联想记忆功能、容错性而得到广泛的应用.然而,云计算平台下,面对海量数据时它并不能在单机上存储高维度模式以及获得良好的性能.另外,传统的联想记忆网络数据分布存储,使得MapReduce结构可以很好地解决并行化和分布性的问题.根据以上原理,提出一种MRHAM(MapReduce-based Hopfield Network for Association Memory)算法,对传统的Hopfield联想记忆算法采用MapReduce架构实现大规模并行化处理.通过实验验证在大规模数据量下获得比传统Hopfield联想记忆算法更好的性能,对于海量数据的基于内容存储、联想记忆有重要意义.【期刊名称】《计算机应用与软件》【年(卷),期】2013(030)008【总页数】4页(P267-270)【关键词】MapReduce;Hopfield;联想记忆;云平台;大规模数据【作者】曾俊【作者单位】长江师范学院数学与计算机学院重庆408100【正文语种】中文【中图分类】TP183Hopfield神经网络是一种应用十分广泛的单层反馈神经网络,它具有良好的优化能力和联想记忆能力,广泛用于优化计算和联想记忆。