Replace repo contents
Browse files- README.md +0 -3
- README.txt +124 -0
- bundle_integrity.json +59 -0
- config.json +176 -0
- extras/evaluation_scaled_log10_wavelength.safetensors +3 -0
- extras/source_log10_wavelength.safetensors +3 -0
- extras/source_scaled_log10_wavelength.safetensors +3 -0
- extras/source_wavelength.safetensors +3 -0
- fingerprint_evaluation/inputs.safetensors +3 -0
- fingerprint_evaluation/outputs.safetensors +3 -0
- input_domain.safetensors +3 -0
- metadata.json +400 -0
- reference_likelihood.py +279 -0
- reference_scaling_inputs.safetensors +3 -0
- reference_scaling_outputs.safetensors +3 -0
- weights/weights.safetensors +3 -0
README.md
DELETED
|
@@ -1,3 +0,0 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
---
|
|
|
|
|
|
|
|
|
|
|
|
README.txt
ADDED
|
@@ -0,0 +1,124 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Astro Emulators Toolkit Bundle
|
| 2 |
+
|
| 3 |
+
Summary:
|
| 4 |
+
model: transformer_payne
|
| 5 |
+
release: maja-fe-intensity-tpayne-2ch@0.1.0 (released)
|
| 6 |
+
bundle_format_version: 1
|
| 7 |
+
config_schema_version: 1
|
| 8 |
+
spec_version: 1
|
| 9 |
+
weights_layout: params_plus_model_state_v1
|
| 10 |
+
model_family_id: transformer_payne_v1
|
| 11 |
+
fingerprint_evaluation: present
|
| 12 |
+
task: regression
|
| 13 |
+
fit_method: gradient
|
| 14 |
+
solver_params: not provided
|
| 15 |
+
solver_diagnostics: not provided
|
| 16 |
+
solver_design_matrix: not provided
|
| 17 |
+
role_paths: {'output_leaf': 'outputs/flux', 'parameter_leaf': 'inputs/parameters', 'wavelength_leaf': 'inputs/wavelengths'}
|
| 18 |
+
|
| 19 |
+
Domain:
|
| 20 |
+
input_domain: {'kind': 'box_v1', 'max_tree': {'parameters': [7500.0, 5.0, 0.5, 5.0, 0.5, 0.30000001192092896, 0.4000000059604645, 0.4000000059604645, 0.5, 0.5, 1.0], 'wavelengths': 3.7007037171450192}, 'min_tree': {'parameters': [3800.0, 0.0, -2.5, 1.0, -0.20000000298023224, -0.30000001192092896, -0.20000000298023224, -0.20000000298023224, -0.20000000298023224, -0.20000000298023224, 0.1246189996600151], 'wavelengths': 3.6989700043360187}, 'storage': {'filename': 'input_domain.safetensors', 'format': 'safetensors_v1', 'layout': 'split_minmax_tree_v1'}, 'value_space': 'physical_input_dict_tree_v1'}
|
| 21 |
+
reference_scaling_inputs: {'applies_to': 'inputs', 'kind': 'affine_minmax_v1', 'max_tree': {'parameters': [7500.0, 5.0, 0.5, 5.0, 0.5, 0.30000001192092896, 0.4000000059604645, 0.4000000059604645, 0.5, 0.5, 1.0], 'wavelengths': 3.7007037171450192}, 'min_tree': {'parameters': [3800.0, 0.0, -2.5, 1.0, -0.20000000298023224, -0.30000001192092896, -0.20000000298023224, -0.20000000298023224, -0.20000000298023224, -0.20000000298023224, 0.1246189996600151], 'wavelengths': 3.6989700043360187}, 'source_space': 'physical_input_dict_tree_v1', 'storage': {'filename': 'reference_scaling_inputs.safetensors', 'format': 'safetensors_v1', 'layout': 'split_minmax_tree_v1'}, 'target_space': 'canonical_input_dict_tree_v1'}
|
| 22 |
+
reference_scaling_outputs: {'applies_to': 'outputs', 'kind': 'affine_minmax_v1', 'max_tree': {'flux': [7.18308162689209, 7.183245658874512]}, 'min_tree': {'flux': [3.442589521408081, 4.903715133666992]}, 'source_space': 'canonical_output_dict_tree_v1', 'storage': {'filename': 'reference_scaling_outputs.safetensors', 'format': 'safetensors_v1', 'layout': 'split_minmax_tree_v1'}, 'target_space': 'physical_output_dict_tree_v1'}
|
| 23 |
+
extras: ['evaluation_scaled_log10_wavelength', 'notes', 'parameter_source_units', 'preprocessing_recipe', 'source_log10_wavelength', 'source_scaled_log10_wavelength', 'source_store', 'source_wavelength', 'training']
|
| 24 |
+
|
| 25 |
+
Provenance:
|
| 26 |
+
toolkit_version: 0.1.0
|
| 27 |
+
created_at: 2026-04-30T14:19:30.339267+00:00
|
| 28 |
+
python_version: 3.12.13
|
| 29 |
+
git_commit: ef327b5fc0384a358c53b16364c7c0d688bca7ab
|
| 30 |
+
|
| 31 |
+
spec:
|
| 32 |
+
input_domain:
|
| 33 |
+
kind: box_v1
|
| 34 |
+
max_tree:
|
| 35 |
+
parameters:
|
| 36 |
+
array(shape=(11,), dtype=float64)
|
| 37 |
+
wavelengths: 3.7007037171450192
|
| 38 |
+
min_tree:
|
| 39 |
+
parameters:
|
| 40 |
+
array(shape=(11,), dtype=float64)
|
| 41 |
+
wavelengths: 3.6989700043360187
|
| 42 |
+
storage:
|
| 43 |
+
filename: input_domain.safetensors
|
| 44 |
+
format: safetensors_v1
|
| 45 |
+
layout: split_minmax_tree_v1
|
| 46 |
+
value_space: physical_input_dict_tree_v1
|
| 47 |
+
inputs:
|
| 48 |
+
channel_meanings_tree:
|
| 49 |
+
parameters:
|
| 50 |
+
array(shape=(11,), dtype=<U28)
|
| 51 |
+
wavelengths: None
|
| 52 |
+
channel_names_tree:
|
| 53 |
+
parameters:
|
| 54 |
+
array(shape=(11,), dtype=<U6)
|
| 55 |
+
wavelengths: None
|
| 56 |
+
channel_units_tree:
|
| 57 |
+
parameters:
|
| 58 |
+
array(shape=(11,), dtype=<U13)
|
| 59 |
+
wavelengths: None
|
| 60 |
+
leaf_meanings_tree:
|
| 61 |
+
parameters: min-max scaled source-grid parameters; see reference_scaling_inputs for raw parameter bounds
|
| 62 |
+
wavelengths: min-max scaled log10 wavelength; the user applies log10 before reference_scaling_inputs
|
| 63 |
+
leaf_units_tree:
|
| 64 |
+
parameters: None
|
| 65 |
+
wavelengths: dimensionless
|
| 66 |
+
structure_tree:
|
| 67 |
+
parameters: None
|
| 68 |
+
wavelengths: None
|
| 69 |
+
outputs:
|
| 70 |
+
channel_meanings_tree:
|
| 71 |
+
flux:
|
| 72 |
+
- min-max scaled log10 line intensity from source array flux
|
| 73 |
+
- min-max scaled log10 continuum intensity from source array continuum
|
| 74 |
+
channel_names_tree:
|
| 75 |
+
flux:
|
| 76 |
+
- log_flux_lines
|
| 77 |
+
- log_flux_continuum
|
| 78 |
+
channel_units_tree:
|
| 79 |
+
flux:
|
| 80 |
+
- dimensionless
|
| 81 |
+
- dimensionless
|
| 82 |
+
leaf_meanings_tree:
|
| 83 |
+
flux: two min-max scaled log10 intensity channels from the Maja archive arrays flux and continuum
|
| 84 |
+
leaf_units_tree:
|
| 85 |
+
flux: dimensionless
|
| 86 |
+
structure_tree:
|
| 87 |
+
flux: None
|
| 88 |
+
reference_scaling_inputs:
|
| 89 |
+
applies_to: inputs
|
| 90 |
+
kind: affine_minmax_v1
|
| 91 |
+
max_tree:
|
| 92 |
+
parameters:
|
| 93 |
+
array(shape=(11,), dtype=float64)
|
| 94 |
+
wavelengths: 3.7007037171450192
|
| 95 |
+
min_tree:
|
| 96 |
+
parameters:
|
| 97 |
+
array(shape=(11,), dtype=float64)
|
| 98 |
+
wavelengths: 3.6989700043360187
|
| 99 |
+
source_space: physical_input_dict_tree_v1
|
| 100 |
+
storage:
|
| 101 |
+
filename: reference_scaling_inputs.safetensors
|
| 102 |
+
format: safetensors_v1
|
| 103 |
+
layout: split_minmax_tree_v1
|
| 104 |
+
target_space: canonical_input_dict_tree_v1
|
| 105 |
+
reference_scaling_outputs:
|
| 106 |
+
applies_to: outputs
|
| 107 |
+
kind: affine_minmax_v1
|
| 108 |
+
max_tree:
|
| 109 |
+
flux:
|
| 110 |
+
- 7.18308162689209
|
| 111 |
+
- 7.183245658874512
|
| 112 |
+
min_tree:
|
| 113 |
+
flux:
|
| 114 |
+
- 3.442589521408081
|
| 115 |
+
- 4.903715133666992
|
| 116 |
+
source_space: canonical_output_dict_tree_v1
|
| 117 |
+
storage:
|
| 118 |
+
filename: reference_scaling_outputs.safetensors
|
| 119 |
+
format: safetensors_v1
|
| 120 |
+
layout: split_minmax_tree_v1
|
| 121 |
+
target_space: physical_output_dict_tree_v1
|
| 122 |
+
spec_version: 1
|
| 123 |
+
|
| 124 |
+
Note: this bundle is the canonical emulator artifact. Physical-space composition is external.
|
bundle_integrity.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"algorithm": "sha256",
|
| 3 |
+
"bundle_id": "sha256:d513b173bef6a04c84ec026d3d519a86318035c8533e5d362609754d0786a687",
|
| 4 |
+
"integrity_format_version": 1,
|
| 5 |
+
"tree": [
|
| 6 |
+
{
|
| 7 |
+
"path": "README.txt",
|
| 8 |
+
"sha256": "c0daa7e50513d862171fe0a34ac010ad76953da3fa4a2e1b10aceb23f3d32dfa"
|
| 9 |
+
},
|
| 10 |
+
{
|
| 11 |
+
"path": "config.json",
|
| 12 |
+
"sha256": "11108861f43c0b23a073534795b59c6f82670da6a45f356ecacc3cbaf7657797"
|
| 13 |
+
},
|
| 14 |
+
{
|
| 15 |
+
"path": "extras/evaluation_scaled_log10_wavelength.safetensors",
|
| 16 |
+
"sha256": "c00b8e662e97dcd62553c1f13ebf4371cac05933a77fe7165a2600e2e534553d"
|
| 17 |
+
},
|
| 18 |
+
{
|
| 19 |
+
"path": "extras/source_log10_wavelength.safetensors",
|
| 20 |
+
"sha256": "87630d66ddba8749b3262440edcfa486d86ca1bd044070622a7f85a039095bb3"
|
| 21 |
+
},
|
| 22 |
+
{
|
| 23 |
+
"path": "extras/source_scaled_log10_wavelength.safetensors",
|
| 24 |
+
"sha256": "f4dcbe6a3d890917ea442b6e775073b042624b3467ea899260c9883142d58b33"
|
| 25 |
+
},
|
| 26 |
+
{
|
| 27 |
+
"path": "extras/source_wavelength.safetensors",
|
| 28 |
+
"sha256": "32292f9e38853319a5b8e95ff31daa26c1a8e06844542ae436e7cb5155787135"
|
| 29 |
+
},
|
| 30 |
+
{
|
| 31 |
+
"path": "fingerprint_evaluation/inputs.safetensors",
|
| 32 |
+
"sha256": "2a9da53ff7573f8ef84299c6bbb0990fb49346e06ef17acfcf493977228456bc"
|
| 33 |
+
},
|
| 34 |
+
{
|
| 35 |
+
"path": "fingerprint_evaluation/outputs.safetensors",
|
| 36 |
+
"sha256": "b47a7750eea84f2cb71c76576f3768c5cd02c5ea5e19e6ee14149fc7f83a93df"
|
| 37 |
+
},
|
| 38 |
+
{
|
| 39 |
+
"path": "input_domain.safetensors",
|
| 40 |
+
"sha256": "3c641caa7e563613dc40b54822feedc4d0cc16ad90137d6c351129ee96b1b2ca"
|
| 41 |
+
},
|
| 42 |
+
{
|
| 43 |
+
"path": "metadata.json",
|
| 44 |
+
"sha256": "fa05e398dda0d162fe865c87ee6e67b1087323cea884a69924cedece0d7bb05a"
|
| 45 |
+
},
|
| 46 |
+
{
|
| 47 |
+
"path": "reference_scaling_inputs.safetensors",
|
| 48 |
+
"sha256": "3c641caa7e563613dc40b54822feedc4d0cc16ad90137d6c351129ee96b1b2ca"
|
| 49 |
+
},
|
| 50 |
+
{
|
| 51 |
+
"path": "reference_scaling_outputs.safetensors",
|
| 52 |
+
"sha256": "9eaa1947e73b51a122e1dafa8af5a4a07837ee447cb46f791c7c3cc45ddd4530"
|
| 53 |
+
},
|
| 54 |
+
{
|
| 55 |
+
"path": "weights/weights.safetensors",
|
| 56 |
+
"sha256": "33218ec929ee6f6d7957f1afeca3b3fdd804940f98e5119f9e033814ffaa6cca"
|
| 57 |
+
}
|
| 58 |
+
]
|
| 59 |
+
}
|
config.json
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bundle": {
|
| 3 |
+
"bundle_subdir": "bundle"
|
| 4 |
+
},
|
| 5 |
+
"hub": {
|
| 6 |
+
"repo_id": null,
|
| 7 |
+
"revision": null
|
| 8 |
+
},
|
| 9 |
+
"io": {
|
| 10 |
+
"input_domain": null,
|
| 11 |
+
"inputs": {
|
| 12 |
+
"channel_meanings_tree": {
|
| 13 |
+
"parameters": [
|
| 14 |
+
"effective temperature",
|
| 15 |
+
"surface gravity",
|
| 16 |
+
"metallicity [Fe/H]",
|
| 17 |
+
"microturbulence velocity",
|
| 18 |
+
"source-grid parameter [a/Fe]",
|
| 19 |
+
"source-grid parameter [C/Fe]",
|
| 20 |
+
"source-grid parameter [N/Fe]",
|
| 21 |
+
"source-grid parameter [O/Fe]",
|
| 22 |
+
"source-grid parameter [r/Fe]",
|
| 23 |
+
"source-grid parameter [s/Fe]",
|
| 24 |
+
"cosine of viewing angle"
|
| 25 |
+
],
|
| 26 |
+
"wavelengths": null
|
| 27 |
+
},
|
| 28 |
+
"channel_names_tree": {
|
| 29 |
+
"parameters": [
|
| 30 |
+
"teff",
|
| 31 |
+
"logg",
|
| 32 |
+
"[Fe/H]",
|
| 33 |
+
"vmicro",
|
| 34 |
+
"[a/Fe]",
|
| 35 |
+
"[C/Fe]",
|
| 36 |
+
"[N/Fe]",
|
| 37 |
+
"[O/Fe]",
|
| 38 |
+
"[r/Fe]",
|
| 39 |
+
"[s/Fe]",
|
| 40 |
+
"mu"
|
| 41 |
+
],
|
| 42 |
+
"wavelengths": null
|
| 43 |
+
},
|
| 44 |
+
"channel_units_tree": {
|
| 45 |
+
"parameters": [
|
| 46 |
+
"dimensionless",
|
| 47 |
+
"dimensionless",
|
| 48 |
+
"dimensionless",
|
| 49 |
+
"dimensionless",
|
| 50 |
+
"dimensionless",
|
| 51 |
+
"dimensionless",
|
| 52 |
+
"dimensionless",
|
| 53 |
+
"dimensionless",
|
| 54 |
+
"dimensionless",
|
| 55 |
+
"dimensionless",
|
| 56 |
+
"dimensionless"
|
| 57 |
+
],
|
| 58 |
+
"wavelengths": null
|
| 59 |
+
},
|
| 60 |
+
"leaf_meanings_tree": {
|
| 61 |
+
"parameters": "min-max scaled source-grid parameters; see reference_scaling_inputs for raw parameter bounds",
|
| 62 |
+
"wavelengths": "min-max scaled log10 wavelength; the user applies log10 before reference_scaling_inputs"
|
| 63 |
+
},
|
| 64 |
+
"leaf_units_tree": {
|
| 65 |
+
"parameters": null,
|
| 66 |
+
"wavelengths": "dimensionless"
|
| 67 |
+
},
|
| 68 |
+
"structure_tree": {
|
| 69 |
+
"parameters": null,
|
| 70 |
+
"wavelengths": null
|
| 71 |
+
}
|
| 72 |
+
},
|
| 73 |
+
"outputs": {
|
| 74 |
+
"channel_meanings_tree": {
|
| 75 |
+
"flux": [
|
| 76 |
+
"min-max scaled log10 line intensity from source array flux",
|
| 77 |
+
"min-max scaled log10 continuum intensity from source array continuum"
|
| 78 |
+
]
|
| 79 |
+
},
|
| 80 |
+
"channel_names_tree": {
|
| 81 |
+
"flux": [
|
| 82 |
+
"log_flux_lines",
|
| 83 |
+
"log_flux_continuum"
|
| 84 |
+
]
|
| 85 |
+
},
|
| 86 |
+
"channel_units_tree": {
|
| 87 |
+
"flux": [
|
| 88 |
+
"dimensionless",
|
| 89 |
+
"dimensionless"
|
| 90 |
+
]
|
| 91 |
+
},
|
| 92 |
+
"leaf_meanings_tree": {
|
| 93 |
+
"flux": "two min-max scaled log10 intensity channels from the Maja archive arrays flux and continuum"
|
| 94 |
+
},
|
| 95 |
+
"leaf_units_tree": {
|
| 96 |
+
"flux": "dimensionless"
|
| 97 |
+
},
|
| 98 |
+
"structure_tree": {
|
| 99 |
+
"flux": null
|
| 100 |
+
}
|
| 101 |
+
},
|
| 102 |
+
"reference_scaling_inputs": null,
|
| 103 |
+
"reference_scaling_outputs": null
|
| 104 |
+
},
|
| 105 |
+
"model": {
|
| 106 |
+
"init_hints": {
|
| 107 |
+
"parameter_dim": 11
|
| 108 |
+
},
|
| 109 |
+
"name": "transformer_payne",
|
| 110 |
+
"params": {
|
| 111 |
+
"channels": 2,
|
| 112 |
+
"dim": 64,
|
| 113 |
+
"dim_ff_multiplier": 4,
|
| 114 |
+
"dim_head": 32,
|
| 115 |
+
"dtype": "float32",
|
| 116 |
+
"max_period": 1.0,
|
| 117 |
+
"min_period": 0.0001,
|
| 118 |
+
"no_layers": 4,
|
| 119 |
+
"no_tokens": 8
|
| 120 |
+
}
|
| 121 |
+
},
|
| 122 |
+
"optim": {
|
| 123 |
+
"b1": 0.9,
|
| 124 |
+
"b2": 0.999,
|
| 125 |
+
"decay_steps": 0,
|
| 126 |
+
"eps": 1e-08,
|
| 127 |
+
"grad_clip": 0.0,
|
| 128 |
+
"lr": 0.003,
|
| 129 |
+
"lr_scaling": null,
|
| 130 |
+
"name": "soap",
|
| 131 |
+
"precondition_1d": false,
|
| 132 |
+
"precondition_frequency": 10,
|
| 133 |
+
"scale_embedding_lr": 1.0,
|
| 134 |
+
"schedule": "cosine",
|
| 135 |
+
"warmup_steps": 1000,
|
| 136 |
+
"weight_decay": 1e-05
|
| 137 |
+
},
|
| 138 |
+
"schema_version": 1,
|
| 139 |
+
"seed": 0,
|
| 140 |
+
"solver": {
|
| 141 |
+
"name": "auto",
|
| 142 |
+
"params": {}
|
| 143 |
+
},
|
| 144 |
+
"task": {
|
| 145 |
+
"name": "regression",
|
| 146 |
+
"params": {
|
| 147 |
+
"loss": "mse",
|
| 148 |
+
"metric_axes": {
|
| 149 |
+
"channel": [
|
| 150 |
+
0
|
| 151 |
+
],
|
| 152 |
+
"global": "all"
|
| 153 |
+
},
|
| 154 |
+
"metrics": [
|
| 155 |
+
"mse",
|
| 156 |
+
"mae"
|
| 157 |
+
]
|
| 158 |
+
}
|
| 159 |
+
},
|
| 160 |
+
"training": {
|
| 161 |
+
"batch_size": 128,
|
| 162 |
+
"checkpoint_interval_steps": 1000,
|
| 163 |
+
"checkpoint_steps": null,
|
| 164 |
+
"evaluation_interval_steps": 500,
|
| 165 |
+
"evaluation_steps": null,
|
| 166 |
+
"logging_interval_steps": 100,
|
| 167 |
+
"logging_steps": null,
|
| 168 |
+
"max_saved_checkpoints": 5,
|
| 169 |
+
"num_steps": 10000,
|
| 170 |
+
"shuffle": true,
|
| 171 |
+
"shuffle_seed": 0,
|
| 172 |
+
"steps_per_epoch": null,
|
| 173 |
+
"val_fraction": 0.0,
|
| 174 |
+
"workdir": "./runs/from_bundle"
|
| 175 |
+
}
|
| 176 |
+
}
|
extras/evaluation_scaled_log10_wavelength.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:c00b8e662e97dcd62553c1f13ebf4371cac05933a77fe7165a2600e2e534553d
|
| 3 |
+
size 4168
|
extras/source_log10_wavelength.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:87630d66ddba8749b3262440edcfa486d86ca1bd044070622a7f85a039095bb3
|
| 3 |
+
size 16088
|
extras/source_scaled_log10_wavelength.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:f4dcbe6a3d890917ea442b6e775073b042624b3467ea899260c9883142d58b33
|
| 3 |
+
size 16088
|
extras/source_wavelength.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:32292f9e38853319a5b8e95ff31daa26c1a8e06844542ae436e7cb5155787135
|
| 3 |
+
size 16088
|
fingerprint_evaluation/inputs.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:2a9da53ff7573f8ef84299c6bbb0990fb49346e06ef17acfcf493977228456bc
|
| 3 |
+
size 240
|
fingerprint_evaluation/outputs.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:b47a7750eea84f2cb71c76576f3768c5cd02c5ea5e19e6ee14149fc7f83a93df
|
| 3 |
+
size 80
|
input_domain.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3c641caa7e563613dc40b54822feedc4d0cc16ad90137d6c351129ee96b1b2ca
|
| 3 |
+
size 480
|
metadata.json
ADDED
|
@@ -0,0 +1,400 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"bundle_format_version": 1,
|
| 3 |
+
"config_schema_version": 1,
|
| 4 |
+
"extras": {
|
| 5 |
+
"evaluation_scaled_log10_wavelength": {
|
| 6 |
+
"__aet_sidecar__": {
|
| 7 |
+
"format": "safetensors_v1",
|
| 8 |
+
"layout": "single_array_v1",
|
| 9 |
+
"path": "extras/evaluation_scaled_log10_wavelength.safetensors"
|
| 10 |
+
}
|
| 11 |
+
},
|
| 12 |
+
"notes": "The source array named 'flux' is treated as line intensity. The source array 'continuum' is treated as continuum intensity. The bundle records min-max scaling metadata; log10 transforms for wavelengths and outputs are explicit user-side preprocessing.",
|
| 13 |
+
"parameter_source_units": {
|
| 14 |
+
"[C/Fe]": "",
|
| 15 |
+
"[Fe/H]": "dex",
|
| 16 |
+
"[N/Fe]": "",
|
| 17 |
+
"[O/Fe]": "",
|
| 18 |
+
"[a/Fe]": "",
|
| 19 |
+
"[r/Fe]": "",
|
| 20 |
+
"[s/Fe]": "",
|
| 21 |
+
"logg": "dex",
|
| 22 |
+
"mu": "dimensionless",
|
| 23 |
+
"teff": "K",
|
| 24 |
+
"vmicro": "km/s"
|
| 25 |
+
},
|
| 26 |
+
"preprocessing_recipe": {
|
| 27 |
+
"outputs": "The model predicts min-max scaled log10 flux and min-max scaled log10 continuum. Invert the min-max transform first; apply 10**y outside the bundle if physical intensities are needed.",
|
| 28 |
+
"parameters": "Scale raw parameter vector with (x - parameter_min) / (parameter_max - parameter_min).",
|
| 29 |
+
"wavelengths": "Apply log10 to physical wavelength first, then min-max scale with the log10_wavelength bounds."
|
| 30 |
+
},
|
| 31 |
+
"source_log10_wavelength": {
|
| 32 |
+
"__aet_sidecar__": {
|
| 33 |
+
"format": "safetensors_v1",
|
| 34 |
+
"layout": "single_array_v1",
|
| 35 |
+
"path": "extras/source_log10_wavelength.safetensors"
|
| 36 |
+
}
|
| 37 |
+
},
|
| 38 |
+
"source_scaled_log10_wavelength": {
|
| 39 |
+
"__aet_sidecar__": {
|
| 40 |
+
"format": "safetensors_v1",
|
| 41 |
+
"layout": "single_array_v1",
|
| 42 |
+
"path": "extras/source_scaled_log10_wavelength.safetensors"
|
| 43 |
+
}
|
| 44 |
+
},
|
| 45 |
+
"source_store": "/Users/tr/data/turbo_spectrum_maja_grids/fe-intensity-20000.zarr",
|
| 46 |
+
"source_wavelength": {
|
| 47 |
+
"__aet_sidecar__": {
|
| 48 |
+
"format": "safetensors_v1",
|
| 49 |
+
"layout": "single_array_v1",
|
| 50 |
+
"path": "extras/source_wavelength.safetensors"
|
| 51 |
+
}
|
| 52 |
+
},
|
| 53 |
+
"training": {
|
| 54 |
+
"dataset_output_keys": [
|
| 55 |
+
"lines",
|
| 56 |
+
"continuum"
|
| 57 |
+
],
|
| 58 |
+
"model_output_channel_names": [
|
| 59 |
+
"log_flux_lines",
|
| 60 |
+
"log_flux_continuum"
|
| 61 |
+
],
|
| 62 |
+
"n_training_samples": 18000,
|
| 63 |
+
"n_validation_samples": 2000,
|
| 64 |
+
"n_wavelength_per_step": 512,
|
| 65 |
+
"validation_policy": "first 10.0% of spectra by source index"
|
| 66 |
+
}
|
| 67 |
+
},
|
| 68 |
+
"fingerprint_evaluation": {
|
| 69 |
+
"atol": 1e-07,
|
| 70 |
+
"inputs": {
|
| 71 |
+
"filename": "fingerprint_evaluation/inputs.safetensors",
|
| 72 |
+
"format": "safetensors_v1",
|
| 73 |
+
"layout": "numeric_dict_tree_v1",
|
| 74 |
+
"space": "canonical_input_dict_trees_v1"
|
| 75 |
+
},
|
| 76 |
+
"kind": "canonical_inputs_outputs_v1",
|
| 77 |
+
"outputs": {
|
| 78 |
+
"filename": "fingerprint_evaluation/outputs.safetensors",
|
| 79 |
+
"format": "safetensors_v1",
|
| 80 |
+
"layout": "numeric_dict_tree_v1",
|
| 81 |
+
"space": "canonical_output_dict_trees_v1"
|
| 82 |
+
},
|
| 83 |
+
"rtol": 1e-05,
|
| 84 |
+
"selection_strategy": "midpoint_from_input_domain_then_reference_scaling_inputs_v1"
|
| 85 |
+
},
|
| 86 |
+
"fit_method": "gradient",
|
| 87 |
+
"model_family_id": "transformer_payne_v1",
|
| 88 |
+
"model_init": {
|
| 89 |
+
"hints": {
|
| 90 |
+
"parameter_dim": 11
|
| 91 |
+
},
|
| 92 |
+
"representation": "model-local init hints only"
|
| 93 |
+
},
|
| 94 |
+
"provenance": {
|
| 95 |
+
"created_at": "2026-04-30T14:19:30.339267+00:00",
|
| 96 |
+
"dependencies": {
|
| 97 |
+
"flax": "0.12.6",
|
| 98 |
+
"jax": "0.9.2",
|
| 99 |
+
"numpy": "2.4.4",
|
| 100 |
+
"optax": "0.2.8"
|
| 101 |
+
},
|
| 102 |
+
"git_commit": "ef327b5fc0384a358c53b16364c7c0d688bca7ab",
|
| 103 |
+
"platform": "macOS-26.4.1-arm64-arm-64bit",
|
| 104 |
+
"python_version": "3.12.13",
|
| 105 |
+
"toolkit": "astro_emulators_toolkit",
|
| 106 |
+
"toolkit_version": "0.1.0"
|
| 107 |
+
},
|
| 108 |
+
"release": {
|
| 109 |
+
"name": "maja-fe-intensity-tpayne-2ch",
|
| 110 |
+
"status": "released",
|
| 111 |
+
"version": "0.1.0"
|
| 112 |
+
},
|
| 113 |
+
"resolved": {
|
| 114 |
+
"model": {
|
| 115 |
+
"name": "transformer_payne",
|
| 116 |
+
"params": {
|
| 117 |
+
"activation": "gelu",
|
| 118 |
+
"alpha_att": 1.0,
|
| 119 |
+
"alpha_emb": 1.0,
|
| 120 |
+
"bias_attention": false,
|
| 121 |
+
"bias_dense": false,
|
| 122 |
+
"bias_feed_forward": null,
|
| 123 |
+
"bias_output_head": null,
|
| 124 |
+
"bias_parameter_embedding": null,
|
| 125 |
+
"channels": 2,
|
| 126 |
+
"dim": 64,
|
| 127 |
+
"dim_ff_multiplier": 4,
|
| 128 |
+
"dim_head": 32,
|
| 129 |
+
"dtype": "float32",
|
| 130 |
+
"emb_init": "si",
|
| 131 |
+
"ff_init": "si",
|
| 132 |
+
"head_init": "si",
|
| 133 |
+
"init_att_o": "si",
|
| 134 |
+
"init_att_q": "si",
|
| 135 |
+
"max_period": 1.0,
|
| 136 |
+
"min_period": 0.0001,
|
| 137 |
+
"no_layers": 4,
|
| 138 |
+
"no_tokens": 8,
|
| 139 |
+
"output_activation": "linear",
|
| 140 |
+
"reference_depth": null,
|
| 141 |
+
"reference_width": null,
|
| 142 |
+
"sigma": 1.0
|
| 143 |
+
}
|
| 144 |
+
},
|
| 145 |
+
"solver": {
|
| 146 |
+
"name": "gradient",
|
| 147 |
+
"params": {}
|
| 148 |
+
},
|
| 149 |
+
"task": {
|
| 150 |
+
"name": "regression",
|
| 151 |
+
"params": {
|
| 152 |
+
"loss": "mse",
|
| 153 |
+
"loss_weights": null,
|
| 154 |
+
"metric_axes": {
|
| 155 |
+
"channel": [
|
| 156 |
+
0
|
| 157 |
+
],
|
| 158 |
+
"global": "all"
|
| 159 |
+
},
|
| 160 |
+
"metrics": [
|
| 161 |
+
"mse",
|
| 162 |
+
"mae"
|
| 163 |
+
]
|
| 164 |
+
}
|
| 165 |
+
}
|
| 166 |
+
},
|
| 167 |
+
"runtime_contract": {
|
| 168 |
+
"affine_leaf_specs": {
|
| 169 |
+
"inputs/parameters": {
|
| 170 |
+
"last_axis": 11,
|
| 171 |
+
"mode": "scalar_or_last_axis"
|
| 172 |
+
},
|
| 173 |
+
"inputs/wavelengths": {
|
| 174 |
+
"mode": "scalar_only"
|
| 175 |
+
},
|
| 176 |
+
"outputs/flux": {
|
| 177 |
+
"last_axis": 2,
|
| 178 |
+
"mode": "scalar_or_last_axis"
|
| 179 |
+
}
|
| 180 |
+
},
|
| 181 |
+
"role_paths": {
|
| 182 |
+
"output_leaf": "outputs/flux",
|
| 183 |
+
"parameter_leaf": "inputs/parameters",
|
| 184 |
+
"wavelength_leaf": "inputs/wavelengths"
|
| 185 |
+
},
|
| 186 |
+
"surface": "canonical_dict_trees_v1",
|
| 187 |
+
"transformer_payne_channels": [
|
| 188 |
+
{
|
| 189 |
+
"dataset_key": "lines",
|
| 190 |
+
"name": "log_flux_lines"
|
| 191 |
+
},
|
| 192 |
+
{
|
| 193 |
+
"dataset_key": "continuum",
|
| 194 |
+
"name": "log_flux_continuum"
|
| 195 |
+
}
|
| 196 |
+
]
|
| 197 |
+
},
|
| 198 |
+
"spec": {
|
| 199 |
+
"input_domain": {
|
| 200 |
+
"kind": "box_v1",
|
| 201 |
+
"max_tree": {
|
| 202 |
+
"parameters": [
|
| 203 |
+
7500.0,
|
| 204 |
+
5.0,
|
| 205 |
+
0.5,
|
| 206 |
+
5.0,
|
| 207 |
+
0.5,
|
| 208 |
+
0.30000001192092896,
|
| 209 |
+
0.4000000059604645,
|
| 210 |
+
0.4000000059604645,
|
| 211 |
+
0.5,
|
| 212 |
+
0.5,
|
| 213 |
+
1.0
|
| 214 |
+
],
|
| 215 |
+
"wavelengths": 3.7007037171450192
|
| 216 |
+
},
|
| 217 |
+
"min_tree": {
|
| 218 |
+
"parameters": [
|
| 219 |
+
3800.0,
|
| 220 |
+
0.0,
|
| 221 |
+
-2.5,
|
| 222 |
+
1.0,
|
| 223 |
+
-0.20000000298023224,
|
| 224 |
+
-0.30000001192092896,
|
| 225 |
+
-0.20000000298023224,
|
| 226 |
+
-0.20000000298023224,
|
| 227 |
+
-0.20000000298023224,
|
| 228 |
+
-0.20000000298023224,
|
| 229 |
+
0.1246189996600151
|
| 230 |
+
],
|
| 231 |
+
"wavelengths": 3.6989700043360187
|
| 232 |
+
},
|
| 233 |
+
"storage": {
|
| 234 |
+
"filename": "input_domain.safetensors",
|
| 235 |
+
"format": "safetensors_v1",
|
| 236 |
+
"layout": "split_minmax_tree_v1"
|
| 237 |
+
},
|
| 238 |
+
"value_space": "physical_input_dict_tree_v1"
|
| 239 |
+
},
|
| 240 |
+
"inputs": {
|
| 241 |
+
"channel_meanings_tree": {
|
| 242 |
+
"parameters": [
|
| 243 |
+
"effective temperature",
|
| 244 |
+
"surface gravity",
|
| 245 |
+
"metallicity [Fe/H]",
|
| 246 |
+
"microturbulence velocity",
|
| 247 |
+
"source-grid parameter [a/Fe]",
|
| 248 |
+
"source-grid parameter [C/Fe]",
|
| 249 |
+
"source-grid parameter [N/Fe]",
|
| 250 |
+
"source-grid parameter [O/Fe]",
|
| 251 |
+
"source-grid parameter [r/Fe]",
|
| 252 |
+
"source-grid parameter [s/Fe]",
|
| 253 |
+
"cosine of viewing angle"
|
| 254 |
+
],
|
| 255 |
+
"wavelengths": null
|
| 256 |
+
},
|
| 257 |
+
"channel_names_tree": {
|
| 258 |
+
"parameters": [
|
| 259 |
+
"teff",
|
| 260 |
+
"logg",
|
| 261 |
+
"[Fe/H]",
|
| 262 |
+
"vmicro",
|
| 263 |
+
"[a/Fe]",
|
| 264 |
+
"[C/Fe]",
|
| 265 |
+
"[N/Fe]",
|
| 266 |
+
"[O/Fe]",
|
| 267 |
+
"[r/Fe]",
|
| 268 |
+
"[s/Fe]",
|
| 269 |
+
"mu"
|
| 270 |
+
],
|
| 271 |
+
"wavelengths": null
|
| 272 |
+
},
|
| 273 |
+
"channel_units_tree": {
|
| 274 |
+
"parameters": [
|
| 275 |
+
"dimensionless",
|
| 276 |
+
"dimensionless",
|
| 277 |
+
"dimensionless",
|
| 278 |
+
"dimensionless",
|
| 279 |
+
"dimensionless",
|
| 280 |
+
"dimensionless",
|
| 281 |
+
"dimensionless",
|
| 282 |
+
"dimensionless",
|
| 283 |
+
"dimensionless",
|
| 284 |
+
"dimensionless",
|
| 285 |
+
"dimensionless"
|
| 286 |
+
],
|
| 287 |
+
"wavelengths": null
|
| 288 |
+
},
|
| 289 |
+
"leaf_meanings_tree": {
|
| 290 |
+
"parameters": "min-max scaled source-grid parameters; see reference_scaling_inputs for raw parameter bounds",
|
| 291 |
+
"wavelengths": "min-max scaled log10 wavelength; the user applies log10 before reference_scaling_inputs"
|
| 292 |
+
},
|
| 293 |
+
"leaf_units_tree": {
|
| 294 |
+
"parameters": null,
|
| 295 |
+
"wavelengths": "dimensionless"
|
| 296 |
+
},
|
| 297 |
+
"structure_tree": {
|
| 298 |
+
"parameters": null,
|
| 299 |
+
"wavelengths": null
|
| 300 |
+
}
|
| 301 |
+
},
|
| 302 |
+
"outputs": {
|
| 303 |
+
"channel_meanings_tree": {
|
| 304 |
+
"flux": [
|
| 305 |
+
"min-max scaled log10 line intensity from source array flux",
|
| 306 |
+
"min-max scaled log10 continuum intensity from source array continuum"
|
| 307 |
+
]
|
| 308 |
+
},
|
| 309 |
+
"channel_names_tree": {
|
| 310 |
+
"flux": [
|
| 311 |
+
"log_flux_lines",
|
| 312 |
+
"log_flux_continuum"
|
| 313 |
+
]
|
| 314 |
+
},
|
| 315 |
+
"channel_units_tree": {
|
| 316 |
+
"flux": [
|
| 317 |
+
"dimensionless",
|
| 318 |
+
"dimensionless"
|
| 319 |
+
]
|
| 320 |
+
},
|
| 321 |
+
"leaf_meanings_tree": {
|
| 322 |
+
"flux": "two min-max scaled log10 intensity channels from the Maja archive arrays flux and continuum"
|
| 323 |
+
},
|
| 324 |
+
"leaf_units_tree": {
|
| 325 |
+
"flux": "dimensionless"
|
| 326 |
+
},
|
| 327 |
+
"structure_tree": {
|
| 328 |
+
"flux": null
|
| 329 |
+
}
|
| 330 |
+
},
|
| 331 |
+
"reference_scaling_inputs": {
|
| 332 |
+
"applies_to": "inputs",
|
| 333 |
+
"kind": "affine_minmax_v1",
|
| 334 |
+
"max_tree": {
|
| 335 |
+
"parameters": [
|
| 336 |
+
7500.0,
|
| 337 |
+
5.0,
|
| 338 |
+
0.5,
|
| 339 |
+
5.0,
|
| 340 |
+
0.5,
|
| 341 |
+
0.30000001192092896,
|
| 342 |
+
0.4000000059604645,
|
| 343 |
+
0.4000000059604645,
|
| 344 |
+
0.5,
|
| 345 |
+
0.5,
|
| 346 |
+
1.0
|
| 347 |
+
],
|
| 348 |
+
"wavelengths": 3.7007037171450192
|
| 349 |
+
},
|
| 350 |
+
"min_tree": {
|
| 351 |
+
"parameters": [
|
| 352 |
+
3800.0,
|
| 353 |
+
0.0,
|
| 354 |
+
-2.5,
|
| 355 |
+
1.0,
|
| 356 |
+
-0.20000000298023224,
|
| 357 |
+
-0.30000001192092896,
|
| 358 |
+
-0.20000000298023224,
|
| 359 |
+
-0.20000000298023224,
|
| 360 |
+
-0.20000000298023224,
|
| 361 |
+
-0.20000000298023224,
|
| 362 |
+
0.1246189996600151
|
| 363 |
+
],
|
| 364 |
+
"wavelengths": 3.6989700043360187
|
| 365 |
+
},
|
| 366 |
+
"source_space": "physical_input_dict_tree_v1",
|
| 367 |
+
"storage": {
|
| 368 |
+
"filename": "reference_scaling_inputs.safetensors",
|
| 369 |
+
"format": "safetensors_v1",
|
| 370 |
+
"layout": "split_minmax_tree_v1"
|
| 371 |
+
},
|
| 372 |
+
"target_space": "canonical_input_dict_tree_v1"
|
| 373 |
+
},
|
| 374 |
+
"reference_scaling_outputs": {
|
| 375 |
+
"applies_to": "outputs",
|
| 376 |
+
"kind": "affine_minmax_v1",
|
| 377 |
+
"max_tree": {
|
| 378 |
+
"flux": [
|
| 379 |
+
7.18308162689209,
|
| 380 |
+
7.183245658874512
|
| 381 |
+
]
|
| 382 |
+
},
|
| 383 |
+
"min_tree": {
|
| 384 |
+
"flux": [
|
| 385 |
+
3.442589521408081,
|
| 386 |
+
4.903715133666992
|
| 387 |
+
]
|
| 388 |
+
},
|
| 389 |
+
"source_space": "canonical_output_dict_tree_v1",
|
| 390 |
+
"storage": {
|
| 391 |
+
"filename": "reference_scaling_outputs.safetensors",
|
| 392 |
+
"format": "safetensors_v1",
|
| 393 |
+
"layout": "split_minmax_tree_v1"
|
| 394 |
+
},
|
| 395 |
+
"target_space": "physical_output_dict_tree_v1"
|
| 396 |
+
},
|
| 397 |
+
"spec_version": 1
|
| 398 |
+
},
|
| 399 |
+
"weights_layout": "params_plus_model_state_v1"
|
| 400 |
+
}
|
reference_likelihood.py
ADDED
|
@@ -0,0 +1,279 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Quickstart: Gaussian likelihood for Maja log10 intensity spectra.
|
| 2 |
+
|
| 3 |
+
This compact reference script is meant to travel with the released bundle. It
|
| 4 |
+
uses only bundle metadata, weights, and extras; it does not require the original
|
| 5 |
+
Zarr training archive.
|
| 6 |
+
|
| 7 |
+
The pattern is:
|
| 8 |
+
|
| 9 |
+
1. load the local bundle with ``Emulator.from_bundle(...)``;
|
| 10 |
+
2. freeze a JAX callable with ``make_frozen_apply(jit=False)``;
|
| 11 |
+
3. explicitly transform physical parameters and log10 wavelengths into the
|
| 12 |
+
bundle's canonical min-max space;
|
| 13 |
+
4. explicitly denormalize canonical outputs back to log10 intensities;
|
| 14 |
+
5. evaluate a simple diagonal Gaussian log likelihood in one outer jit.
|
| 15 |
+
|
| 16 |
+
Inputs are the 11 source-grid parameters recorded in bundle metadata and a
|
| 17 |
+
physical wavelength vector. Wavelengths are converted to log10 before the
|
| 18 |
+
bundle's input min-max normalization, matching the training script.
|
| 19 |
+
|
| 20 |
+
The output leaf is ``flux`` with two channels:
|
| 21 |
+
|
| 22 |
+
- ``log_flux_lines``: log10 line intensity from the source array named ``flux``;
|
| 23 |
+
- ``log_flux_continuum``: log10 continuum intensity.
|
| 24 |
+
|
| 25 |
+
Replace the synthetic ``observed_log10`` vector below with your measured or
|
| 26 |
+
simulated log10 intensity data and uncertainties.
|
| 27 |
+
"""
|
| 28 |
+
|
| 29 |
+
from __future__ import annotations
|
| 30 |
+
|
| 31 |
+
import argparse
|
| 32 |
+
import os
|
| 33 |
+
from pathlib import Path
|
| 34 |
+
|
| 35 |
+
os.environ.setdefault("JAX_ENABLE_X64", "1")
|
| 36 |
+
os.environ.setdefault("MPLCONFIGDIR", "/private/tmp/matplotlib")
|
| 37 |
+
|
| 38 |
+
import jax
|
| 39 |
+
import jax.numpy as jnp
|
| 40 |
+
import numpy as np
|
| 41 |
+
|
| 42 |
+
from astro_emulators_toolkit import Emulator, denormalize_tree, normalize_tree
|
| 43 |
+
|
| 44 |
+
BUNDLE_DIR = Path(__file__).resolve().parent
|
| 45 |
+
OUTPUT_LEAF = "flux"
|
| 46 |
+
OUTPUT_CHANNELS = ("log_flux_lines", "log_flux_continuum")
|
| 47 |
+
N_LIKELIHOOD_WAVELENGTHS = 1_000
|
| 48 |
+
SIGMA_LOG10_INTENSITY = 0.02
|
| 49 |
+
NOISE_SEED = 0
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def _as_float_array(value) -> np.ndarray:
|
| 53 |
+
return np.asarray(value, dtype=np.float32)
|
| 54 |
+
|
| 55 |
+
|
| 56 |
+
def _parameter_names(emu: Emulator) -> tuple[str, ...]:
|
| 57 |
+
inputs = emu.input_spec or {}
|
| 58 |
+
channel_tree = inputs.get("channel_names_tree")
|
| 59 |
+
if isinstance(channel_tree, dict):
|
| 60 |
+
names = channel_tree.get("parameters")
|
| 61 |
+
if isinstance(names, (list, tuple)):
|
| 62 |
+
return tuple(str(name) for name in names)
|
| 63 |
+
ref_inputs = emu.reference_scaling_inputs
|
| 64 |
+
if ref_inputs is None:
|
| 65 |
+
return ()
|
| 66 |
+
n_params = int(np.asarray(ref_inputs["min_tree"]["parameters"]).shape[-1])
|
| 67 |
+
return tuple(f"parameter_{i}" for i in range(n_params))
|
| 68 |
+
|
| 69 |
+
|
| 70 |
+
def _midpoint_physical_parameters(emu: Emulator) -> np.ndarray:
|
| 71 |
+
ref_inputs = emu.reference_scaling_inputs
|
| 72 |
+
if ref_inputs is None:
|
| 73 |
+
raise ValueError("Bundle is missing reference_scaling_inputs metadata.")
|
| 74 |
+
lo = _as_float_array(ref_inputs["min_tree"]["parameters"])
|
| 75 |
+
hi = _as_float_array(ref_inputs["max_tree"]["parameters"])
|
| 76 |
+
return ((lo + hi) * 0.5).astype(np.float32)
|
| 77 |
+
|
| 78 |
+
|
| 79 |
+
def _select_wavelengths(emu: Emulator, *, n_wavelength: int) -> np.ndarray:
|
| 80 |
+
if n_wavelength <= 0:
|
| 81 |
+
raise ValueError(f"n_wavelength must be positive, got {n_wavelength}")
|
| 82 |
+
|
| 83 |
+
extras = emu.bundle_extras
|
| 84 |
+
source = extras.get("source_wavelength")
|
| 85 |
+
if source is None:
|
| 86 |
+
ref_inputs = emu.reference_scaling_inputs
|
| 87 |
+
if ref_inputs is None:
|
| 88 |
+
raise ValueError(
|
| 89 |
+
"Bundle is missing both extras['source_wavelength'] and "
|
| 90 |
+
"reference_scaling_inputs metadata."
|
| 91 |
+
)
|
| 92 |
+
log_lo = float(ref_inputs["min_tree"]["wavelengths"])
|
| 93 |
+
log_hi = float(ref_inputs["max_tree"]["wavelengths"])
|
| 94 |
+
return np.power(
|
| 95 |
+
10.0,
|
| 96 |
+
np.linspace(log_lo, log_hi, n_wavelength, dtype=np.float32),
|
| 97 |
+
).astype(np.float32)
|
| 98 |
+
|
| 99 |
+
wave = _as_float_array(source)
|
| 100 |
+
if wave.ndim != 1:
|
| 101 |
+
raise ValueError(f"extras['source_wavelength'] must be 1D, got {wave.shape}")
|
| 102 |
+
n = min(n_wavelength, int(wave.shape[0]))
|
| 103 |
+
indices = np.linspace(0, wave.shape[0] - 1, num=n, dtype=np.int32)
|
| 104 |
+
return wave[indices].astype(np.float32)
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def _show_plot(
|
| 108 |
+
*,
|
| 109 |
+
wavelength: np.ndarray,
|
| 110 |
+
model_log10: np.ndarray,
|
| 111 |
+
observed_log10: np.ndarray,
|
| 112 |
+
) -> None:
|
| 113 |
+
import matplotlib.pyplot as plt
|
| 114 |
+
|
| 115 |
+
fig, axes = plt.subplots(2, 2, figsize=(13, 7), sharex=True)
|
| 116 |
+
ax_lines, ax_cont = axes[0]
|
| 117 |
+
ax_lines_resid, ax_cont_resid = axes[1]
|
| 118 |
+
|
| 119 |
+
for channel, name, ax, ax_resid in (
|
| 120 |
+
(0, OUTPUT_CHANNELS[0], ax_lines, ax_lines_resid),
|
| 121 |
+
(1, OUTPUT_CHANNELS[1], ax_cont, ax_cont_resid),
|
| 122 |
+
):
|
| 123 |
+
ax.plot(wavelength, model_log10[:, channel], label="model", lw=1.2)
|
| 124 |
+
ax.scatter(
|
| 125 |
+
wavelength,
|
| 126 |
+
observed_log10[:, channel],
|
| 127 |
+
label="observed + Gaussian noise",
|
| 128 |
+
s=4,
|
| 129 |
+
alpha=0.45,
|
| 130 |
+
linewidths=0,
|
| 131 |
+
)
|
| 132 |
+
ax.set_title(name)
|
| 133 |
+
ax.set_ylabel("log10 intensity")
|
| 134 |
+
ax.grid(alpha=0.25)
|
| 135 |
+
ax.legend()
|
| 136 |
+
|
| 137 |
+
ax_resid.scatter(
|
| 138 |
+
wavelength,
|
| 139 |
+
observed_log10[:, channel] - model_log10[:, channel],
|
| 140 |
+
s=4,
|
| 141 |
+
alpha=0.55,
|
| 142 |
+
linewidths=0,
|
| 143 |
+
)
|
| 144 |
+
ax_resid.axhline(0.0, color="0.45", lw=0.8, ls="--")
|
| 145 |
+
ax_resid.set_xlabel("Wavelength")
|
| 146 |
+
ax_resid.set_ylabel("observed - model")
|
| 147 |
+
ax_resid.grid(alpha=0.25)
|
| 148 |
+
|
| 149 |
+
fig.suptitle("Maja intensity reference likelihood")
|
| 150 |
+
fig.tight_layout()
|
| 151 |
+
plt.show()
|
| 152 |
+
|
| 153 |
+
|
| 154 |
+
def parse_args() -> argparse.Namespace:
|
| 155 |
+
parser = argparse.ArgumentParser(
|
| 156 |
+
formatter_class=argparse.ArgumentDefaultsHelpFormatter
|
| 157 |
+
)
|
| 158 |
+
parser.add_argument(
|
| 159 |
+
"--show",
|
| 160 |
+
action="store_true",
|
| 161 |
+
help="Show an interactive plot of model, noisy observation, and residuals.",
|
| 162 |
+
)
|
| 163 |
+
parser.add_argument(
|
| 164 |
+
"--n-wavelength",
|
| 165 |
+
type=int,
|
| 166 |
+
default=N_LIKELIHOOD_WAVELENGTHS,
|
| 167 |
+
help="Number of wavelength points to evaluate and plot.",
|
| 168 |
+
)
|
| 169 |
+
parser.add_argument(
|
| 170 |
+
"--sigma-log10",
|
| 171 |
+
type=float,
|
| 172 |
+
default=SIGMA_LOG10_INTENSITY,
|
| 173 |
+
help="Gaussian noise standard deviation in log10 intensity units.",
|
| 174 |
+
)
|
| 175 |
+
parser.add_argument(
|
| 176 |
+
"--noise-seed",
|
| 177 |
+
type=int,
|
| 178 |
+
default=NOISE_SEED,
|
| 179 |
+
help="Random seed for the synthetic Gaussian observation noise.",
|
| 180 |
+
)
|
| 181 |
+
return parser.parse_args()
|
| 182 |
+
|
| 183 |
+
|
| 184 |
+
def main() -> None:
|
| 185 |
+
args = parse_args()
|
| 186 |
+
emu = Emulator.from_bundle(BUNDLE_DIR, verbose=True)
|
| 187 |
+
apply_intensity = emu.make_frozen_apply(jit=False)
|
| 188 |
+
|
| 189 |
+
ref_inputs = emu.reference_scaling_inputs
|
| 190 |
+
ref_outputs = emu.reference_scaling_outputs
|
| 191 |
+
if ref_inputs is None or ref_outputs is None:
|
| 192 |
+
raise ValueError(
|
| 193 |
+
"This likelihood example requires reference_scaling_inputs and "
|
| 194 |
+
"reference_scaling_outputs in the bundle metadata."
|
| 195 |
+
)
|
| 196 |
+
|
| 197 |
+
theta0 = _midpoint_physical_parameters(emu)
|
| 198 |
+
wavelength = _select_wavelengths(emu, n_wavelength=int(args.n_wavelength))
|
| 199 |
+
|
| 200 |
+
def predict_log10_intensity(theta, wavelength_physical):
|
| 201 |
+
"""Predict log10 intensity channels; jit the outer objective."""
|
| 202 |
+
log10_wavelength = jnp.log10(wavelength_physical)
|
| 203 |
+
x_physical = {
|
| 204 |
+
"parameters": theta[None, :],
|
| 205 |
+
"wavelengths": log10_wavelength[None, :],
|
| 206 |
+
}
|
| 207 |
+
x_scaled = normalize_tree(
|
| 208 |
+
x_physical,
|
| 209 |
+
ref_inputs["min_tree"],
|
| 210 |
+
ref_inputs["max_tree"],
|
| 211 |
+
)
|
| 212 |
+
y_scaled = apply_intensity(x_scaled)
|
| 213 |
+
y_log10 = denormalize_tree(
|
| 214 |
+
y_scaled,
|
| 215 |
+
ref_outputs["min_tree"],
|
| 216 |
+
ref_outputs["max_tree"],
|
| 217 |
+
)
|
| 218 |
+
return y_log10[OUTPUT_LEAF][0]
|
| 219 |
+
|
| 220 |
+
theta_ref = jnp.asarray(theta0, dtype=jnp.float32)
|
| 221 |
+
wave_ref = jnp.asarray(wavelength, dtype=jnp.float32)
|
| 222 |
+
model_ref = predict_log10_intensity(theta_ref, wave_ref)
|
| 223 |
+
|
| 224 |
+
noise_key = jax.random.key(int(args.noise_seed))
|
| 225 |
+
sigma_value = float(args.sigma_log10)
|
| 226 |
+
if sigma_value <= 0.0:
|
| 227 |
+
raise ValueError(f"sigma-log10 must be positive, got {sigma_value}")
|
| 228 |
+
noise = jax.random.normal(
|
| 229 |
+
noise_key,
|
| 230 |
+
shape=model_ref.shape,
|
| 231 |
+
dtype=model_ref.dtype,
|
| 232 |
+
)
|
| 233 |
+
observed_log10 = jax.lax.stop_gradient(model_ref + sigma_value * noise)
|
| 234 |
+
sigma_log10 = jnp.full_like(observed_log10, sigma_value)
|
| 235 |
+
|
| 236 |
+
@jax.jit
|
| 237 |
+
def evaluate_likelihood(theta):
|
| 238 |
+
y_model = predict_log10_intensity(theta, wave_ref)
|
| 239 |
+
resid = (observed_log10 - y_model) / sigma_log10
|
| 240 |
+
log_norm = jnp.sum(jnp.log(2.0 * jnp.pi * sigma_log10**2))
|
| 241 |
+
log_likelihood = -0.5 * (jnp.sum(resid**2) + log_norm)
|
| 242 |
+
return y_model, log_likelihood
|
| 243 |
+
|
| 244 |
+
model_log10_jax, logp_jax = evaluate_likelihood(theta_ref)
|
| 245 |
+
model_log10 = np.asarray(jax.block_until_ready(model_log10_jax))
|
| 246 |
+
observed_np = np.asarray(jax.block_until_ready(observed_log10))
|
| 247 |
+
logp = float(jax.block_until_ready(logp_jax))
|
| 248 |
+
|
| 249 |
+
print("bundle:", BUNDLE_DIR)
|
| 250 |
+
print("parameter vector:")
|
| 251 |
+
for name, value in zip(_parameter_names(emu), theta0, strict=True):
|
| 252 |
+
print(f" {name}: {float(value):.6g}")
|
| 253 |
+
print(
|
| 254 |
+
"wavelength range:",
|
| 255 |
+
f"{float(wavelength[0]):.6g} .. {float(wavelength[-1]):.6g}",
|
| 256 |
+
f"({wavelength.shape[0]} points)",
|
| 257 |
+
)
|
| 258 |
+
print("output channels:", OUTPUT_CHANNELS)
|
| 259 |
+
print("model log10 output shape:", model_log10.shape)
|
| 260 |
+
for i, name in enumerate(OUTPUT_CHANNELS):
|
| 261 |
+
resid = observed_np[:, i] - model_log10[:, i]
|
| 262 |
+
print(
|
| 263 |
+
f" {name}: model median={float(np.median(model_log10[:, i])):.6f}, "
|
| 264 |
+
f"residual rms={float(np.sqrt(np.mean(resid**2))):.6f}"
|
| 265 |
+
)
|
| 266 |
+
print("sigma_log10:", f"{sigma_value:.6f}")
|
| 267 |
+
print("noise_seed:", int(args.noise_seed))
|
| 268 |
+
print("log_likelihood:", f"{logp:.6f}")
|
| 269 |
+
|
| 270 |
+
if args.show:
|
| 271 |
+
_show_plot(
|
| 272 |
+
wavelength=wavelength,
|
| 273 |
+
model_log10=model_log10,
|
| 274 |
+
observed_log10=observed_np,
|
| 275 |
+
)
|
| 276 |
+
|
| 277 |
+
|
| 278 |
+
if __name__ == "__main__":
|
| 279 |
+
main()
|
reference_scaling_inputs.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:3c641caa7e563613dc40b54822feedc4d0cc16ad90137d6c351129ee96b1b2ca
|
| 3 |
+
size 480
|
reference_scaling_outputs.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:9eaa1947e73b51a122e1dafa8af5a4a07837ee447cb46f791c7c3cc45ddd4530
|
| 3 |
+
size 168
|
weights/weights.safetensors
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:33218ec929ee6f6d7957f1afeca3b3fdd804940f98e5119f9e033814ffaa6cca
|
| 3 |
+
size 940360
|