28b8b9d39f53d8327dbf658048a81b7046ae398f,magpie/nn/models.py,,rnn,#,56
Before Change
Create and return a keras model of a RNN
HIDDEN_LAYER_SIZE = 256
model = Sequential()
model.add(GRU(
HIDDEN_LAYER_SIZE,
input_dim=embedding_size,
input_length=SAMPLE_LENGTH,
init="glorot_uniform",
inner_init="normal",
activation="relu",
))
model.add(BatchNormalization())
model.add(Dropout(0.1))
model.add(Dense(output_length, activation="sigmoid"))
model.compile(
loss="binary_crossentropy",
optimizer="adam",
After Change
inputs = Input(shape=(SAMPLE_LENGTH, embedding_size))
gru = GRU(
HIDDEN_LAYER_SIZE,
input_shape=(SAMPLE_LENGTH, embedding_size),
kernel_initializer="glorot_uniform",
recurrent_initializer="normal",
activation="relu",
)(inputs)
batch_normalization = BatchNormalization()(gru)
dropout = Dropout(0.1)(batch_normalization)
outputs = Dense(output_length, activation="sigmoid")(dropout)
model = Model(inputs=inputs, outputs=outputs)
model.compile(
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 11
Instances
Project Name: inspirehep/magpie
Commit Name: 28b8b9d39f53d8327dbf658048a81b7046ae398f
Time: 2017-10-08
Author: stypka@spotify.com
File Name: magpie/nn/models.py
Class Name:
Method Name: rnn
Project Name: eriklindernoren/Keras-GAN
Commit Name: ce7dc229bea184b9d606a1fe6a19a30c2c4a0d36
Time: 2018-05-11
Author: eriklindernoren@gmail.com
File Name: aae/adversarial_autoencoder.py
Class Name: AdversarialAutoencoder
Method Name: build_encoder
Project Name: inspirehep/magpie
Commit Name: 28b8b9d39f53d8327dbf658048a81b7046ae398f
Time: 2017-10-08
Author: stypka@spotify.com
File Name: magpie/nn/models.py
Class Name:
Method Name: cnn