% Paul Hollensen and Thomas Trappenberg (March 11)
%load data from text file and rearrange into pattern matrix ( [feature vector, letter] )
load pattern1.txt;
letters = reshape(pattern1',156,26);

%train rbm with 100 hidden units for 150 presentations of the 26 letters.
rbm = trainrbm(letters, 100, 150);

%plot reconstructions of noisy letters (20% of bits randomly flipped)
r = randomFlipMatrix(round(.2*156));
noisy_letters = abs(letters - r);
reconstructInput(rbm, noisy_letters, true);
