(self, x0, sigma0, randn=np.random.randn)
TODO: check scaling of r-learing: seems worse than linear: 9e3 25e3 65e3 (10,20,40-D)
TODO: check scaling of r-learing: seems worse than linear: 9e3 25e3 65e3 (10,20,40-D)
TODO : check scaling of r - learing : seems worse than linear : 9e3 25e3 65e3 ( 10 20 40 - D )
def __init__(self, x0, sigma0, randn=np.random.randn):
        """TODO: check scaling of r-learing: seems worse than linear: 9e3 25e3 65e3 (10,20,40-D)"""
        self.N = len(x0)
        N = self.N
        # parameters to play with:
        # PROBLEM: smaller eta_r even fails on *axparallel* cigar!! Also dampi needs to be smaller then!
        self.dampi = 4 * N  # two times smaller is
        self.eta_r = 0 / N / 3   # c_r learning rate for direction, cigar: 4/N/3 is optimal in 10-D, 10/N/3 still works (15 in 20-D) but not on the axparallel cigar with recombination
        self.mu = 1
        self.use_abs_sigma = 1    # without it is a problem on 20=D axpar-cigar!!, but why?? Because dampi is just boarderline
        self.use_abs_sigma_r = 1  #

        self.randn = randn
        self.x0 = array(x0, copy=True)
        self.sigma0 = sigma0

        self.cs = 1 / N**0.5  # evolution path for step-size(s)
        self.damps = 1
        self.use_sign = 0
        self.use_scalar_product = 0  # sometimes makes it somewhat worse on Rosenbrock, don't know why
        self.csr = 1 / N**0.5  # cumulation for sigma_r
        self.dampsr = (4 * N)**0.5
        self.chi1 = (2/np.pi)**0.5
        self.chiN = N**0.5*(1-1./(4.*N)+1./(21.*N**2)) # expectation of norm(randn(N,1))
        self.initialize()
def __init__ ( self , x0 , sigma0 , randn = np . random . randn ) : self . N = len ( x0 ) N = self . N # parameters to play with: # PROBLEM: smaller eta_r even fails on *axparallel* cigar!! Also dampi needs to be smaller then! self . dampi = 4 * N # two times smaller is self . eta_r = 0 / N / 3 # c_r learning rate for direction, cigar: 4/N/3 is optimal in 10-D, 10/N/3 still works (15 in 20-D) but not on the axparallel cigar with recombination self . mu = 1 self . use_abs_sigma = 1 # without it is a problem on 20=D axpar-cigar!!, but why?? Because dampi is just boarderline self . use_abs_sigma_r = 1 # self . randn = randn self . x0 = array ( x0 , copy = True ) self . sigma0 = sigma0 self . cs = 1 / N ** 0.5 # evolution path for step-size(s) self . damps = 1 self . use_sign = 0 self . use_scalar_product = 0 # sometimes makes it somewhat worse on Rosenbrock, don't know why self . csr = 1 / N ** 0.5 # cumulation for sigma_r self . dampsr = ( 4 * N ) ** 0.5 self . chi1 = ( 2 / np . pi ) ** 0.5 self . chiN = N ** 0.5 * ( 1 - 1. / ( 4. * N ) + 1. / ( 21. * N ** 2 ) ) # expectation of norm(randn(N,1)) self . initialize ( )