|
40 | 40 | OPTUNA_AVAILABLE = False |
41 | 41 |
|
42 | 42 | from connectomics.metrics.metrics_seg import adapted_rand |
| 43 | +from connectomics.runtime.output_naming import ( |
| 44 | + tta_cache_suffix, |
| 45 | + tuning_best_params_filename, |
| 46 | + tuning_best_params_filename_candidates, |
| 47 | + tuning_study_db_filename, |
| 48 | +) |
43 | 49 |
|
44 | 50 | from ..registry import get_decoder |
45 | 51 | from ..utils import remove_small_instances |
|
54 | 60 | ] |
55 | 61 |
|
56 | 62 |
|
57 | | -def tta_cache_suffix(*args, **kwargs) -> str: |
58 | | - """Resolve the prediction cache suffix lazily to avoid import-time training coupling.""" |
59 | | - from connectomics.training.lightning.utils import tta_cache_suffix as _tta_cache_suffix |
60 | | - |
61 | | - return _tta_cache_suffix(*args, **kwargs) |
62 | | - |
63 | | - |
64 | | -def tuning_best_params_filename(*args, **kwargs) -> str: |
65 | | - """Resolve the best-params filename lazily.""" |
66 | | - from connectomics.training.lightning.utils import ( |
67 | | - tuning_best_params_filename as _tuning_best_params_filename, |
68 | | - ) |
69 | | - |
70 | | - return _tuning_best_params_filename(*args, **kwargs) |
71 | | - |
72 | | - |
73 | | -def tuning_best_params_filename_candidates(*args, **kwargs) -> list[str]: |
74 | | - """Resolve best-params filename candidates lazily.""" |
75 | | - from connectomics.training.lightning.utils import ( |
76 | | - tuning_best_params_filename_candidates as _tuning_best_params_filename_candidates, |
77 | | - ) |
78 | | - |
79 | | - return _tuning_best_params_filename_candidates(*args, **kwargs) |
80 | | - |
81 | | - |
82 | | -def tuning_study_db_filename(*args, **kwargs) -> str: |
83 | | - """Resolve the Optuna study DB filename lazily.""" |
84 | | - from connectomics.training.lightning.utils import ( |
85 | | - tuning_study_db_filename as _tuning_study_db_filename, |
86 | | - ) |
87 | | - |
88 | | - return _tuning_study_db_filename(*args, **kwargs) |
89 | | - |
90 | | - |
91 | 63 | class TrialEvaluationTimeoutError(TimeoutError): |
92 | 64 | """Raised when a single tuning trial exceeds the configured wall-clock limit.""" |
93 | 65 |
|
|
0 commit comments