def kmeans_expectation(self, bboxes, assignments, centers):
        """Expectation part of EM algorithm(Expectation-Maximization)"""
        ious = bbox_overlaps(bboxes, centers)
        closest = ious.argmax(1)
        converged = (closest == assignments).all()
        return converged, closest
Expectation part of EM algorithm(Expectation-Maximization)
detection/tools/analysis_tools/optimize_anchors.py