#NEWLINE# def _additionalInit( self ) : #NEWLINE# #INDENT# assert ( self . numberOfCenters == 1 ) , 'Mixtures of Gaussians not supported yet.' #NEWLINE# xdim = self . numParameters #NEWLINE# self . alphas = ( ones ( self . numberOfCenters ) / float ( self . numberOfCenters ) ) #NEWLINE# self . mus = [ ] #NEWLINE# self . sigmas = [ ] #NEWLINE# if ( self . rangemins == None ) : #NEWLINE# #INDENT# self . rangemins = ( - ones ( xdim ) ) #NEWLINE# #UNINDENT# if ( self . rangemaxs == None ) : #NEWLINE# #INDENT# self . rangemaxs = ones ( xdim ) #NEWLINE# #UNINDENT# if ( self . initCovariances == None ) : #NEWLINE# #INDENT# if self . diagonalOnly : #NEWLINE# #INDENT# self . initCovariances = ones ( xdim ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . initCovariances = eye ( xdim ) #NEWLINE# #UNINDENT# #UNINDENT# for _ in range ( self . numberOfCenters ) : #NEWLINE# #INDENT# self . mus . append ( ( ( rand ( xdim ) * ( self . rangemaxs - _ . rangemins ) ) + self . rangemins ) ) #NEWLINE# self . sigmas . append ( dot ( eye ( xdim ) , self . initCovariances ) ) #NEWLINE# #UNINDENT# self . samples = list ( range ( self . windowSize ) ) #NEWLINE# self . fitnesses = zeros ( self . windowSize ) #NEWLINE# self . generation = 0 #NEWLINE# self . allsamples = [ ] #NEWLINE# self . muevals = [ ] #NEWLINE# self . allmus = [ ] #NEWLINE# self . allsigmas = [ ] #NEWLINE# self . allalphas = [ ] #NEWLINE# self . allUpdateSizes = [ ] #NEWLINE# self . allfitnesses = [ ] #NEWLINE# self . meanShifts = [ zeros ( self . numParameters ) for _ in range ( self . numberOfCenters ) ] #NEWLINE# self . _oneEvaluation ( self . _initEvaluable )