Is that SM a model to predict the sequence??

116 views
Skip to first unread message

Alfred Yu

unread,
Nov 23, 2010, 10:26:35 PM11/23/10
to Sequence Memoizer
Hi,all
I have some doubts about the SM. I may misunderstand the model
of SM.After reading the paper about SM, I think SM should has the
capacity to predict the sequence. Say if we feed the SM with sequence
"abc,abc,abc,abc,",and if we want to predict the next word of "ab", I
think it should return 'c'. But as I run this on SM ,the output is
'a'. I am sure I have some mistakes here. Could anyone point out
what's wrong in above statement? Or is that there is something wrong
with my code. I appreciate your help. Thank you very much.
The code is here:
"
import edu.columbia.stat.wood.pub.sequencememoizer.*;
gettysburg_address = ['abc,abc,abc,abc,abc'];
int_gettysburg_address = uint8(gettysburg_address);
vocab_size = max(int_gettysburg_address)+1; %sequence memoizer is 0-
based, not 1-based
ismp = IntSequenceMemoizerParameters(vocab_size);
sm = IntSequenceMemoizer(ismp);
sm.continueSequence(int_gettysburg_address);
num_samples = 100;
sm.sample(num_samples);
forwardSample = sm.generateSequence(int_gettysburg_address(1:2),1);
%predict 'ab'
forwardSampleText = char(forwardSample);
disp(forwardSampleText');

"

Nicholas Bartlett

unread,
Dec 8, 2010, 8:29:42 AM12/8/10
to sequence...@googlegroups.com
Sorry for the late response everyone.  I looked into the problem Alfred mentioned and there was indeed another bug.  The context was not being considered in the method generateSequence, though it was being considered in the method generate.  The bug has been fixed and the website was re-deployed with a new jar and R-package which reflect version 1.1 of the code.  Please feel free to use this jar.  Sorry for the inconvenience and do not hesitate to contact us if you find any other problems with the code.

Nick Bartlett
--
BARTLETT Nick
Department of Statistics
Columbia University, New York
Reply all
Reply to author
Forward
0 new messages