File: utils.py

package info (click to toggle)
scikit-optimize 0.10.2-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,672 kB
  • sloc: python: 10,659; javascript: 438; makefile: 136; sh: 6
file content (6 lines) | stat: -rw-r--r-- 217 bytes parent folder | download
1
2
3
4
5
6
# Module to import functions from in examples for multiprocessing backend
import numpy as np


def obj_fun(x, noise_level=0.1):
    return np.sin(5 * x[0]) * (1 - np.tanh(x[0] ** 2)) + np.random.randn() * noise_level