Example #1
0
 def update_feedback_processing_object(self, X_obs):
     if self.FP is None:
         self.FP = FeedbackProcessing(self.D, self.m, self.original_bounds,
                                      self.alpha_grid_distribution,
                                      self.TGN_speed)
         self.FP.initialize_data(X_obs)
     else:
         self.FP.update_data(X_obs)
Example #2
0
    def __init__(self, PPBO_settings):
        """
        Basic settings
        """

        self.D = PPBO_settings.D  #Problem dimension
        self.bounds = PPBO_settings.original_bounds  #Boundaries of each variables as a sequence of tuplets
        self.alpha_grid_distribution = PPBO_settings.alpha_grid_distribution

        self.user_feedback_grid_size = PPBO_settings.user_feedback_grid_size  #How many possible points in the user feedback grid?
        self.n_irfs_periods = 20  #This must be same as in a model.mod file
        self.FP = FeedbackProcessing(self.D, self.user_feedback_grid_size,
                                     self.bounds, self.alpha_grid_distribution,
                                     PPBO_settings.TGN_speed)

        self.current_xi = None
        self.current_x = None
        self.current_xi_grid = None
        self.dsge_results = None
        self.user_feedback = None  #variable to store user feedback
        self.user_feedback_was_given = False
        self.popup_slider_has_been_called = False

        self.results = pd.DataFrame(
            columns=(['alpha_xi_x' + str(i) for i in range(1, self.D + 1)] +
                     ['xi' + str(i)
                      for i in range(1, self.D + 1)] + ['alpha_star']),
            dtype=np.float64
        )  #The output of the session is a dataframe containing user feedback

        self.engine = 'OCTAVE'
        ''' Prepare model files to temp '''
        self.path_to_dsge = os.getcwd() + '/dsge'  #CHECK THAT THIS IS CORRECT
        if os.path.exists(self.path_to_dsge + '/temp'):
            shutil.rmtree(self.path_to_dsge + '/temp')
        os.mkdir(self.path_to_dsge + '/temp')
        for i in range(self.user_feedback_grid_size):
            shutil.copy2('dsge/US_FU19_rep.mod',
                         'dsge/temp/US_FU19_rep_' + str(i) + '.mod')
        shutil.copy2('dsge/prior_function_US_FU19.m',
                     'dsge/temp/prior_function_US_FU19.m')
Example #3
0
File: GUI.py Project: AaltoPML/PPBO
 def __init__(self,PPBO_settings):
     """
     Basic settings
     """
     
     self.D = PPBO_settings.D   #Problem dimension
     self.bounds = PPBO_settings.original_bounds #Boundaries of each variables as a sequence of tuplets
     self.alpha_grid_distribution = PPBO_settings.alpha_grid_distribution
     
     self.user_feedback_grid_size = 100 #How many possible points in the user feedback grid?
     self.FP = FeedbackProcessing(self.D, self.user_feedback_grid_size,self.bounds,self.alpha_grid_distribution,PPBO_settings.TGN_speed)
           
     self.current_xi = None
     self.current_x = None
     self.current_xi_grid = None
     self.user_feedback = None  #variable to store user feedback
     self.user_feedback_was_given = False  
     self.popup_configuration_movie_has_been_called = False
     
     self.results = pd.DataFrame(columns=(['alpha_xi_x' + str(i) for i in range(1,6+1)] 
                 + ['xi' + str(i) for i in range(1,6+1)]
                 + ['alpha_star']),dtype=np.float64)  #The output of the session is a dataframe containing user feedback