Skip to content

Commit

Permalink
changes for activation
Browse files Browse the repository at this point in the history
  • Loading branch information
MysteryVaibhav committed Jan 23, 2019
1 parent b4d40d4 commit 166b256
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions 05-cnn-pytorch/cnn-activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,11 @@ def read_dataset(filename):
words = words.split(" ")
yield (words, [w2i[x] for x in words], int(tag))


# Read in the data
train = list(read_dataset("../data/classes/train.txt"))[:50]
train = list(read_dataset("../data/classes/train.txt"))
w2i = defaultdict(lambda: UNK, w2i)
dev = list(read_dataset("../data/classes/test.txt"))[:10]
dev = list(read_dataset("../data/classes/test.txt"))
nwords = len(w2i)
ntags = 5

Expand Down Expand Up @@ -105,6 +106,7 @@ def display_activations(words, activations):

return ngrams


for ITER in range(10):
# Perform training
random.shuffle(train)
Expand Down

0 comments on commit 166b256

Please sign in to comment.