Changelog#
Unreleased#
Added#
Opt-in deterministic quadrature for one-step intensity-based prediction, with a window-truncated mean, integrated type probabilities and an optional median; prediction disables autograd and recursive generation continues to use thinning.
Optional per-sequence
window_enddata andmodel_config.loglike_window: observationinclude survival through the end of observation, with simulation export, time rescaling, and model coverage. Right truncation caps explicit observation ends at the last retained event; left truncation preserves them. IntensityFree computes survival in log space, preserving extreme-tail penalties.
Fixed#
One-step evaluation scores only adjacent real events, making RMSE and type accuracy independent of padding side for both thinning and quadrature.
0.6.0#
Training and sampling robustness, fixes to ODETPP and S2P2, and a redesigned documentation site. ANHN is removed, so this is a minor release.
Breaking changes#
ANHN (attentive neural Hawkes network) is removed. A config with
model_id: ANHNraises an error naming supported alternatives (#138).
Fixed#
ODETPP scores events and computes its integral and thinning with the same ODE discretisation, so its next-event density integrates to one (#143).
S2P2 prediction memory grows linearly with the number of sample times, and several numerical hazards are fixed (#140).
A non-finite training loss raises an error naming the model, epoch and batch instead of silently using up the early-stopping patience (#144).
Prediction skips padded positions in thinning, for left and right padding (#145).
Changed#
Thinning uses a log-spaced bound grid by default (
thinning.bound_grid: log), which keeps sampling efficient on long prediction windows;bound_grid: linearreproduces the previous grid exactly (#145).The ODETPP preset trains stably: learning rate 1e-3, shuffled batches, bounded (tanh) dynamics and an RK4 step count that grows with the interval length. Configs without these options keep the previous behaviour and checkpoints load unchanged (#146).
Early-stopping patience counts validations, not epochs; this is now documented and the stopping message reports both (#144).
Added#
Optional gradient clipping:
trainer_config.grad_clip_norm(off by default), with the epoch’s maximum pre-clip gradient norm reported asgrad_norm_max(#144).Property tests for time scaling, gradients and event accounting across all models (#139).
Redesigned documentation site with technical details per model, a user manual and the API reference; old page URLs redirect (#141, #142).
0.5.1#
Fixes from a review of 0.5.0.
Fixed#
Custom metrics registered with
MetricsHelper.registerare computed during validation again; prediction runs whenever a registered metric is configured (#136).Thinning no longer fails with mixed precision when every proposal falls outside the window, and
thinning.max_iterationscan be set in the config (#134).Presets run on CPU-only machines (three selected CUDA) (#135).
With
data_formatomitted, the reader follows the resolved data source, so directory sources work; URLs ending in.json/.jsonlload again (#135).HPO configs resolve interpolations over the full config (#135).
The self-correcting simulator avoids overflow for very large rates (#135).
Changed#
Presets share one training budget: 100 epochs with early stopping after 10 validations without improvement (new
trainer_config.early_stopping_patience, off by default). ANHN has a full preset (#135).Docs: thinning is exact when the per-segment bounds dominate the intensity; for general neural intensities the grid-derived bounds are an approximation (#134).
The experiment notebooks pin
easy-tpp==0.5.1.
0.5.0#
Faster and more reliable next-event prediction, validated configs with ready-made presets, and more flexible data loading.
Changed#
Thinning uses a piecewise-constant intensity bound over the prediction window and draws proposals across segments in one pass. RMTPP prediction no longer hangs, and models need about one sampling pass per interval (validation of ITHP, AttNHP and ANHN is about 4-6x faster) (#125, #130).
thinning.num_samples_boundaryis a lower bound: the bound grid uses at least 21 points (default 21).max_iterations(default 10000) raises a clear error instead of looping forever (#125).Validation runs next-event prediction only when
rmseoraccis intrainer_config.metrics(#128).Routine runner and config messages are logged at INFO instead of CRITICAL, so they can be silenced without hiding errors (#132).
Unknown config keys raise a
FutureWarningwith a suggestion; they become errors in 0.6.0. Values are type-checked and coerced where possible (#126).
Added#
Typed config schemas, packaged presets for the five Hub datasets and all 12 models, and
Config.preset(model, dataset, overrides=...)with dict or dotlist overrides (#126).data_config.source(auto,hub,json,jsonl,pkl); local paths are resolved before Hub ids, and.jsonlfiles and split directories are accepted (#124).easy_tpp.simulation: Poisson, multivariate Hawkes and self-correcting processes with exact simulation and log-likelihoods, writing splits thatTPPDataLoaderreads directly (#131).Experiment notebooks in
notebooks/experiments/: dataset validation and model checks for all 12 models (#123, #129).
Fixed#
NHP and ODETPP no longer crash on single-event histories (#122, thanks @chenyangsu).
Removed the unused
mc_num_sample_per_stepkey from the example config (#126).A test failed on torch 2.8 because of mask indexing (#127).
0.4.0#
A correctness release. A code review found likelihood, sampling and prediction bugs in several models; they are fixed here, each with regression tests, and a shared contract test suite now runs on every model.
Breaking changes#
Python 3.10 or newer is required (3.9 is end-of-life).
Runner.evaluate(), andRunner.run()in evaluation mode, return the metrics dict instead of the RMSE value (#101).Multi-step prediction returns
[batch, num_step_gen]arrays; the copied last observed event is no longer included (#100).IntensityFree’s mark head no longer has an output for the PAD token, so checkpoints saved by 0.3.x do not load (#107).
FullyNN’s likelihood subtracts H(0) from the integral. Set
model_specs.subtract_zero_hazard: falsefor the previous behaviour (#96).With
use_mc_samples: truethe log-likelihood integral uses random sample times, so values vary between runs unless seeded (#108).Optuna is an optional extra:
pip install 'easy_tpp[hpo]'(#109).
Fixed#
ANHN: the likelihood no longer sees future events, and prediction no longer crashes (#93).
AttNHP: one-step prediction no longer treats time offsets as absolute timestamps (#94).
FullyNN: the shipped config no longer crashes (#95), and prediction works under
no_grad(#103).iTHP: multi-step prediction no longer crashes, and events are counted correctly (#92).
ODETPP: parameter gradients are correct when time steps differ within a batch (#97).
Thinning sampler: the intensity bound covers the sampled window, samples are independent, and a bound violation triggers a retry (#98).
ScaledSoftplus no longer has a flat, zero-gradient region (#99).
S2P2: no NaN with
complex_values: false(#105).Generation runs in eval mode without gradients (#103).
Config:
get/popdefaults, saving and reloading, andcopy()keep every field.dropoutis accepted as an alias ofdropout_rate(#102).Tokenizer: masks respect left padding, and truncation shortens padded length (#104).
HPO: trials use their own data loaders, so a tuned batch size takes effect (#109). Fixed crashes in
OptunaTuner(#91).Evaluation and generation from a checkpoint no longer need the training set; IntensityFree statistics and
time_scaleare saved with the checkpoint (#110).
Added#
Interpretable Transformer Hawkes Process (iTHP) (#88).
Model contract tests for all 12 models, plus data pipeline and end-to-end runner tests (#119).
CI tests Python 3.10–3.12, and builds and tests the installed wheel before every PyPI upload (#112, #117).
README and Sphinx docs updated for the current API (#113).