a0ae4ee2efb684a81a53a99c8e7f2689cc74e0c8,dynamicgem/embedding/dynRNN.py,DynRNN,learn_embeddings,#DynRNN#Any#,81
Before Change
// Process inputs
[x_hat, y] = self._autoencoder(x_in)
// Outputs
x_diff = merge([x_hat, x_pred],
mode=lambda a, b: a - b,
output_shape=lambda L: L[1])
// Objectives
def weighted_mse_x(y_true, y_pred):
""" Hack: This fn doesn"t accept additional arguments.
We use y_true to pass them.
y_pred: Contains x_hat - x_pred
y_true: Contains b
"""
return KBack.sum(
KBack.square(y_pred * y_true[:, 0:self._node_num]),
axis=-1
)
// Model
self._model = Model(input=[x_in, x_pred], output=x_diff)
sgd = SGD(lr=self._xeta, decay=1e-5, momentum=0.99, nesterov=True)
adam = Adam(lr=self._xeta, beta_1=0.9, beta_2=0.999, epsilon=1e-08)
self._model.compile(optimizer=adam, loss=weighted_mse_x)
After Change
// Process inputs
[x_hat, y] = self._autoencoder(x_in)
// Outputs
x_diff = Subtract()([x_hat, x_in])
// x_diff = merge([x_hat, x_pred],
// mode=lambda a, b: a - b,
// output_shape=lambda L: L[1])
// Objectives
def weighted_mse_x(y_true, y_pred):
""" Hack: This fn doesn"t accept additional arguments.
We use y_true to pass them.
y_pred: Contains x_hat - x_pred
y_true: Contains b
"""
return KBack.sum(
KBack.square(y_pred * y_true[:, 0:self._node_num]),
axis=-1
)
// Model
self._model = Model(input=[x_in, x_pred], output=x_diff)
sgd = SGD(lr=self._xeta, decay=1e-5, momentum=0.99, nesterov=True)
adam = Adam(lr=self._xeta, beta_1=0.9, beta_2=0.999, epsilon=1e-08)
self._model.compile(optimizer=adam, loss=weighted_mse_x)
In pattern: SUPERPATTERN
Frequency: 5
Non-data size: 4
Instances
Project Name: palash1992/DynamicGEM
Commit Name: a0ae4ee2efb684a81a53a99c8e7f2689cc74e0c8
Time: 2018-11-03
Author: sujitchhetri@gmail.com
File Name: dynamicgem/embedding/dynRNN.py
Class Name: DynRNN
Method Name: learn_embeddings
Project Name: palash1992/DynamicGEM
Commit Name: 83aecfabec9137569d41c48cd1e84b00e8bb7d72
Time: 2018-11-03
Author: sujitchhetri@gmail.com
File Name: dynamicgem/embedding/ae_static.py
Class Name: AE
Method Name: learn_embeddings
Project Name: palash1992/DynamicGEM
Commit Name: 65dc973b99b6042cea5dbf5516ff02ac94f859f0
Time: 2018-11-03
Author: sujitchhetri@gmail.com
File Name: dynamicgem/embedding/dynAE.py
Class Name: DynAE
Method Name: learn_embeddings
Project Name: palash1992/DynamicGEM
Commit Name: 0c9ffc6744c4ef474de2e49db75483568f24e49c
Time: 2018-11-03
Author: sujitchhetri@gmail.com
File Name: dynamicgem/embedding/dynAERNN.py
Class Name: DynAERNN
Method Name: learn_embeddings
Project Name: palash1992/DynamicGEM
Commit Name: 4c80ea23581866773511ded242baf681d51ca29a
Time: 2018-11-12
Author: sujitchhetri@gmail.com
File Name: dynamicgem/embedding/dynRNN.py
Class Name: DynRNN
Method Name: learn_embeddings