Skip to content

Commit

Permalink
update settings
Browse files Browse the repository at this point in the history
  • Loading branch information
breznak committed Nov 16, 2013
1 parent 40f5c91 commit f45868b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions client/linguist.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
import model_params
import re

NUM_REPEATS = 1
NUM_REPEATS = 5
PRINT_EVERY_REPEAT_N = 1
TERMINATORS = ['.','!','?','|']

Expand Down Expand Up @@ -84,8 +84,8 @@ def runLinguist(datapath):

modelInput = {'letter': c}
result = model.run(modelInput)
#if should_print:
#print "[%i]\t %s ==> %s\t(%s)" % (i, clean(modelInput['letter']), prediction(result.inferences), confidences(result.inferences))
if should_print:
print "[%i]\t %s ==> %s\t(%s)" % (i, clean(modelInput['letter']), prediction(result.inferences), confidences(result.inferences))
if c in TERMINATORS:
model.resetSequenceStates()
print "reset"
Expand All @@ -95,6 +95,10 @@ def runLinguist(datapath):
return model

def tellStory(model, startSent, lenght):
"""feed startSent sequence and then continue to generate the story by the CLA.
param model: the trained CLA model
param startSent: starting sequence as a string, eg \"And so he raised the gun\"
param lenght: #sequences to generate. """

model.disableLearning()
for s in startSent:
Expand Down
2 changes: 1 addition & 1 deletion client/model_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@
# This is set after the call to updateConfigFromSubConfig and is
# computed from the aggregationInfo and predictAheadTime.
#'steps': '1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16',
'steps': '1',
'steps': '1,2,3,4,5',
},

'trainSPNetOnlyIfRequested': True,
Expand Down

0 comments on commit f45868b

Please sign in to comment.