Skip to content
Back to skills

Objective Functions And Speedups

ASecurity

Shape scikit-opt objectives, benchmark functions, and safe run-mode speedups.

  • 247 stars
  • 0 votes
  • 0 copies
  • 1 view
  • Added September 9, 2026
toolsgo

Security analysis

A100/100

Pro scans all 6 files and shows the line behind each finding

Scanned September 9, 2026

npx -y skills add VectorSpaceLab/AREX-Skill --skill objective-functions-and-speedups --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Objective Functions And Speedups?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Objective Functions And Speedups
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/vectorspacelab-objective-functions-and-speedups/badge)](https://www.skillsdirectory.com/skills/vectorspacelab-objective-functions-and-speedups)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: objective-functions-and-speedups
description: "Shape scikit-opt objectives, benchmark functions, and safe run-mode speedups."
disable-model-invocation: true
metadata:
  disco-role: operating
license: MIT
---

# objective-functions-and-speedups

Use this sub-skill when a task needs objective-function contracts, built-in `sko.demo_func` benchmarks, `set_run_mode` acceleration/cache choices, or optional plotting/GPU dependency guidance for `scikit-opt` / `sko`.

## Route here when

- An optimizer fails because the objective receives the wrong shape or returns the wrong shape.
- You need to convert a scalar objective to vectorization mode, cached mode, or a safe thread-based mode.
- You need a quick built-in benchmark such as `sphere`, `schaffer`, `rosenbrock`, or `ackley`.
- You need to explain `matplotlib`, `pandas`, `joblib`, `torch`, or CUDA as optional dependencies rather than core requirements.

## Route elsewhere

- Algorithm-specific parameters, bounds, constraints, continuation, and history interpretation belong to the owning algorithm sub-skill.
- GA integer/precision encoding and the `x2gray` relationship belong to `../genetic-algorithms/`.
- TSP route-cost design and permutation outputs belong to `../routing-and-combinatorial/`.

## Bundled references

- Read [references/objective-contracts.md](references/objective-contracts.md) before writing or adapting objective functions for scalar, vectorized, cached, threaded, or method-based use.
- Read [references/acceleration.md](references/acceleration.md) when choosing `set_run_mode(func, mode)`, deciding whether to use `common`, `vectorization`, `cached`, `multithreading`, `multiprocessing`, `joblib`, or interpreting the `parallel` alias.
- Read [references/demo-functions.md](references/demo-functions.md) when selecting built-in benchmark/demo objective functions or using `function_for_TSP` as a tiny route fixture generator.
- Read [references/troubleshooting.md](references/troubleshooting.md) when run-mode assertions, vectorized shape errors, cached input errors, multiprocessing/joblib failures, plotting display problems, or optional GPU issues appear.

## Bundled script

- Run [scripts/smoke_run_modes.py](scripts/smoke_run_modes.py) to check that the installed package can execute tiny GA objectives in `common`, `vectorization`, `cached`, and `multithreading` modes without source-checkout data, plotting, network, or GPU requirements.

## Fast operating rules

1. Set the run mode before constructing the optimizer; constructors wrap the function immediately.
2. Use scalar objectives for `common`, `multithreading`, `multiprocessing`, `cached`, and `joblib`: one candidate vector in, one finite scalar out.
3. Use vectorized objectives only after adapting the function to accept an `X` matrix and return one value per row.
4. Treat multiprocessing, joblib, plotting, pandas workflows, and `GA.to(device)` as optional surfaces with extra dependency/platform checks.

Files in this skill

  • SKILL.md2.9 KB
  • references/acceleration.md4.9 KB
  • references/demo-functions.md3 KB
  • references/objective-contracts.md3.8 KB
  • references/troubleshooting.md5 KB
  • scripts/smoke_run_modes.py4.7 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.