用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/arm2arm/AstroAgentAssistant --skill jubik命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
S3/MinIO operations: connectivity, transfers, read benchmarks, and matplotlib visualization templates.
Complete guide to the REANA reproducible analytics platform: Dockerized client setup, multi-backend profiles, workflow authoring patterns, S3 dataset workflows, and best practices. Covers dev/prod backends, serial workflows, REANA_WORKSPACE usage, and self-learning from finished workflows.
Complete guide to working with Arepo simulation HDF5 files: structure inspection, unit conversion, radial profiles, slice projections, and dimensionality reduction (UMAP/t-SNE) for clustering analysis.
基于 SOC 职业分类
正在显示 SKILL.md
| name | jubik |
| category | research |
| description | J-UBIK (JAX-accelerated Universal Bayesian Imaging Kit) + NIFTy 9.x re API for variational inference. |
| prerequisites | {"python":["nifty[re]>=9.2.0","jubik @ git+https://github.com/NIFTy-PPL/J-UBIK"]} |
re (JAX) API(Declared in frontmatter — auto-provisioned via .hermes/envs/jubik)
skill_manage auto-provisions the venv at .hermes/envs/jubik.skill_manage create/edit. If you need to re-provision, edit via skill_manage..hermes/envs/jubik/bin/python.nifty (currently 9.2.0).nifty.re (import nifty.re as jft).nifty.cl.nifty8 — that is the dead pre-2026 line and is incompatible with J-UBIK.jubik), installed from git, requires nifty>=9.0.0.jubik sets JAX to float64 globally.[jwst] extra) can be used here.IMPORTANT:
jft.optimize_klWORKS in nifty 9.2.0. The official upstream demo (demos/re/0_intro.py) runs cleanly with healthy chi-squared diagnostics. When the API fights you, do NOT conclude the library is broken — curl the official demo, adapt it, and compare your usage to the upstream reference.
grid = jft.Grid(shape0=N, splits=1) # 1D Cartesian grid
maker = jft.CorrelatedFieldMaker('cf') # prefix REQUIRED
add_fluctuations() arguments are tuples (mean, std), NOT lists:
maker.add_fluctuations(
shape=(N,), # tuple shape
distances=1.0/N, # match official demo convention
fluctuations=(1e-1, 5e-3), # lognormal: mean>0, std>0
loglogavgslope=(-2.0, 1e-2), # normal: mean, std
flexibility=(1e0, 5e-1),
asperity=(5e-1, 5e-2),
)
Lognormal prior requires mean > 0. Normal prior accepts any mean.
Set the amplitude offset before finalizing:
cf_zm = dict(offset_mean=0.0, offset_std=(1e-3, 1e-4))
cf_fl = dict(fluctuations=(1e-1, 5e-3), loglogavgslope=(-2.0, 1e-2),
flexibility=(1e0, 5e-1), asperity=(5e-1, 5e-2))
cfm = jft.CorrelatedFieldMaker("cf")
cfm.set_amplitude_total_offset(**cf_zm)
cfm.add_fluctuations(shape, distances, **cf_fl, prefix="ax1", non_parametric_kind="power")
cf = cfm.finalize() # returns a jft.Model
Compose init methods with | (pipe operator) to merge multiple sub-model domains:
scaling = jft.LogNormalPrior(3.0, 1.0, name="scaling", shape=(1,))
class Signal(jft.Model):
def __init__(self, correlated_field, scaling):
self.cf = correlated_field
self.scaling = scaling
super().__init__(init=self.cf.init | self.scaling.init)
def __call__(self, x):
return self.scaling(x) * jnp.exp(self.cf(x))
signal = Signal(cf, scaling)
Model.__call__ takes a single dict argument, NOT **kwargs:
# WRONG: model(**params)
# RIGHT:
signal_val = model(params_dict)
noise_cov = lambda x: noise_std**2 * x
noise_cov_inv = lambda x: noise_std**-2 * x
lh = jft.Gaussian(data, noise_cov_inv).amend(signal_response)
From demos/re/0_intro.py:
from jax import random
import nifty.re as jft
n_vi_iterations = 6
delta = 1e-4
n_samples = 4
key, k_i, k_o = random.split(key, 3)
samples, state = jft.optimize_kl(
lh,
jft.Vector(lh.init(k_i)), # INITIAL: wrap lh.init() in Vector
n_total_iterations=n_vi_iterations,
n_samples=lambda i: n_samples // 2 if i < 2 else n_samples,
key=k_o,
draw_linear_kwargs=dict(
cg_name="SL",
cg_kwargs=dict(absdelta=delta * jft.size(lh.domain) / 10.0, maxiter=100),
),
nonlinearly_update_kwargs=dict(
minimize_kwargs=dict(name="SN", xtol=delta, cg_kwargs=dict(name=None), maxiter=5)
),
kl_kwargs=dict(
minimize_kwargs=dict(name="M", xtol=delta, cg_kwargs=dict(name=None), maxiter=35)
),
sample_mode="nonlinear_resample",
odir="results", # optional output dir
resume=False,
)
Key API points:
jft.Vector(lh.init(k_i)) — use lh.init() (the likelihood's init, which inherits the prior), wrapped in jft.Vector.jft.mean(tuple(signal(s) for s in samples)) — evaluate the full model at each sample, then average.reduced Chi² for likelihood and all prior parameters. Healthy values are near 1.0.Set MPLCONFIGDIR to a writable directory before importing matplotlib:
import os
os.environ['MPLCONFIGDIR'] = '/path/to/writable/cache'
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
nifty.re: you may be running the wrong python (not the skill venv). Verify with import nifty; print(nifty.__version__).export JAX_PLATFORMS=cpu or reduce domain size.nifty8 present: uninstall it. It conflicts with nifty v9.MPLCONFIGDIR to a writable directory before importing.optimize_kl is NOT broken. Early attempts failed due to API misuse (passing raw dict instead of jft.Vector(lh.init(key)), using **kwargs instead of single-dict arg, wrong noise_std_inv signature). Once the official demo pattern was adopted, inference completed in ~25s with χ² ≈ 1.0 and signal recovery correlation of 0.977.
When the API fights you, consult the upstream demo. The authoritative reference is demos/re/0_intro.py at https://gitlab.mpcdf.mpg.de/ift/nifty (raw path: demos/re/0_intro.py, ref: nifty). Adapt it verbatim wherever possible — don't guess at signatures.
Frontmatter prerequisites are mandatory for auto-provisioning. Putting prerequisites inside a body code-block (rather than YAML frontmatter) prevents skill_manage from provisioning the venv. Provisioning fires ONLY on skill_manage create/edit.
CorrelatedFieldMaker requires a prefix in add_fluctuations() (e.g., prefix="ax1"). The field names in the resulting domain are prefixed (e.g., cfax1xi, cfax1spectrum).