Giter Site home page Giter Site logo

higherorderkme's Introduction

Higher Order Kernel Mean Embeddings for Stochastic Processes

This library provides estimators for the first and second order Maximum Mean Discrepancies (MMDs) with GPU support.

Installation

pip install git+https://github.com/maudl3116/higherOrderKME.git

Structure of the repository

  • The higherOrderKME folder contains the implementation of the higher order MMDs (see sigkernel.py) and higher order distribution regression algorithms (see KES.py)
  • The examples folder contains notebooks to perform two-sample tests, higher order distribution regression and causal graph discovery for stochastic processes.
  • The data folder contains the data generators used for the experiments in the paper:

How to use the library

import torch
from higherOrderKME import sigkernel

# Specify the static kernel (for linear kernel use sigkernel.LinearKernel())
static_kernel = sigkernel.RBFKernel(sigma=0.5)

# Specify dyadic order for PDE solver (int > 0, default 0, the higher the more accurate but slower)
dyadic_order = 2

# Specify the hyperparameter for the estimation of the conditional KME
lambda_ = 1e-5

# Initialize the corresponding signature kernel
signature_kernel = sigkernel.SigKernel(static_kernel, dyadic_order)

# Synthetic data
n, len_x, len_y, dim = 100, 10, 20, 2
x = torch.rand((n,len_x,dim), dtype=torch.float64, device='cuda') # shape (batch,len_x,dim)
y = torch.rand((n,len_y,dim), dtype=torch.float64, device='cuda') # shape (batch,len_y,dim)

# Compute the (classical) first order MMD distance between samples x ~ P and samples y ~ Q, where P,Q are two distributions on path space
mmd_order1 = signature_kernel.compute_mmd(x, y, order=1)

# Compute the second order MMD distance between samples x ~ P and samples y ~ Q, where P,Q are two distributions on path space
mmd_order2 = signature_kernel.compute_mmd(x, y, lambda_=lambda_, order=2)

Citation

@article{salvi2021higher,
  title={Higher Order Kernel Mean Embeddings to Capture Filtrations of Stochastic Processes},
  author={Salvi, Cristopher and Lemercier, Maud and Liu, Chong and Hovarth, Blanka and Damoulas, Theodoros and Lyons, Terry},
  journal={arXiv preprint arXiv:2109.03582},
  year={2021}
}

higherorderkme's People

Contributors

maudl3116 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.