459d7fe3d7aeb065c42249e955a4053270e81814,examples/babi_rnn.py,,,#,140

Before Change


train = get_stories(tar.extractfile(challenge.format("train")))
test = get_stories(tar.extractfile(challenge.format("test")))

vocab = sorted(reduce(lambda x, y: x | y, (set(story + q + [answer]) for story, q, answer in train + test)))
// Reserve 0 for masking via pad_sequences
vocab_size = len(vocab) + 1
word_idx = dict((c, i + 1) for i, c in enumerate(vocab))

After Change


train = get_stories(tar.extractfile(challenge.format("train")))
test = get_stories(tar.extractfile(challenge.format("test")))

vocab = set()
for story, q, answer in train + test:
    vocab |= set(story + q + [answer])
vocab = sorted(vocab)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: keras-team/keras
Commit Name: 459d7fe3d7aeb065c42249e955a4053270e81814
Time: 2017-03-15
Author: francois.chollet@gmail.com
File Name: examples/babi_rnn.py
Class Name:
Method Name:


Project Name: keras-team/keras
Commit Name: 555ca942df407b8c1bf1d48383c60fa1bf09cc1d
Time: 2019-08-28
Author: francois.chollet@gmail.com
File Name: keras/engine/network.py
Class Name: Network
Method Name: losses


Project Name: keras-team/keras
Commit Name: 459d7fe3d7aeb065c42249e955a4053270e81814
Time: 2017-03-15
Author: francois.chollet@gmail.com
File Name: examples/babi_memnn.py
Class Name:
Method Name: