def aggregation_most_frequent(logits):
 labels = labels_from_probs(logits)
 labels_shape = np.shape(labels)
 labels = labels.reshape((labels_shape[0], labels_shape[1]))
 result = np.zeros(int(labels_shape[1]))
 for i in xrange(int(labels_shape[1])):
  label_counts = np.bincount(labels[:, i], minlength=10)
  label_counts = np.asarray(label_counts, dtype=np.int32)
  result[i] = np.argmax(label_counts)
 return np.asarray(result, dtype=np.int32)

def aggregation_most_frequent ( logits ) : labels = labels_from_probs ( logits ) labels_shape = np . shape ( labels ) labels = labels . reshape ( ( labels_shape [ 0 ] , labels_shape [ 1 ] ) ) result = np . zeros ( int ( labels_shape [ 1 ] ) ) for i in xrange ( int ( labels_shape [ 1 ] ) ) : label_counts = np . bincount ( labels [ : , i ] , minlength = 10 ) label_counts = np . asarray ( label_counts , dtype = np . int32 ) result [ i ] = np . argmax ( label_counts ) return np . asarray ( result , dtype = np . int32 )
this aggregation mechanism takes the softmax/logit output of several models resulting from inference on identical inputs and computes the most frequent label .