Run1 grid search parallelization
Running a multi-parameter grid search efficiently using parallel processing to find optimal hyperparameters.From its SKILL.md
npx -y skills add cxcscmu/SkillLearnBench --skill run1_grid-search-parallelizationAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
SKILL.md
1.1 KB, 242 tokens by cl100k_base, as published. Nobody here has run it
When searching a large hyperparameter space (like combinations of min_samples, epsilon, and shape_weight), joblib or multiprocessing can significantly reduce execution time.
Workflow:
- Generate a list of all parameter combinations using
itertools.product. - Define a worker function that takes one combination, processes all images, and returns the average metrics.
- Use a parallel map to distribute the combinations across CPU cores.
from itertools import product
from joblib import Parallel, delayed
def evaluate_params(params):
min_s, eps, w = params
# ... logic to group images, cluster, match, and calculate averages ...
return {'F1': avg_f1, 'delta': avg_delta, 'min_samples': min_s, 'epsilon': eps, 'shape_weight': w}
# Define ranges
space = list(product(range(3, 10), range(4, 25, 2), np.arange(0.9, 2.0, 0.1)))
results = Parallel(n_jobs=-1)(delayed(evaluate_params)(p) for p in space)
What ships with it
Read from the repository
Just SKILL.md. No reference files, no scripts.