| Total Complexity | 8 |
| Total Lines | 36 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | # Author: Simon Blanke |
||
| 2 | # Email: [email protected] |
||
| 3 | # License: MIT License |
||
| 4 | |||
| 5 | import numpy as np |
||
| 6 | |||
| 7 | from gradient_free_optimizers import RandomAnnealingOptimizer |
||
| 8 | from ._base_test import _base_test |
||
| 9 | |||
| 10 | n_iter = 33 |
||
| 11 | opt = RandomAnnealingOptimizer |
||
| 12 | |||
| 13 | |||
| 14 | def test_epsilon(): |
||
| 15 | for epsilon in [0.00001, 100]: |
||
| 16 | opt_para = {"epsilon": epsilon} |
||
| 17 | _base_test(opt, n_iter, opt_para=opt_para) |
||
| 18 | |||
| 19 | |||
| 20 | def test_n_neighbours(): |
||
| 21 | for n_neighbours in [1, 100]: |
||
| 22 | opt_para = {"n_neighbours": n_neighbours} |
||
| 23 | _base_test(opt, n_iter, opt_para=opt_para) |
||
| 24 | |||
| 25 | |||
| 26 | def test_annealing_rate(): |
||
| 27 | for annealing_rate in [1, 0.001]: |
||
| 28 | opt_para = {"annealing_rate": annealing_rate} |
||
| 29 | _base_test(opt, n_iter, opt_para=opt_para) |
||
| 30 | |||
| 31 | |||
| 32 | def test_start_temp(): |
||
| 33 | for start_temp in [0.001, 10000]: |
||
| 34 | opt_para = {"start_temp": start_temp} |
||
| 35 | _base_test(opt, n_iter, opt_para=opt_para) |
||
| 36 |