Code Duplication    Length = 11-11 lines in 3 locations

examples/optimization_applications/test_function.py 1 location

@@ 5-15 (lines=11) @@
2
from hyperactive import Hyperactive
3
4
5
def ackley_function(para):
6
    x, y = para["x"], para["y"]
7
8
    loss = (
9
        -20 * np.exp(-0.2 * np.sqrt(0.5 * (x * x + y * y)))
10
        - np.exp(0.5 * (np.cos(2 * np.pi * x) + np.cos(2 * np.pi * y)))
11
        + np.exp(1)
12
        + 20
13
    )
14
15
    return -loss
16
17
18
search_space = {

tests/test_empty_output/non_verbose.py 1 location

@@ 5-15 (lines=11) @@
2
from hyperactive import Hyperactive
3
4
5
def ackley_function(para):
6
    x, y = para["x"], para["y"]
7
8
    loss = (
9
        -20 * np.exp(-0.2 * np.sqrt(0.5 * (x * x + y * y)))
10
        - np.exp(0.5 * (np.cos(2 * np.pi * x) + np.cos(2 * np.pi * y)))
11
        + np.exp(1)
12
        + 20
13
    )
14
15
    return -loss
16
17
18
search_space = {

tests/test_empty_output/verbose.py 1 location

@@ 6-16 (lines=11) @@
3
from hyperactive import Hyperactive
4
5
6
def ackley_function(para):
7
    x, y = para["x"], para["y"]
8
9
    loss = (
10
        -20 * np.exp(-0.2 * np.sqrt(0.5 * (x * x + y * y)))
11
        - np.exp(0.5 * (np.cos(2 * np.pi * x) + np.cos(2 * np.pi * y)))
12
        + np.exp(1)
13
        + 20
14
    )
15
16
    return -loss
17
18
19
search_space = {