Conditions | 1 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 11 |
Ratio | 91.67 % |
Changes | 0 |
1 | """Test module for non-verbose output functionality.""" |
||
8 | View Code Duplication | def ackley_function(para): |
|
|
|||
9 | """Ackley optimization function for testing.""" |
||
10 | x, y = para["x"], para["y"] |
||
11 | |||
12 | loss = ( |
||
13 | -20 * np.exp(-0.2 * np.sqrt(0.5 * (x * x + y * y))) |
||
14 | - np.exp(0.5 * (np.cos(2 * np.pi * x) + np.cos(2 * np.pi * y))) |
||
15 | + np.exp(1) |
||
16 | + 20 |
||
17 | ) |
||
18 | |||
19 | return -loss |
||
20 | |||
31 |