If we assign a Uniform prior to a parameter, we should not expect the value of the prior density to change with the parameter value, even if it has a transform associated with it.
()
| 54 | |
| 55 | |
| 56 | def test_log_prior_for_uniform_prior() -> None: |
| 57 | """ |
| 58 | If we assign a Uniform prior to a parameter, we should not expect the value of the prior density |
| 59 | to change with the parameter value, even if it has a transform associated with it. |
| 60 | """ |
| 61 | |
| 62 | uniform_prior = Uniform(low=np.float64(0), high=np.float64(100)) |
| 63 | param = gpflow.Parameter(1.0, transform=gpflow.utilities.positive(), prior=uniform_prior) |
| 64 | low_value = param.log_prior_density().numpy() |
| 65 | param.assign(10.0) |
| 66 | high_value = param.log_prior_density().numpy() |
| 67 | |
| 68 | assert np.isclose(low_value, high_value) |
| 69 | |
| 70 | |
| 71 | def test_log_prior_on_unconstrained() -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…