def __init__(self, parameters): self.params = parameters # make sure nobody accidentally added new parameters (by e.g. spelling mistakes) assert len(parameters) == len(utils_parameters.get_parameter_dict()) # get the input domain on which the utility is defined self.input_domain = self.initialise_input_domain() # get a user with preferences over the input domain self.user = self.initialise_user() # get an acquirer which will pick the queries self.acquirer = self.initialise_acquirer() # initialise the Gaussian process self.gp = self.initialise_gaussian_process() # initialise dataset self.dataset = self.initialise_dataset() self.curr_x_max = None self.curr_x_new = None self.visualiser = self.initialise_visualiser()
for prior_type, ref_min, ref_max in [['zero', False, False], ['linear-zero', 'full', 'full']]: for utl_noise in [0.01, 0.1]: plt.subplot(2, 2, plt_idx) # loop through query types for query_type in [ 'pairwise', 'clustering', 'ranking', 'clustering4', 'top_rank' ]: # get the parameters params = utils_parameters.get_parameter_dict( num_objectives=num_obj, query_type=query_type, utility_noise=utl_noise) params['num queries'] = num_queries params['gp prior mean'] = prior_type params['reference min'] = ref_min params['reference max'] = ref_max if params['query type'] == 'clustering4': params['query type'] = 'clustering' params['num clusters'] = 4 params['seed'] = start_seed utilities = np.zeros((num_iter, params['num queries']))
for virtcomps in [ 'none', 'VC grid', 'VC pcs', 'VC grid begin', 'VC pcs begin' ]: # 5 is the number of diff query types; # 50 is the number of queries we ask utl_vals = np.zeros((5 * num_iter, 50)) iter_idx = 0 for query_type in [ 'pairwise', 'clustering', 'ranking', 'top_rank' ]: params = utils_parameters.get_parameter_dict( query_type=query_type, num_objectives=num_obj, utility_noise=noise_level) if virtcomps == 'VC grid': params['VC grid'] = True elif virtcomps == 'VC pcs begin': params['VC grid begin'] = True elif virtcomps == 'VC pcs': params['VC pcs'] = True elif virtcomps == 'VC pcs begin': params['VC pcs begin'] = True plt.title(query_type) params['seed'] = start_seed