Angelina Wang
commited on
Commit
•
f1799fd
1
Parent(s):
58c0103
wrong variable name
Browse files
directional_bias_amplification.py
CHANGED
@@ -71,7 +71,7 @@ class DirectionalBiasAmplification(evaluate.EvaluationModule):
|
|
71 |
num_t, num_a = task_labels.shape[1], attribute_labels.shape[1]
|
72 |
|
73 |
# only include images that have attribute(s) and task(s) associated with it
|
74 |
-
keep_indices = np.array(list(set(np.where(np.sum(
|
75 |
task_labels_ind, attribute_labels_ind = task_labels[keep_indices], attribute_labels[keep_indices]
|
76 |
|
77 |
# y_at calculation
|
|
|
71 |
num_t, num_a = task_labels.shape[1], attribute_labels.shape[1]
|
72 |
|
73 |
# only include images that have attribute(s) and task(s) associated with it
|
74 |
+
keep_indices = np.array(list(set(np.where(np.sum(task_labels, axis=1)>0)[0]).union(set(np.where(np.sum(attribute_labels, axis=1)>0)[0]))))
|
75 |
task_labels_ind, attribute_labels_ind = task_labels[keep_indices], attribute_labels[keep_indices]
|
76 |
|
77 |
# y_at calculation
|