Skip to content

Commit

Permalink
Add another print example
Browse files Browse the repository at this point in the history
  • Loading branch information
koki0702 committed Jun 4, 2018
1 parent a62b8e0 commit 17faf16
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ch07/peeky_seq2seq.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
sys.path.append('..')
from common.time_layers import *
from ch07.seq2seq import Seq2seq, Encoder
from seq2seq import Seq2seq, Encoder


class PeekyDecoder:
Expand Down
2 changes: 1 addition & 1 deletion ch07/rnnlm_gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def generate(self, start_id, skip_ids=None, sample_size=100):
return word_ids

def get_state(self):
return (self.lstm_layer.h, self.lstm_layer.c)
return self.lstm_layer.h, self.lstm_layer.c

def set_state(self, state):
self.lstm_layer.set_state(*state)
Expand Down
5 changes: 5 additions & 0 deletions ch07/show_addition_dataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@
print(t_train[0])
# [ 3 0 2 0 0 11 5]
# [ 6 0 11 7 5]

print("".join([id_to_char[c] for c in x_train[0]]))
print("".join([id_to_char[c] for c in t_train[0]]))
# 71+118
# _189

0 comments on commit 17faf16

Please sign in to comment.