b5a02391e003c33c8f8258a7e3d0736503c3c048,examples/babi_memnn.py,,,#,97

Before Change


// we choose to use a RNN instead.
answer.add(LSTM(32))
// one regularization layer -- more would probably be needed.
answer.add(Dropout(0.3))
answer.add(Dense(vocab_size))
// we output a probability distribution over the vocabulary
answer.add(Activation("softmax"))

After Change



// the original paper uses a matrix multiplication for this reduction step.
// we choose to use a RNN instead.
answer = LSTM(32)(answer)  // (samples, 32)

// one regularization layer -- more would probably be needed.
answer = Dropout(0.3)(answer)
answer = Dense(vocab_size)(answer)  // (samples, vocab_size)
// we output a probability distribution over the vocabulary
answer = Activation("softmax")(answer)

// build the final model
model = Model([input_sequence, question], answer)
model.compile(optimizer="rmsprop", loss="categorical_crossentropy",
               metrics=["accuracy"])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: keras-team/keras
Commit Name: b5a02391e003c33c8f8258a7e3d0736503c3c048
Time: 2017-03-15
Author: farizrahman4u@gmail.com
File Name: examples/babi_memnn.py
Class Name:
Method Name:


Project Name: stellargraph/stellargraph
Commit Name: 97eacce6d9222a1c8579062d5dbb9d753655ee62
Time: 2020-06-01
Author: Huon.Wilson@data61.csiro.au
File Name: stellargraph/layer/gcn_lstm.py
Class Name: GraphConvolutionLSTM
Method Name: __init__


Project Name: dmlc/dgl
Commit Name: 69f5869f3b6d190ed99e156a932634393ab361dd
Time: 2020-08-12
Author: xiaotj1990327@gmail.com
File Name: python/dgl/nn/pytorch/conv/gatconv.py
Class Name: GATConv
Method Name: __init__