    params = json.loads(self.param_str)
        else:
            params = {}
        self.top_k = params.get('top_k', 1)

    def reshape(self, bottom, top):
        top[0].reshape(1)

    def forward(self, bottom, top):
        # Renaming for clarity
        predictions = bottom[0].data
        ground_truth = bottom[1].data

        num_correct = 0.0

        # NumPy magic - get top K predictions for each datum
        top_predictions = (-predictions).argsort()[:, :self.top_k]
        for batch_index, pre