pyextal.jaxGeo.config¶
Assembling the OptConfig, and what it will cost.
Functions¶
|
Bounds |
|
The OptConfig for a dataset. |
|
Shares the starting thickness between the layers. |
|
Prints what this beam list implies for time and memory. |
Module Contents¶
- pyextal.jaxGeo.config.window(value, frac)¶
Bounds
fraceither side ofvalue, ordered even ifvalue< 0.
- pyextal.jaxGeo.config.build_config(data, g_include, constants, reflections, settings)¶
The OptConfig for a dataset.
- Parameters:
data (dict) – From jaxGeo.io.load_dataset.
g_include (np.ndarray) – (n_beams, 3) labels of the experimental beam axis.
constants (dict) – From get_bloch_constants.
reflections – From jaxGeo.reflections.select_reflections.
settings (RefineSettings) – Resolved settings. Uses
imag,symmetry,layers,frozen_layers,diagonalise_measured,tile,kernel_radius,voigt,lr,steps,warmupand the three windows.
- Returns:
Ready for setup_optimization_params.
- Return type:
- Raises:
SetupError – If the beam axis does not match the
.dat’s output list.
- pyextal.jaxGeo.config.set_layer_fractions(params, metadata, config, fractions)¶
Shares the starting thickness between the layers.
setup_optimization_params gives every layer
1/nlayersof the thickness; this replaces that withfractions(entrance first, summing to one).- Parameters:
params (dict) – Normalised parameters;
thicknessis replaced.metadata (dict) – Supplies the thickness bounds.
config (OptConfig) – Supplies
thickness_normalize.fractions (sequence) – One per layer.
- Returns:
params, updated in place.- Return type:
dict
- pyextal.jaxGeo.config.report_cost(constants, config, memory_warn=2.0)¶
Prints what this beam list implies for time and memory.
Memory follows
nbeams**2per tilt in flight: the forward model gathers rows of the structure matrix over the whole beam list for each tilt. It evaluates a chunk’s tiltstilt_batchat a time (see jaxEngine.model.batched_forward), so that, not the tile, sets the footprint; a larger tile only wastes less of each chunk on the Voigt margin. Time follows the diagonalised size,ndiag.- Parameters:
constants (dict) – Bloch constants, after setup_optimization_params has filled in
ndiag.config (OptConfig) – The assembled configuration.
memory_warn (float) – Warn above this footprint, GB.
- Returns:
Estimated footprint of the tilts in flight, GB.
- Return type:
float