Returns: N x #class scores, summed to one for each box.
975617
def output_scores(self, name=None):
        
        return tf.nn.softmax(self.label_logits, name=name)
824550
public static double score(MultiLayerNetwork model, DataSetIterator testData, boolean average) {
        //TODO: do this properly taking into account division by N, L1/L2 etc
        double sumScore = 0.0;
        int totalExamples = 0;
        while (testData.hasNext()) {
            DataSet ds = testData.next();
            int numExamples = ds.numExamples();

            sumScore += numExamples * model.score(ds);
            totalExamples += numExamples;
        }

        if (!average)
            return sumScore;
        return sumScore / totalExamples;
    }
1087654
def zrevrange_with_int_score(self, key, max_score, min_score):
        
        self._prune_penalty_box()

        if len(self.active_clients) == 0:
            raise ClusterEmptyError("All clients are down.")

        element__score = defaultdict(int)
        for client in self.active_clients:
            revrange = client.zrevrangebyscore(
                key, max_score, min_score, withscores=True, score_cast_func=int
            )

            for element, count in revrange:
                element__score[element] = max(element__score[element], int(count))

        return element__score
1205121
def point8_to_box(points):
    
    p = points.reshape((-1, 4, 2))
    minxy = p.min(axis=1)   # nx2
    maxxy = p.max(axis=1)   # nx2
    return np.concatenate((minxy, maxxy), axis=1)
150041
function aggregate (weights, values) {
  const max = 10 * R.sum(weights);
  const min = 1 * R.sum(weights);
  const sum = R.sum(R.zipWith(R.multiply, weights, values));
  return score(min, max, sum);
}
354729
def _compute_box(self, positive_vals, negative_vals):
        """"""
        max_ = max(
            max(positive_vals or [self.zero]),
            max(negative_vals or [self.zero])
        )

        if self.range and self.range[0] is not None:
            self._box.ymin = self.range[0]
        else:
            self._box.ymin = -max_

        if self.range and self.range[1] is not None:
            self._box.ymax = self.range[1]
        else:
            self._box.ymax = max_
305025
def ranker(self, X, meta):
        
        # total score is just a sum of each row
        total_score = X.sum(axis=1).transpose()
        total_score = np.squeeze(np.asarray(total_score))  # matrix to array
        ranks = total_score.argsort()
        ranks = ranks[::-1]
        # sort the list of dicts according to ranks
        sorted_meta = [meta[r] for r in ranks]
        sorted_X = X[ranks]
        return (sorted_X, sorted_meta)
184912
def results(self):
        

        results = {
            'overall': self.results_overall_metrics(),
            'class_wise': self.results_class_wise_metrics(),
            'class_wise_average': self.results_class_wise_average_metrics()
        }

        return results
848837
def zext(self, num):
        
        zero = self.ftype.box(0)
        return self.__class__(self._items + [zero] * num, ftype=self.ftype)
1178730
public double score(List<L> guesses, List<L> trueLabels, Index<L> dataLabelIndex) {
    setLabelIndex(dataLabelIndex);
    return score(guesses, trueLabels);
  }
117281
def compute_rewards(self, scores):
        """"""
        for i in range(len(scores)):
            if i >= self.k:
                scores[i] = 0.
        return scores
1346027
protected function calculateClassCov()
    {
        // s is an n (number of classes) by m (number of column) matrix
        $s = array_fill(0, count($this->overallMean), array_fill(0, count($this->overallMean), 0));
        $sB = new Matrix($s, false);

        foreach ($this->means as $index => $classMeans) {
            $row = $this->calculateVar($classMeans, $this->overallMean);
            $N = $this->counts[$index];
            $sB = $sB->add($row->multiplyByScalar($N));
        }

        return $sB;
    }
265009
def bic(self, X):
        
        return (-2 * self.score(X).sum() +
                self._n_parameters() * np.log(X.shape[0]))
88024
def decoded_output_boxes(self):
        
        anchors = tf.tile(tf.expand_dims(self.proposals.boxes, 1),
                          [1, cfg.DATA.NUM_CLASS, 1])   # N x #class x 4
        decoded_boxes = decode_bbox_target(
            self.box_logits / self.bbox_regression_weights,
            anchors
        )
        return decoded_boxes
1193869
def count(self, Class, set=None, recursive=True,  ignore=True, node=None):
        
        return sum(1 for i in self.select(Class,set,recursive,ignore,node) )
765607
def within_n_sds(n, series):
    """"""
    z_score = (series - series.mean()) / series.std()
    return (z_score.abs() <= n).all()
295081
def result_report_class_wise(self):
        

        results = self.results_class_wise_metrics()

        output = self.ui.section_header('Class-wise metrics', indent=2) + '\n'

        output += self.ui.row(
            'Scene label', 'Ncorr', 'Nref', 'Accuracy',
            widths=[20, 12, 12, 12],
            separators=[True, False, True, False],
            indent=4
        ) + '\n'

        output += self.ui.row('-', '-', '-', '-') + '\n'

        for scene_label in self.scene_label_list:
            output += self.ui.row(
                scene_label,
                results[scene_label]['count']['Ncorr'],
                results[scene_label]['count']['Nref'],
                results[scene_label]['accuracy']['accuracy'] * 100,
                types=['str', 'int', 'int', 'float1_percentage']
            ) + '\n'

        return output