File: utils.py

package info (click to toggle)
scikit-optimize 0.10.2-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 7,684 kB
  • sloc: python: 10,659; javascript: 438; makefile: 136; sh: 6
file content (6 lines) | stat: -rw-r--r-- 217 bytes parent folder | download | duplicates (2)
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