48 lines
1.8 KiB
Python
48 lines
1.8 KiB
Python
from typing import Final
|
|
import numpy as np
|
|
|
|
DATA_DIR: Final = '../data'
|
|
OUT_DIR: Final = './out'
|
|
MODEL_DIR: Final = './models'
|
|
|
|
NB_THREADS: Final = 1024
|
|
NB_THREADS_2D: Final = (32, 32)
|
|
NB_THREADS_3D: Final = (16, 16, 4)
|
|
M: Final = int(np.log2(NB_THREADS_2D[1]))
|
|
|
|
# Save state to avoid recalculation on restart
|
|
SAVE_STATE: Final = True
|
|
# Redo the state even if it's already saved
|
|
FORCE_REDO: Final = False
|
|
# Use NJIT to greatly accelerate runtime
|
|
COMPILE_WITH_C: Final = True
|
|
# Use GPU to greatly accelerate runtime (as priority over NJIT)
|
|
GPU_BOOSTED: Final = True
|
|
# Depending on what you set, the output label will be as follow :
|
|
# ┌────────────────┬─────────────┬───────┐
|
|
# │ COMPILE_WITH_C │ GPU_BOOSTED │ LABEL │
|
|
# ├────────────────┼─────────────┼───────┤
|
|
# │ True │ True │ GPU │
|
|
# │ True │ False │ CPU │
|
|
# │ False │ True │ PGPU │
|
|
# │ False │ False │ PY │
|
|
# └────────────────┴─────────────┴───────┘
|
|
|
|
# Number of weak classifiers
|
|
# TS: Final = [1]
|
|
# TS: Final = [1, 5, 10]
|
|
TS: Final = [1, 5, 10, 25, 50]
|
|
# TS: Final = [1, 5, 10, 25, 50, 100, 200]
|
|
# TS: Final = [1, 5, 10, 25, 50, 100, 200, 300]
|
|
# TS: Final = [1, 5, 10, 25, 50, 100, 200, 300, 400, 500, 1000]
|
|
|
|
# Enable verbose output (for debugging purposes)
|
|
__DEBUG: Final = False
|
|
# Debugging options
|
|
if __DEBUG:
|
|
IDX_INSPECT: Final = 4548
|
|
IDX_INSPECT_OFFSET: Final = 100
|
|
np.seterr(all = 'raise')
|
|
# Debug option (image width * log_10(length) + extra characters)
|
|
np.set_printoptions(linewidth = 19 * 6 + 3)
|