Initial design
make_initial_design
#
make_initial_design(
*,
parameters: Mapping[str, Parameter],
encoder: ConfigEncoder,
sampler: Literal["sobol", "prior", "uniform"] | Sampler,
sample_size: int | Literal["ndim"] | None = "ndim",
sample_prior_first: bool = True,
seed: Generator | None = None,
constraints_func: (
Callable[[Mapping[str, Any]], float] | None
) = None,
oversampling_factor: int = 1
) -> list[dict[str, Any]]
Generate the initial design of the optimization process.
| PARAMETER | DESCRIPTION |
|---|---|
encoder
|
The encoder to use for encoding/decoding configurations.
TYPE:
|
sampler
|
The sampler to use for the initial design. If set to "sobol", a Sobol sequence will be used. If set to "uniform", a uniform random sampler will be used. If set to "prior", a prior sampler will be used, based on the defaults, and confidence scores of the hyperparameters. If set to a custom sampler, the sampler will be used directly. |
sample_size
|
The number of configurations to sample. If "ndim", the number of configs will be equal to the number of dimensions. If None, no configurations will be sampled. |
sample_prior_first
|
Whether to sample the prior configuration first.
TYPE:
|
seed
|
The seed to use for the random number generation.
TYPE:
|
constraints_func
|
A constraint that is
TYPE:
|
oversampling_factor
|
Draw
TYPE:
|
Source code in scalefm/optimizers/utils/initial_design.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | |