Skip to main content

Neural Tangent Kernel for scikit-learn Gaussian Processes

GitHub Workflow Status PyPI PyPI - Python Version PyPI - Downloads Bibtex citation

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.8)
  • 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}}
}

Release files for scikit-ntk 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scikit-ntk 1.2.1
File Size Uploaded
scikit_ntk-1.2.1.tar.gz 5.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for scikit-ntk 1.2.1
File Interpreter ABI Platform
scikit_ntk-1.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / scikit_ntk-1.2.1.tar.gz

Download URL scikit_ntk-1.2.1.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
8a1bd65d146b4121cd1c696b04b014821d8c2870c319f3d426efd77509e04085
BLAKE2b-256 checksum
How to use checksums
5196b2a7af9daa4f2c986d2e97a001125572ebee0591d605038298ad7307283c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.12.6 Linux/6.8.0-1014-azure

Release files / scikit_ntk-1.2.1-py3-none-any.whl

Download URL scikit_ntk-1.2.1-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
953c5a2d32b5b549e7627a5f5dbceaa66d5a16498d736ddc2b678c384f28d3a6
BLAKE2b-256 checksum
How to use checksums
f1a938204bed67b4d3d532d2270a12b1a0003506e72166229dc0f4b2bdce541f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.2.2 CPython/3.12.6 Linux/6.8.0-1014-azure

Release history Release notifications | RSS feed

This release

1.2.1 This release

2 release files

1.2.0

2 release files

1.1.3

2 release files

1.1.2

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page