| @@ 15-57 (lines=43) @@ | ||
| 12 | ||
| 13 | ||
| 14 | class SearchProcessShortMem(SearchProcess): |
|
| 15 | def __init__( |
|
| 16 | self, |
|
| 17 | nth_process, |
|
| 18 | p_bar, |
|
| 19 | model, |
|
| 20 | search_space, |
|
| 21 | search_name, |
|
| 22 | n_iter, |
|
| 23 | training_data, |
|
| 24 | optimizer, |
|
| 25 | n_jobs, |
|
| 26 | init_para, |
|
| 27 | memory, |
|
| 28 | random_state, |
|
| 29 | ): |
|
| 30 | super().__init__( |
|
| 31 | nth_process, |
|
| 32 | p_bar, |
|
| 33 | model, |
|
| 34 | search_space, |
|
| 35 | search_name, |
|
| 36 | n_iter, |
|
| 37 | training_data, |
|
| 38 | optimizer, |
|
| 39 | n_jobs, |
|
| 40 | init_para, |
|
| 41 | memory, |
|
| 42 | random_state, |
|
| 43 | ) |
|
| 44 | ||
| 45 | self.cand = CandidateShortMem( |
|
| 46 | self.model, |
|
| 47 | self.training_data, |
|
| 48 | self.search_space, |
|
| 49 | self.init_para, |
|
| 50 | self.memory, |
|
| 51 | p_bar, |
|
| 52 | ) |
|
| 53 | ||
| 54 | if not isinstance(search_name, str): |
|
| 55 | search_name = str(nth_process) |
|
| 56 | ||
| 57 | self.res = ResultsManager(search_name, model, search_space, training_data) |
|
| 58 | ||
| 59 | def _memory2dataframe(self, memory): |
|
| 60 | positions = np.array(list(memory.keys())) |
|
| @@ 11-53 (lines=43) @@ | ||
| 8 | ||
| 9 | ||
| 10 | class SearchProcessNoMem(SearchProcess): |
|
| 11 | def __init__( |
|
| 12 | self, |
|
| 13 | nth_process, |
|
| 14 | p_bar, |
|
| 15 | model, |
|
| 16 | search_space, |
|
| 17 | search_name, |
|
| 18 | n_iter, |
|
| 19 | training_data, |
|
| 20 | optimizer, |
|
| 21 | n_jobs, |
|
| 22 | init_para, |
|
| 23 | memory, |
|
| 24 | random_state, |
|
| 25 | ): |
|
| 26 | super().__init__( |
|
| 27 | nth_process, |
|
| 28 | p_bar, |
|
| 29 | model, |
|
| 30 | search_space, |
|
| 31 | search_name, |
|
| 32 | n_iter, |
|
| 33 | training_data, |
|
| 34 | optimizer, |
|
| 35 | n_jobs, |
|
| 36 | init_para, |
|
| 37 | memory, |
|
| 38 | random_state, |
|
| 39 | ) |
|
| 40 | ||
| 41 | self.cand = CandidateNoMem( |
|
| 42 | self.model, |
|
| 43 | self.training_data, |
|
| 44 | self.search_space, |
|
| 45 | self.init_para, |
|
| 46 | self.memory, |
|
| 47 | p_bar, |
|
| 48 | ) |
|
| 49 | ||
| 50 | if not isinstance(search_name, str): |
|
| 51 | search_name = str(nth_process) |
|
| 52 | ||
| 53 | self.res = ResultsManager(search_name, model, search_space, training_data) |
|
| 54 | ||
| @@ 16-57 (lines=42) @@ | ||
| 13 | ||
| 14 | ||
| 15 | class SearchProcessLongMem(SearchProcessShortMem): |
|
| 16 | def __init__( |
|
| 17 | self, |
|
| 18 | nth_process, |
|
| 19 | p_bar, |
|
| 20 | model, |
|
| 21 | search_space, |
|
| 22 | search_name, |
|
| 23 | n_iter, |
|
| 24 | training_data, |
|
| 25 | optimizer, |
|
| 26 | n_jobs, |
|
| 27 | init_para, |
|
| 28 | memory, |
|
| 29 | random_state, |
|
| 30 | ): |
|
| 31 | super().__init__( |
|
| 32 | nth_process, |
|
| 33 | p_bar, |
|
| 34 | model, |
|
| 35 | search_space, |
|
| 36 | search_name, |
|
| 37 | n_iter, |
|
| 38 | training_data, |
|
| 39 | optimizer, |
|
| 40 | n_jobs, |
|
| 41 | init_para, |
|
| 42 | memory, |
|
| 43 | random_state, |
|
| 44 | ) |
|
| 45 | ||
| 46 | if not isinstance(search_name, str): |
|
| 47 | search_name = str(nth_process) |
|
| 48 | ||
| 49 | self.res = ResultsManagerMemory(search_name, model, search_space, training_data) |
|
| 50 | ||
| 51 | self.cand = CandidateShortMem( |
|
| 52 | self.model, |
|
| 53 | self.training_data, |
|
| 54 | self.search_space, |
|
| 55 | self.init_para, |
|
| 56 | self.memory, |
|
| 57 | p_bar, |
|
| 58 | ) |
|
| 59 | ||
| 60 | ||