Repository navigation
Conversation
The loop selected M points but only conditioned on the first M-1, so d_final, trace_curve[-1], and the repr's variance explained described one point fewer than was returned, and an early stop on threshold returned one unconditioned extra point. It now conditions on every selected point: trace_curve has shape (M + 1,), and early stop returns the smallest prefix below threshold. d_final was also returned in the internally shuffled row order; it is now aligned to the rows of X.
Rename docs/agents/ptgp-vfe to docs/agents/ptgp. Pages now describe each problem and its fix instead of a tiered escalation workflow: workflow.md is removed and tier references are replaced by the concrete action. Pages carry an honest applies_to (all, VFE/SVGP, or VFE) and VFE-only remarks are labelled. Also bring the content up to date with main: function names instead of line numbers, current signatures (check_init, Points(Z, Z_init), compile_kwargs, options vs scipy_options), the new VFEDiagnostics fields and excess_fit_per_n formula, KernelHealthDiagnostics, pg.fit / pg.predict, floatX, and the greedy_variance_init trace_curve / d_final semantics. Rewrite the sigma collapse mechanism (shrinking sigma grows the trace penalty; collapse needs Q close to Kff), fix the eta_collapse pairing and prior advice, and fix the check_inducing.py crash on KernelHealthDiagnostics.
|
Merge after #61, and it'll need a some changes. |
| *interrupted* phase, so `compile_predict` wires up to the | ||
| partially-trained state. | ||
| - **`compile_training_step(objective_fn, gp, X_var, y_var, model=None, | ||
| optimizer_fn=None, extra_vars=None, extra_init=None, frozen_vars=None, |
There was a problem hiding this comment.
stale on main after #65: optimizer_fn= and **optimizer_kwargs are gone, it's optimizer= (a pytensor_ml.optim transform, default adam(1e-2)). point to the ptgp-pytensor-ml skill
|
|
||
| ## Optim — `ptgp/optim/training.py` | ||
|
|
||
| - **`compile_scipy_objective(objective_fn, gp, X_var, y_var, model=None, |
There was a problem hiding this comment.
nit: the parameter is gp_model, not gp. gp= as a keyword raises TypeError
| was built as `Points(Z_var, Z_init=Z0)`, nothing otherwise). Pass empty | ||
| tuples to exclude all extras. `init` defaults to `"prior_median"` | ||
| (improper priors fall back per RV; see the function docstring). | ||
| - **`compile_scipy_diagnostics(diagnostic_fn, gp, X_var, y_var, |
There was a problem hiding this comment.
nit: gp_model, same as line 46
| `result.status == 99`; `unpack`/`sp`/`se` correspond to the | ||
| *interrupted* phase, so `compile_predict` wires up to the | ||
| partially-trained state. | ||
| - **`compile_training_step(objective_fn, gp, X_var, y_var, model=None, |
There was a problem hiding this comment.
nit: gp_model, same as line 46
| param_groups=None, include_prior=True, compile_kwargs=None, | ||
| **optimizer_kwargs) -> (train_step, sp, se)`**: Adam / SGD step for | ||
| minibatch training. Mostly SVGP; listed for completeness. | ||
| - **`compile_predict(gp, X_new_var, model, shared_params, |
There was a problem hiding this comment.
nit: gp_model, same as line 46
There was a problem hiding this comment.
fixed, and compile_predict now takes X_train / y_train through **data, after #66
| Each page under `pitfalls/` describes one problem: how to detect it, what | ||
| causes it, and how to fix it. Find the symptom below and open its page. | ||
| `applies_to` in each page's frontmatter says which models it concerns: | ||
| `all`, the inducing-point methods (`VFE`, `SVGP`), or `VFE` only. The |
There was a problem hiding this comment.
nit: excess_fit_per_n_negative uses [Unapproximated, VFE], which isn't one of these three values
There was a problem hiding this comment.
added Unapproximated, VFE to the list in SKILL.md, since SVGP histories have no excess_fit_per_n
| 2. **Loosen scipy tolerances**: | ||
|
|
||
| ```python | ||
| scipy_options={"ftol": 1e-7, "gtol": 1e-5} | ||
| options={"ftol": 1e-7, "gtol": 1e-5} # pg.fit / tracked_minimize kwargs |
There was a problem hiding this comment.
nit: gtol=1e-5 is already the L-BFGS-B default, so this only loosens ftol
| - **Per-step improvement**: divide | ||
| `(history[-1].elbo - history[-50].elbo)` (or the objective field your | ||
| history records) by the step count. If it's | ||
| > 1e-3 in absolute terms, real progress; bump maxiter. If it's |
There was a problem hiding this comment.
not a blocker: elbo is a sum over N, so fixed 1e-3 / 1e-6 per-step cutoffs depend on dataset size. divide by N
| Claude-specific convenience that symlinks it into a Claude Code skill | ||
| directory (`~/.claude/skills/` or a project-local `.claude/skills/`); | ||
| other AI tools can read `docs/agents/` directly. | ||
| The repo ships backend-agnostic agent-skill docs: `docs/agents/ptgp/` |
There was a problem hiding this comment.
after the rebase docs/agents/ also has ptgp-pytensor-ml (#65). list it here
| @@ -86,7 +86,7 @@ PTGP tries to distill some of the approaches of existing GP libraries and make t | |||
| PTGP is set up to work nicely with AI coding assistants: | |||
|
|
|||
| - **[`AGENTS.md`](AGENTS.md)** — project-level instructions for AI coding assistants (architecture, conventions, where things live, how to run tests). Follows the [AGENTS.md](https://agents.md/) cross-tool convention used by Codex, Cursor, Aider, and others. | |||
| - **[`docs/agents/`](docs/agents/)** — backend-agnostic agent-skill docs covering folk wisdom and training-debug recipes. Currently includes [`ptgp-vfe`](docs/agents/ptgp-vfe/) (VFE diagnostic skill: pitfalls, escalation workflow, interpretation of `VFEDiagnostics` and `GreedyVarianceDiagnostics`). | |||
| - **[`docs/agents/`](docs/agents/)** — backend-agnostic agent-skill docs covering folk wisdom and training-debug recipes. Currently includes [`ptgp`](docs/agents/ptgp/) (GP fit diagnosis: one page per problem with its cause and fix, plus interpretation of the diagnostic fields). | |||
There was a problem hiding this comment.
list ptgp-pytensor-ml too, same as AGENTS.md:190
There was a problem hiding this comment.
fixed, and updated the summary bullet near the top too
Closes #34.
Renames the agent skill
ptgp-vfetoptgpand makes it general to all GP methods. Each pitfall page now describes a problem and its fix, the Tier A-E workflow (reference/workflow.md) is removed, and pages are tagged withapplies_to(all,VFE, SVGP,VFE, orUnapproximated, VFE).The content is also updated to match main (signatures, diagnostic fields,
pg.fit), and two mechanisms are corrected: