def process_minibatch(self, terminal_rewards):
        X_train = []
        y_train = []
        val = 0
        for memory in self.observations:
            if val == 0:
                val += 1
                old_state_m1, action_m1, reward_m1, new_state_m1 = memory
            else:
                # Get stored values.
                old_state_m, action_m, reward_m, new_state_m = memory
                # Get prediction on old state.
                input = np.concatenate(
                    (list(old_state_m1), list(old_state_m))) + 1
                old_state_m = input.reshape(1, self.input_dim)
                old_qval = self.model.predict(old_state_m,
                                              batch_size=1,
                                              verbose=0)
                # Get prediction on new state.
                input2 = np.concatenate((old_state_m[
                                        0][-15:], list(new_state_m))) + 1
                new_state_m = input2.reshape(1, self.input_dim)
                newQ = self.model.predict(new_state_m,
                                          batch_size=1,
                                          verbose=0)
                maxQ = np.max(newQ)
                y = np.zeros((1, len(self.actions)))
                y[:] = old_qval[:]

                # Check for terminal state.
                if reward_m not in terminal_rewards:
                    update = (reward_m + (self.gamma * maxQ))
                else:
                    update = reward_m

                y[0][action_m] = update
                X_train.append(old_state_m.reshape(self.input_dim,))
                y_train.append(y.reshape(len(self.actions),))
                self.old_state_m1, self.action_m1, self.reward_m1, new_state_m1 = memory

        # Generate Numpy Arrays
        X_train = np.array(X_train)
        y_train = np.array(y_train)

        return X_train, y_train
Creates Training and Labels Arrays
dataset/ETHPy150Open dandxy89/rf_helicopter/Model/Q_Learning_Agent.py/Q_Neural_Network.process_minibatch