Skip to content

Sample generation

Kevin" Seung Whan Chung edited this page Dec 13, 2023 · 13 revisions

In order to run sample generation, we set the option main/mode to be sample_generation in the input file. In the example of examples/poisson/poisson.sample.yml,

main:
  mode: sample_generation
  use_rom: true
  solver: poisson

There are two types of sampling:

  • base sample generator that samples over uniform grid points on parameter space
  • random sample generator that randomly choose the parameter values over a uniform random distribution

base sample generator

In the example of examples/poisson/poisson.sample.yml, we use base sample generator, saving snapshots in the name of poisson0,

sample_generation:
  type: base
  file_path:
    prefix: "poisson0"

Specifying the list of sampling parameters

The list of parameters to be sampled is specified in the input file under sample_generation/parameter. In the example of examples/poisson/poisson.sample.yml, we sample over one parameter:

sample_generation:
  parameters:
    - key: single_run/poisson0/k
      type: double
      sample_size: 3
      minimum: 2.0
      maximum: 3.0

For each parameter listed, base sample generator creates an 1D uniform grid space between minimum and maximum with the specified sample_size. In sample generation, base sample generator replaces the value of key in the input file, and executes a single-run. Running the main driver with this input file

cd examples/poisson/
../../bin/main -i poisson.sample.yml

executes three single-runs that solve for Poisson equation with a sample value for parameter single_run/poisson0/k.

Technically, any option within the input file can be chosen as a sampling parameter. Currently, however, we only support double and filename type of input options.

If multiple $N$ sampling parameters are listed, then base sample generator creates an $N$-D uniform grid space accordingly. For the $i$-th sampling parameter with sample size $S_i$, we have the total sample size of $$S = \prod_{i=1}^N S_i.$$

Random sampling