#NEWLINE# def startLearning( self ) : #NEWLINE# #INDENT# if numpy . isnan ( self . initialParamValue [ 0 ] ) : #NEWLINE# #INDENT# [ shape , paramValues ] = self . shapeModeler . makeRandomShapeFromUniform ( self . params , self . paramsToVary , self . bounds ) #NEWLINE# self . params = paramValues #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# shape = self . shapeModeler . makeShape ( self . params ) #NEWLINE# #UNINDENT# self . bestParamValue = self . params [ ( self . paramsToVary [ 0 ] - 1 ) ] #NEWLINE# if self . doGroupwiseComparison : #NEWLINE# #INDENT# self . params_sorted = [ self . bounds [ ( 0 , 0 ) ] , self . bounds [ ( 0 , 1 ) ] ] #NEWLINE# bisect . insort ( self . params_sorted , self . bestParamValue ) #NEWLINE# self . shapeToParamsMapping = [ self . params ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . newParamValue = self . bestParamValue #NEWLINE# self . params = [ self . newParamValue ] #NEWLINE# #UNINDENT# return ( shape , self . params )