adabf33fa59acb036ddda9a57a4fdf023c1dbaca,deepctr/layers.py,AFMLayer,call,#AFMLayer#Any#,114
Before Change
embeds_vec_list = inputs
row = []
col = []
num_inputs = len(embeds_vec_list)
for i in range(num_inputs - 1):
for j in range(i + 1, num_inputs):
row.append(i)
col.append(j)
p = tf.concat([embeds_vec_list[idx] for idx in row],axis=1)
q = tf.concat([embeds_vec_list[idx] for idx in col],axis=1)
inner_product = p * q
bi_interaction = inner_product
After Change
if K.ndim(inputs[0]) != 3:
raise ValueError("Unexpected inputs dimensions %d, expect to be 3 dimensions" % (K.ndim(inputs)))
embeds_vec_list = inputs
row = []
col = []
// num_inputs = len(embeds_vec_list)
// for i in range(num_inputs - 1):
// for j in range(i + 1, num_inputs):
// row.append(i)
// col.append(j)
for r, c in itertools.combinations(embeds_vec_list, 2):
row.append(r)
col.append(c)
//p = tf.concat([embeds_vec_list[idx] for idx in row],axis=1)
//q = tf.concat([embeds_vec_list[idx] for idx in col], axis=1)
p = tf.concat(row,axis=1)
q = tf.concat(col,axis=1)
inner_product = p * q
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 9
Instances
Project Name: shenweichen/DeepCTR
Commit Name: adabf33fa59acb036ddda9a57a4fdf023c1dbaca
Time: 2018-12-19
Author: wcshen1994@163.com
File Name: deepctr/layers.py
Class Name: AFMLayer
Method Name: call
Project Name: pgmpy/pgmpy
Commit Name: d86fe5fa05b434e32ac7a9e8d59fe7acb2841d98
Time: 2014-07-31
Author: ankurankan@gmail.com
File Name: pgmpy/MarkovModel/MarkovModel.py
Class Name: MarkovModel
Method Name: _in_clique
Project Name: shenweichen/DeepCTR
Commit Name: adabf33fa59acb036ddda9a57a4fdf023c1dbaca
Time: 2018-12-19
Author: wcshen1994@163.com
File Name: deepctr/layers.py
Class Name: AFMLayer
Method Name: call
Project Name: pgmpy/pgmpy
Commit Name: eea41a4578b5021bbc16eb171bceb453cbde2419
Time: 2014-11-30
Author: abinash.panda.ece10@itbhu.ac.in
File Name: pgmpy/base/UndirectedGraph.py
Class Name: UndirectedGraph
Method Name: check_clique