982db1e3e4097b2fa2727bddf05307633dd6df83,tf_agents/bandits/agents/utils.py,,build_laplacian_over_ordinal_integer_actions,#Any#,81
Before Change
num_actions = get_num_actions_from_tensor_spec(action_spec)
adjacency_matrix = tf.zeros([num_actions, num_actions], dtype=tf.float32)
row_indices = tf.reshape(tf.range(num_actions - 1), [-1, 1])
full_indices = tf.concat([row_indices, row_indices + 1], axis=1)
adjacency_matrix = tf.tensor_scatter_nd_update(
tensor=adjacency_matrix,
indices=full_indices,
updates=tf.ones([num_actions - 1], dtype=tf.float32))
adjacency_matrix = adjacency_matrix + tf.transpose(adjacency_matrix)
degree_matrix = tf.linalg.tensor_diag(tf.reduce_sum(adjacency_matrix, axis=1))
laplacian_matrix = degree_matrix - adjacency_matrix
return laplacian_matrix
After Change
adjacency_matrix = np.zeros([num_actions, num_actions])
for i in range(num_actions - 1):
adjacency_matrix[i, i + 1] = 1.0
adjacency_matrix[i + 1, i] = 1.0
laplacian_matrix = np.diag(np.sum(adjacency_matrix,
axis=0)) - adjacency_matrix
return laplacian_matrix
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 6
Instances
Project Name: tensorflow/agents
Commit Name: 982db1e3e4097b2fa2727bddf05307633dd6df83
Time: 2020-03-12
Author: no-reply@google.com
File Name: tf_agents/bandits/agents/utils.py
Class Name:
Method Name: build_laplacian_over_ordinal_integer_actions
Project Name: salu133445/musegan
Commit Name: ede220455551e37c2a288c284abb6511bc75bf0b
Time: 2018-02-02
Author: archer837@yahoo.com.tw
File Name: musegan/components.py
Class Name: Nowbar
Method Name: _build_generator
Project Name: adalca/neuron
Commit Name: d536c9b8d5ad004a4dde372e980e28001c478916
Time: 2018-08-28
Author: adalca@mit.edu
File Name: neuron/layers.py
Class Name: SpatialTransformer
Method Name: _single_aff_to_shift
Project Name: dmlc/gluon-cv
Commit Name: ee602b6f68f0bdd19f449a86955697f8f0a2d54c
Time: 2019-09-21
Author: yizhu59@gmail.com
File Name: gluoncv/data/transforms/video.py
Class Name: VideoTenCrop
Method Name: forward