':param cg_iters: The number of CG iterations used to calculate A^-1 g
:param reg_coeff: A small value so that A -> A + reg*I
:param subsample_factor: Subsampling factor to reduce samples when using "conjugate gradient. Since the
computation time for the descent direction dominates, this can greatly reduce the overall computation time.
:param accept_violation: whether to accept the descent step if it violates the line search condition after
exhausting all backtracking budgets
:return:'

def __init__(self, cg_iters=10, reg_coeff=1e-05, subsample_factor=1.0, backtrack_ratio=0.8, max_backtracks=15, accept_violation=False, hvp_approach=None, num_slices=1):

    Serializable.quick_init(self, locals())
    self._cg_iters = cg_iters
    self._reg_coeff = reg_coeff
    self._subsample_factor = subsample_factor
    self._backtrack_ratio = backtrack_ratio
    self._max_backtracks = max_backtracks
    self._num_slices = num_slices
    self._opt_fun = None
    self._target = None
    self._max_constraint_val = None
    self._constraint_name = None
    self._accept_violation = accept_violation
    if (hvp_approach is None):
        hvp_approach = PerlmutterHvp(num_slices)
    self._hvp_approach = hvp_approach
