IntensityFree#

Summary#

A recurrent context encoder parameterizes a log-normal mixture for the next inter-event time and a categorical distribution for its mark.

Intensity and objective#

loglike_loss adds the time distribution’s log_prob and the categorical mark log_prob for valid target events:

\[\ell_i=\log f(u_i\mid h_i)+\log p(k_i\mid h_i).\]

Marks and times are conditionally independent given the context. The mixture uses saved log-inter-event-time statistics. For thinning, compute_intensities_at_sample_times derives a marked hazard:

\[\lambda_k(u\mid h)=\frac{f(u\mid h)}{S(u\mid h)}p(k\mid h).\]

The code adds a numerical epsilon and clamps elapsed times away from zero. One-step prediction samples the mixture directly; recursive generation uses the distribution-derived hazard with thinning. The implementation does not use a learned initial RNN context.

Implementation: easy_tpp/model/intensity_free.py. The formulas above summarize this implementation, including its numerical choices, rather than asserting equivalence to every variant in the reference.

Original reference#

Intensity-Free Learning of Temporal Point Processes (as listed in the repository README).

Shipped preset#

This is the packaged model fragment. Configuration and presets explains how it merges with the dataset and shared trainer presets.

trainer_config:
  batch_size: 256
  shuffle: False
  optimizer: adam
  learning_rate: 1.e-3
  valid_freq: 1
  use_tfb: False
  metrics: [ 'acc', 'rmse' ]
  seed: 2019
  gpu: -1
model_config:
  hidden_size: 32
  time_emb_size: 16
  num_layers: 2
  num_heads: 2
  sharing_param_layer: False
  loss_integral_num_sample_per_step: 20
  dropout_rate: 0.0
  use_ln: False
  model_specs:
    num_mix_components: 3
  thinning:
    num_seq: 10
    num_sample: 1
    num_exp: 500 # number of i.i.d. Exp(intensity_bound) draws at one time in thinning algorithm
    look_ahead_time: 10
    patience_counter: 5 # the maximum iteration used in adaptive thinning
    over_sample_rate: 5
    num_samples_boundary: 21
    dtime_max: 5
    num_step_gen: 1

API#

easy_tpp.model.IntensityFree · EasyTPP Models