Skip to content
/ K2IE Public

Code for "K^2IE: Kernel Method-based Kernel Intensity Estimators for Inhomogeneous Poisson Processes" at ICML2025

Notifications You must be signed in to change notification settings

HidKim/K2IE

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Python Code for Kernel Method-based Kernel Intensity Estimator

This library provides kernel method-based kernel intensity estimator (K2IE) implemented in Tensorflow. K2IE is a kernel method model to estimate intensity functions with the least squares loss functionals. For details, see our ICML2025 paper [1].

The code was tested on Python 3.10.8, tensorflow-deps 2.10.0, tensorflow-macos 2.10.0, and tensorflow-metal 0.6.0.

Installation

To install latest version:

pip install git+https://github.com/HidKim/K2IE

Basic Usage

Import random Fourier Feature map (RFM) kernel class:

from HidKim_K2IE import kernels_rfm

Initialize RFM kernel

ker = kernels_rfm(n_dim, kernel='gaussian', n_rand_feature=500, seed=0, qmc=False)
  • n_dim: int

    The dimensionality of inputs.

  • kernel: string, default='gaussian'

    The kernel function: 'gaussian', 'laplace', and 'cauchy'.

  • n_rand_feature: int, default=0

    The number of random Fourier features.

  • seed: int, default=0

    The seed for sampling Fourier features.

  • qmc: bool, default=False

    Quasi-Monte Carlo method is applied to RFM generation.

Import K2IE class:

from HidKim_K2IE import k2_intensity_estimator

Initialize K2IE:

k2ie = k2_intensity_estimator(kernel=ker)
  • kernel: kernels_rfm instance

Fit K2IE with data:

time = model.fit(d_spk, d_region, a, b)
  • d_spk: ndarray of shape (n_points, dim_points)

    The training point data.

  • d_region: ndarray of shape (n_subregion, dim_points, 2)

    The observation region. e.g.) [ [[0,1],[0,1]], [[1,3],[0,1]] ] represents that there are two adjacent subdomains: one is a unit square, and the other is a rectangle with a length of 2 in the x-direction and a length of 1 in the y-direction.

  • a: float

    The amplitude hyper-parameter for shift-invariant kernel function, or the regularlization hyper-parameter '\gamma' in ICML2025 paper.

  • b: ndarray of shape (dim_region,)

    The scale hyper-parameter for shift-invariant kernel function. If a scalar value is provided, the shift-invariant kernel will be regarded as being isotropic.

  • Return: float

    The execution time.

Evaluate the integral of the squared intensity function over a specified domain (used for closs-validation of hyper-parameter):

int_sq = k2ie.predict_integral_squared(region)
  • region: ndarray of shape (n_subregion, dim_points, 2)

    The region for integral.

  • Return: float

    The evaluated itengral of the squared intensity function.

Predict intensity function on specified inputs:

r_est = model.predict(x)
  • x: ndarray of shape (n_points, dim_points)

    The points on input space for evaluating intensity values.

  • Return: ndarray of shape (n_points,)

    The predicted values of intensity function at the specified points.

Reference

  1. Hideaki Kim, Tomoharu Iwata, Akinori Fujino. "K2IE: Kernel Method-based Kernel Intensity Estimators for Inhomogeneous Poisson Processes", International Conference on Machine Learning, 2025.
@inproceedings{kim2025k2ie,
  title={K$^2$IE: Kernel Method-based Kernel Intensity Estimators for Inhomogeneous Poisson Processes},
  author={Kim, Hideaki and Iwata, Tomoharu and Fujino, Akinori},
  booktitle={International Conference on Machine Learning},
  volume={*},
  pages={*--*},
  year={2025}
}

License

Released under "SOFTWARE LICENSE AGREEMENT FOR EVALUATION". Be sure to read it.

Contact

Feel free to contact the author Hideaki Kim (hideaki.kin@ntt.com).

About

Code for "K^2IE: Kernel Method-based Kernel Intensity Estimators for Inhomogeneous Poisson Processes" at ICML2025

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages