|
8 | 8 | problem = Poisson2DSquareProblem() |
9 | 9 | condition_names = problem.conditions.keys() |
10 | 10 |
|
| 11 | + |
11 | 12 | @pytest.mark.parametrize( |
12 | | - "model,alpha", [(FeedForward(len(problem.input_variables), len(problem.output_variables)),0.5)] |
| 13 | + "model,alpha", |
| 14 | + [ |
| 15 | + ( |
| 16 | + FeedForward( |
| 17 | + len(problem.input_variables), len(problem.output_variables) |
| 18 | + ), |
| 19 | + 0.5, |
| 20 | + ) |
| 21 | + ], |
13 | 22 | ) |
14 | 23 | def test_constructor(model, alpha): |
15 | 24 | NeuralTangetKernelWeighting(model=model, alpha=alpha) |
16 | 25 |
|
| 26 | + |
17 | 27 | @pytest.mark.parametrize( |
18 | | - "model,alpha", [(FeedForward(len(problem.input_variables), len(problem.output_variables)),1.2)] |
| 28 | + "model,alpha", |
| 29 | + [ |
| 30 | + ( |
| 31 | + FeedForward( |
| 32 | + len(problem.input_variables), len(problem.output_variables) |
| 33 | + ), |
| 34 | + 1.2, |
| 35 | + ) |
| 36 | + ], |
19 | 37 | ) |
20 | | -def test_wrong_constructor2(model,alpha): |
| 38 | +def test_wrong_constructor2(model, alpha): |
21 | 39 | with pytest.raises(ValueError): |
22 | 40 | NeuralTangetKernelWeighting(model, alpha) |
23 | 41 |
|
24 | | -@pytest.mark.parametrize( |
25 | | - "model,alpha", [(0.5,0.5)] |
26 | | -) |
| 42 | + |
| 43 | +@pytest.mark.parametrize("model,alpha", [(0.5, 0.5)]) |
27 | 44 | def test_wrong_constructor1(model): |
28 | 45 | with pytest.raises(TypeError): |
29 | 46 | NeuralTangetKernelWeighting(model) |
30 | 47 |
|
| 48 | + |
31 | 49 | @pytest.mark.parametrize( |
32 | | - "model,alpha", [(FeedForward(len(problem.input_variables), len(problem.output_variables)),0.5)] |
| 50 | + "model,alpha", |
| 51 | + [ |
| 52 | + ( |
| 53 | + FeedForward( |
| 54 | + len(problem.input_variables), len(problem.output_variables) |
| 55 | + ), |
| 56 | + 0.5, |
| 57 | + ) |
| 58 | + ], |
33 | 59 | ) |
34 | | -def test_train_aggregation(model,alpha): |
| 60 | +def test_train_aggregation(model, alpha): |
35 | 61 | weighting = NeuralTangetKernelWeighting(model=model, alpha=alpha) |
36 | 62 | problem.discretise_domain(50) |
37 | 63 | solver = PINN(problem=problem, model=model, weighting=weighting) |
|
0 commit comments