Skip to main content

Implementation of the neural tangent kernel for scikit-learn's Gaussian process module.

Project description

Neural Tangent Kernel for scikit-learn Gaussian Processes

GitHub Workflow Status PyPI PyPI - Python Version PyPI - Downloads

scikit-ntk is implementation of the neural tangent kernel (NTK) for the scikit-learn machine learning library as part of "An Empirical Analysis of the Laplace and Neural Tangent Kernels" master's thesis (found at http://hdl.handle.net/20.500.12680/d504rr81v and https://arxiv.org/abs/2208.03761). This library is meant to directly integrate with sklearn.gaussian_process module. This implementation of the NTK can be used in combination with other kernels to train and predict with Gaussian process regressors and classifiers.

Installation

Dependencies

scikit-ntk requires:

  • Python (>=3.7)
  • scikit-learn (>=1.0.1)

User installation

In terminal using pip run:

pip install scikit-ntk

Usage

Usage is described in examples/usage.py; however, to get started simply import the NeuralTangentKernel class:

from skntk import NeuralTangentKernel as NTK

kernel_ntk = NTK(D=3, bias=0.01, bias_bounds=(1e-6, 1e6))

Once declared, usage is the same as other scikit-learn kernels.

Building

Python Poetry (>=1.2) is required if you wish to build scikit-ntk from source. In order to build follow these steps:

  1. Clone the repository
git clone git@github.com:392781/scikit-ntk.git
  1. Enable a Poetry virtual environment
poetry shell
  1. Build and install
poetry build
poetry install --with dev

Citation

If you use scikit-ntk in your scientific work, please use the following citation alongside the scikit-learn citations found at https://scikit-learn.org/stable/about.html#citing-scikit-learn:

@mastersthesis{lencevicius2022laplacentk,
  author  = "Ronaldas Paulius Lencevicius",
  title   = "An Empirical Analysis of the Laplace and Neural Tangent Kernels",
  school  = "California State Polytechnic University, Pomona",
  year    = "2022",
  month   = "August",
  note    = {\url{http://hdl.handle.net/20.500.12680/d504rr81v}}
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scikit_ntk-1.1.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

scikit_ntk-1.1.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file scikit_ntk-1.1.1.tar.gz.

File metadata

  • Download URL: scikit_ntk-1.1.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.7 Linux/5.15.0-1021-azure

File hashes

Hashes for scikit_ntk-1.1.1.tar.gz
Algorithm Hash digest
SHA256 faa8dd95c27e9bc4e8e50fd8cf30361a7502b028881ef732c7027d3d4f84fbf2
MD5 6cc1861560d79ca2106113aecacdb07a
BLAKE2b-256 8cb241842c32fddc0eb98427e73cfce384d5eb5d285285332c57ae6ef35ee3de

See more details on using hashes here.

File details

Details for the file scikit_ntk-1.1.1-py3-none-any.whl.

File metadata

  • Download URL: scikit_ntk-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.10.7 Linux/5.15.0-1021-azure

File hashes

Hashes for scikit_ntk-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 9b5d9ab53b939f6f4fe45f2eef9a5774d5561a14684ae7b2b92d5ed00d7db0a8
MD5 0b1fb8602739a2c621453f62de1f5ee5
BLAKE2b-256 8afde28fbcf511588b3e7b4fe82f34d830c119f9861c045c777e42de8fc64969

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page