Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Provides Optuna hyperparameter optimization with samplers (TPE, CMA-ES, NSGA-II, GPSampler), pruners, and framework integrations.
82% 91%+9 ptsof test cases passed
Passed 20 of 22 test cases with the skill, and 18 of 22 without it.
3 of 3 safety checks passed
Not used yet
---|----------|-------------|
| TPESampler | General ML tuning | Tree-structured Parzen Estimator; default, good for most cases |
| CMAESSampler | Continuous, low-dim (<100) | Covariance Matrix Adaptation; efficient for numeric params |
| NSGAIISampler | Multi-objective (2-3 objectives) | Pareto-front optimization |
| GPSampler | Expensive evaluations | Gaussian Process-based; sample-efficient |
| RandomSampler | Baseline, debugging | Uniform random sampling |
| GridSampler | Small discrete spaces | Exhaustive grid search |
| QMCSampler | Continuous spaces | Quasi-Monte Carlo, better coverage than random |
Usage:
import optuna
sampler = optuna.samplers.TPESampler(seed=42, n_startup_trials=10)
study = optuna.create_study(sampler=sampler)
Stop unpromising trials early to save compute:
def objective(trial):
for epoch in range(100):
accuracy = train_and_evaluate(...)
# Report intermediate value
trial.report(accuracy, epoch)
# Check if should prune
if trial.should_prune():
raise optuna.TrialPruned()
return accuracy
Pruner Selection:
MedianPruner: Prune if trial's intermediate value is below median at same stepHyperbandPruner: Successive halving; efficient for large trial countsSuccessiveHalvingPruner: Similar to Hyperband, simpler configurationThresholdPruner: Prune below absolute thresholdPatientPruner: Prune after N epochs without improvementIntegration with PyTorch Lightning:
Skills that do similar work, with their benchmark result.
Next to this one in the catalogue, plus more from the same author.