![[Graphics:Images/index_gr_1.gif]](Images/index_gr_1.gif)
![[Graphics:Images/index_gr_2.gif]](Images/index_gr_2.gif)
![[Graphics:Images/index_gr_3.gif]](Images/index_gr_3.gif)
the pics have already been converted to text files through an ASCII converter by this point - they're a mess of 1's and 0's
![[Graphics:Images/index_gr_4.gif]](Images/index_gr_4.gif)
![[Graphics:Images/index_gr_5.gif]](Images/index_gr_5.gif)
![[Graphics:Images/index_gr_7.gif]](Images/index_gr_7.gif)
![[Graphics:Images/index_gr_8.gif]](Images/index_gr_8.gif)
![[Graphics:Images/index_gr_10.gif]](Images/index_gr_10.gif)
![[Graphics:Images/index_gr_11.gif]](Images/index_gr_11.gif)
this section just converts 1's and 0's to 1's and -1's
![[Graphics:Images/index_gr_13.gif]](Images/index_gr_13.gif)
![[Graphics:Images/index_gr_14.gif]](Images/index_gr_14.gif)
![[Graphics:Images/index_gr_15.gif]](Images/index_gr_15.gif)
![[Graphics:Images/index_gr_16.gif]](Images/index_gr_16.gif)
here, to make the "database" matrix - the T-Matrix - from the three pictures that I want to choose from, I need to form the outer (cross) products of each of the vectors made by the lists of binary digits - each vector is 4356 entries long, so the matrix will end up being
![[Graphics:Images/index_gr_18.gif]](Images/index_gr_18.gif)
![[Graphics:Images/index_gr_19.gif]](Images/index_gr_19.gif)
![[Graphics:Images/index_gr_20.gif]](Images/index_gr_20.gif)
![[Graphics:Images/index_gr_21.gif]](Images/index_gr_21.gif)
so, what this is is essentially forming a matrix that includes all three of the pics that I want it to choose from:
![[Graphics:Images/index_gr_22.gif]](Images/index_gr_22.gif)
![[Graphics:Images/index_gr_23.gif]](Images/index_gr_23.gif)
![[Graphics:Images/index_gr_24.gif]](Images/index_gr_24.gif)
![[Graphics:Images/index_gr_25.gif]](Images/index_gr_25.gif)
![[Graphics:Images/index_gr_26.gif]](Images/index_gr_26.gif)
![[Graphics:Images/index_gr_27.gif]](Images/index_gr_27.gif)
now, to make all entries along the diagonal equal to zero (simplifies the process some, given the way in which I'll be doing the process)
![[Graphics:Images/index_gr_28.gif]](Images/index_gr_28.gif)
(that'd be 4356 rows, each one with 4356 entries)
![[Graphics:Images/index_gr_30.gif]](Images/index_gr_30.gif)
![[Graphics:Images/index_gr_32.gif]](Images/index_gr_32.gif)
![[Graphics:Images/index_gr_33.gif]](Images/index_gr_33.gif)
this loop probably begs some explanation - I'll go through step by step -
to begin, it plots the input listing of numbers as a density plot (here, a defaced picture of the Tick), along with the "energy" of it - not really
necessary for this purpose, but still a nice indicator.
then, it gives each entry the chance to switch over from 1 to -1, from -1 to 1, or to remain unchanged - this is a synchronous, or simultaneous
form of neural network evolution.
it does this step a given number of times - niterations - though it really only needs one shot, I like to have the option to let it go
through a few more times, though it's really only important in asynchronous evolution.
after the input pattern has evolved, it again calculates the energy, along with the hamming distances
(the sheer number of entries that are different) between the evolved pattern and each of the database patterns.
it then plots the evolved pattern, along with the hamming distances, and sets a new variable equal to the evolved pattern,
to make it easier to check later for matches officially.
![[Graphics:Images/index_gr_34.gif]](Images/index_gr_34.gif)
![[Graphics:Images/index_gr_35.gif]](Images/index_gr_35.gif)
so, this is my input testing pattern
![[Graphics:Images/index_gr_36.gif]](Images/index_gr_36.gif)
and this is the output pattern - identical to the Tick
![[Graphics:Images/index_gr_37.gif]](Images/index_gr_37.gif)
![[Graphics:Images/index_gr_39.gif]](Images/index_gr_39.gif)
![[Graphics:Images/index_gr_41.gif]](Images/index_gr_41.gif)
![[Graphics:Images/index_gr_43.gif]](Images/index_gr_43.gif)
![[Graphics:Images/index_gr_45.gif]](Images/index_gr_45.gif)
![[Graphics:Images/index_gr_47.gif]](Images/index_gr_47.gif)