Passed
Pull Request — master (#101)
by Simon
01:37
created

SphereFunction.objective_function()   A

Complexity

Conditions 1

Size

Total Lines 2
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nop 2
dl 0
loc 2
rs 10
c 0
b 0
f 0
1
import numpy as np
2
3
from hyperactive.experiment import BaseExperiment
4
5
6
class SphereFunction(BaseExperiment):
7
    def setup(self, n_dim=2):
8
        self.n_dim = n_dim
9
10
    def objective_function(self, params):
11
        return np.sum(params["x0"] ** 2 + params["x1"] ** 2)
12