2387dce2c029356d26d5f394539852343cd726a9,language/nql/dataset.py,,k_hot_array_from_string_list,#Any#Any#Any#,164
Before Change
result = context.zeros_numpy_array(typename, as_matrix=False)
for e in entity_names:
if e :
try:
result += context.one_hot_numpy_array(e, typename, as_matrix=False)
except nql.EntityNameError:
pass
return result
def placeholder_for_type(context,
After Change
// None is not a valid id.
valid_ids = [x for x in ids if x is not None]
max_id = context.get_max_id(typename)
result = np.zeros((max_id,), dtype="float32")
if valid_ids:
result[valid_ids] = 1.
return result
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 4
Instances Project Name: google-research/language
Commit Name: 2387dce2c029356d26d5f394539852343cd726a9
Time: 2019-05-04
Author: no-reply@google.com
File Name: language/nql/dataset.py
Class Name:
Method Name: k_hot_array_from_string_list
Project Name: deepinsight/insightface
Commit Name: 8f61e58847f3d70094e6f8622dd335d03d0c8242
Time: 2019-10-15
Author: guojia@gmail.com
File Name: RetinaFace/retinaface.py
Class Name: RetinaFace
Method Name: bbox_vote
Project Name: deepinsight/insightface
Commit Name: 24af8c5e2730c0f2d4c6cc6357a6528f4b529431
Time: 2019-10-15
Author: guojia@gmail.com
File Name: RetinaFace/retinaface.py
Class Name: RetinaFace
Method Name: bbox_vote