def update_tree_leaf(self, leaf, indices_in_leaf, X, y, y_pred, sample_weight, update_mask, residual):
        terminal_region = numpy.zeros(len(X), dtype=float)
        terminal_region[indices_in_leaf] += 1
        z = self.A.dot(terminal_region * self.y_signed)
        # optimal value here by several steps?
        alpha = numpy.sum(self.update_exponents * z) / (numpy.sum(self.update_exponents * z * z) + 1e-10)
        return alpha
dataset/ETHPy150Open anaderi/lhcb_trigger_ml/hep_ml/losses.py/AbstractMatrixLossFunction.update_tree_leaf/original