协作头脑风暴
brainstorming
在实现前澄清需求、探索设计选择,并形成清晰的开发方向。
modeling-basics【开发与工程】Author and debug basic Pyro models, primitives, parameter state, validation, seeds, plates, and PyroModule parameters.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this sub-skill when a task asks you to author or debug a basic Pyro program:
stochastic functions, pyro.sample, pyro.param, observed data, pyro.plate,
subsampling, parameter-store lifecycle, validation settings, RNG seeding,
PyroModule, PyroParam, PyroSample, or pyro.render_model prerequisites.
This guidance targets the pyro-ppl 1.9.1 package family imported as pyro.
It is self-contained for runtime use.
obs_mask, plates,
validation, seeds, site names, and rendering prerequisites, read
references/modeling-primitives.md.pyro.param, ParamStoreDict, constraints, save/load state,
pyro.module, PyroModule, PyroParam, PyroSample, and
module_local_params, read
references/modules-and-parameters.md.../distributions-and-shapes/SKILL.md.../svi-and-autoguides/SKILL.md.../mcmc-and-prediction/SKILL.md.max_plate_nesting: ../effect-handlers-and-enumeration/SKILL.md.pyro.clear_param_store() unless you intentionally want to reuse existing
parameters.pyro.enable_validation(True). Use
with pyro.validation_enabled(False): ... only around mature hot paths.pyro.set_rng_seed(seed) before generating
synthetic data or initializing parameters.pyro.plate only for conditionally independent batch dimensions. If the
error is mainly about batch_shape, event_shape, .to_event(), or
log_prob shape, reroute to the shapes sub-skill.PyroModule / PyroParam / PyroSample for module-style models.
Use old pyro.module(name, nn_module, update_module_params=False) mainly
for registering an ordinary torch.nn.Module with the global parameter
store.pyro.sample(name, fn, *args, obs=None, obs_mask=None, infer=None, **kwargs)pyro.param(name, init_tensor=None, constraint=constraints.real, event_dim=None)pyro.plate(name, size=None, subsample_size=None, subsample=None, dim=None, use_cuda=None, device=None)pyro.module(name, nn_module, update_module_params=False)PyroModule(name=""), PyroParam(init_value=None, constraint=constraints.real, event_dim=None), PyroSample(prior)pyro.settings.get(), pyro.settings.set(...), pyro.settings.context(...)pyro.enable_validation(...), pyro.validation_enabled(...), pyro.set_rng_seed(...)