def __init__( self, eps_init=1, eps_final=0.01, eps_final_min=None, # Give < eps_final for vector epsilon. eps_itr_min=50, # Algo may overwrite. eps_itr_max=1000, eps_eval=0.001, *args, **kwargs): """Saves input arguments. ``eps_final_min`` other than ``None`` will use vector-valued epsilon, log-spaced.""" super().__init__(*args, **kwargs) save__init__args(locals()) self._eps_final_scalar = eps_final # In case multiple vec_eps calls. self._eps_init_scalar = eps_init self._eps_itr_min_max = np_mp_array( 2, "int") # Shared memory for CpuSampler self._eps_itr_min_max[0] = eps_itr_min self._eps_itr_min_max[1] = eps_itr_max
def _allocate_tree(self): self.tree = np_mp_array(2**self.tree_levels - 1, np.float64) # Shared memory. self.tree.fill(0) # Just in case.