parameters: (directory,i_update,distribution,cost_eval,samples,costs,weights,distribution_new)
docstring: Save an optimization update to a directory.
      \param[in] directory The directory to save the update to.
      \param[in] i_update How many updates have been done so far
      \param[in] distribution Gaussian distribution before the update
      \param[in] cost_eval Cost of the mean of the distribution 
      \param[in] samples The samples in the search space
      \param[in] costs The cost of each sample 
      \param[in] weights The weight of each sample 
      \param[in] distribution_new Gaussian distribution after the update
docstring_summary: Save an optimization update to a directory.
      \param[in] directory The directory to save the update to.
      \param[in] i_update How many updates have been done so far
      \param[in] distribution Gaussian distribution before the update
      \param[in] cost_eval Cost of the mean of the distribution 
      \param[in] samples The samples in the search space
      \param[in] costs The cost of each sample 
      \param[in] weights The weight of each sample 
      \param[in] distribution_new Gaussian distribution after the update
docstring_tokens: Save an optimization update to a directory . \ param [ in ] directory The directory to save the update to . \ param [ in ] i_update How many updates have been done so far \ param [ in ] distribution Gaussian distribution before the update \ param [ in ] cost_eval Cost of the mean of the distribution \ param [ in ] samples The samples in the search space \ param [ in ] costs The cost of each sample \ param [ in ] weights The weight of each sample \ param [ in ] distribution_new Gaussian distribution after the update
function: def saveUpdate(directory,i_update,distribution,cost_eval,samples,costs,weights,distribution_new):
      """ Save an optimization update to a directory.
      \param[in] directory The directory to save the update to.
      \param[in] i_update How many updates have been done so far
      \param[in] distribution Gaussian distribution before the update
      \param[in] cost_eval Cost of the mean of the distribution 
      \param[in] samples The samples in the search space
      \param[in] costs The cost of each sample 
      \param[in] weights The weight of each sample 
      \param[in] distribution_new Gaussian distribution after the update
      """
  
      if not os.path.exists(directory):
          os.makedirs(directory)
          
      cur_dir = '%s/update%05d' % (directory, i_update)
      if not os.path.exists(cur_dir):
          os.makedirs(cur_dir)
      
      np.savetxt(cur_dir+"/distribution_mean.txt",distribution.mean)
      np.savetxt(cur_dir+"/distribution_covar.txt",distribution.covar)
      np.savetxt(cur_dir+"/distribution_new_mean.txt",distribution_new.mean)
      np.savetxt(cur_dir+"/distribution_new_covar.txt",distribution_new.covar)
            
      if cost_eval is not None:
          np.savetxt(cur_dir+'/cost_eval.txt',np.atleast_1d(cost_eval))
      if samples is not None:
          np.savetxt(cur_dir+'/samples.txt',samples)
      if costs is not None:
          np.savetxt(cur_dir+'/costs.txt',costs)
      if weights is not None:
          np.savetxt(cur_dir+'/weights.txt',weights)
function_tokens: def saveUpdate ( directory , i_update , distribution , cost_eval , samples , costs , weights , distribution_new ) : if not os . path . exists ( directory ) : os . makedirs ( directory ) cur_dir = '%s/update%05d' % ( directory , i_update ) if not os . path . exists ( cur_dir ) : os . makedirs ( cur_dir ) np . savetxt ( cur_dir + "/distribution_mean.txt" , distribution . mean ) np . savetxt ( cur_dir + "/distribution_covar.txt" , distribution . covar ) np . savetxt ( cur_dir + "/distribution_new_mean.txt" , distribution_new . mean ) np . savetxt ( cur_dir + "/distribution_new_covar.txt" , distribution_new . covar ) if cost_eval is not None : np . savetxt ( cur_dir + '/cost_eval.txt' , np . atleast_1d ( cost_eval ) ) if samples is not None : np . savetxt ( cur_dir + '/samples.txt' , samples ) if costs is not None : np . savetxt ( cur_dir + '/costs.txt' , costs ) if weights is not None : np . savetxt ( cur_dir + '/weights.txt' , weights )