Example #1
0
    def __init__(self,
                 state_space_parameters,
                 epsilon,
                 state=None,
                 qstore=None,
                 replay_dictionary=pd.DataFrame(columns=['net',
                                                         'accuracy_best_val',
                                                         'accuracy_last_val',
                                                         'accuracy_best_test',
                                                         'accuracy_last_test',
                                                         'ix_q_value_update',
                                                         'epsilon'])):
        self.state_list = []

        self.state_space_parameters = state_space_parameters

        # Class that will expand states for us
        self.enum = se.StateEnumerator(state_space_parameters)
        self.stringutils = StateStringUtils(state_space_parameters)
        self.model=self._build_model()

        # Starting State
        self.state = se.State('start', 0, 1, 0, 0, state_space_parameters.image_size, 0, 0) if not state else state
        self.bucketed_state = self.enum.bucket_state(self.state)

        # Cached Q-Values -- used for q learning update and transition
        self.qstore = QValues() if not qstore else qstore
        self.replay_dictionary = replay_dictionary

        self.epsilon = epsilon  # epsilon: parameter for epsilon greedy strategy
Example #2
0
 def __init__(self):
     self.start_state = se.State('start', 0, 1, 0, 0, ssp.image_size, 0, 0,
                                 0, 0)
     self.q_path = 'needed_for_testing/q_values.csv'
     self.se = se.StateEnumerator(ssp)
Example #3
0
 def __init__(self):
     self.se = se.StateEnumerator(ssp)
Example #4
0
 def __init__(self, state_space_parameters):
     self.image_size = state_space_parameters.image_size
     self.output_number = state_space_parameters.output_states
     self.enum = se.StateEnumerator(state_space_parameters)