You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a Forward map wrapper to more easily test pipelines without using an emulator (#402)
* moved MLTs into subdirectory
* added ForwardMapWrapper, made compatible with MCMC and encoder utilities
* featured in sinusoid example
* remove anonymous function and have G in space so sample.jl doesnt crash
* add FM into sinusoid
* format
* Update src/Emulator.jl
Co-authored-by: ArneBouillon <45404227+ArneBouillon@users.noreply.github.com>
* Update docs/src/examples/sinusoid_example.md
Co-authored-by: ArneBouillon <45404227+ArneBouillon@users.noreply.github.com>
* add a warning message that the input encoder is not used
* some starting tests
* remove extra end
* scope "sample"
* improve const
* update test_throws
* qualify sample and predict
* coverage
* format
---------
Co-authored-by: ArneBouillon <45404227+ArneBouillon@users.noreply.github.com>
where $\Gamma$ is the observational covariance matrix. We will assume the noise to be independent for each observable, giving us a diagonal covariance matrix.
32
32
33
33
34
-
35
34
# Walkthrough of code
36
35
37
36
You can find the full scripts to reproduce this tutorial in `examples/Sinusoid/`. The code is split into four sections:
@@ -342,7 +349,22 @@ and the random features absolute errors are here:
342
349
Both these error maps look similar. Importantly, we want the emulator to show the low errors in the region around the true parameter values near $\theta=(3, 6)$ (i.e, near where the EKI points converge, shown by the scatter points in
343
350
the previous plot). This the region that we will be sampling in the next step.
344
351
We see low errors near here for both outputs and for both emulators. Now we have validated these emulators,
345
-
we will proceed the last step of CES: Sampling of the posterior distribution.
352
+
we will proceed the last step of CES: Sampling of the posterior distribution.
353
+
354
+
## An aside, Forward map wrapper
355
+
356
+
What if we run a simple case, and wish to see the emulator performance against the actual forward map sampling in the pipeline? We allow for an exact substitution by using our `ForwardMapWrapper`
357
+
358
+
```julia
359
+
emulator_fm =forward_map_wrapper(
360
+
G,
361
+
prior,
362
+
input_output_pairs;
363
+
encoder_schedule =deepcopy(encoder_schedule),
364
+
encoder_kwargs =deepcopy(encoder_kwargs),
365
+
)
366
+
```
367
+
In this way we can test against the posterior found with the true model, which in this setting is cheap enough to run.
346
368
347
369
## Sample
348
370
@@ -441,14 +463,26 @@ process and we find similar results:
0 commit comments