We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a804fce commit 6b42073Copy full SHA for 6b42073
class_21/TextGen.py
@@ -110,8 +110,8 @@ def sample(preds, temperature=1.0):
110
exp_preds = np.exp(preds)
111
preds = exp_preds / np.sum(exp_preds)
112
probas = np.random.multinomial(1, preds, 1)
113
- return probas
114
- # return np.argmax(probas)
+ # return probas
+ return np.argmax(probas)
115
116
117
# In[107]:
@@ -137,7 +137,8 @@ def sample(preds, temperature=1.0):
137
batch_size=128,
138
epochs=1)
139
140
- start_index = random.randint(0, len(text) - maxlen - 1)
+ # start_index = random.randint(0, len(text) - maxlen - 1)
141
+ start_index = len(text) - maxlen - 1
142
143
for diversity in [0.2, 0.5, 1.0, 1.2]:
144
print()
0 commit comments