Implementation of the neural tangent kernel for scikit-learn's Gaussian process module.
Project description
Neural Tangent Kernel for scikit-learn
Gaussian Processes
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:
- Clone the repository
git clone git@github.com:392781/scikit-ntk.git
- Enable a Poetry virtual environment
poetry shell
- 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file scikit_ntk-1.2.0.tar.gz
.
File metadata
- Download URL: scikit_ntk-1.2.0.tar.gz
- Upload date:
- Size: 5.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.2.2 CPython/3.12.6 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdc4dc6e0f51b4e1736794319ba4ec1380fc3ff8da8c68273992569481489e13 |
|
MD5 | 5740a93ead04b4537537b3ad8d01fd39 |
|
BLAKE2b-256 | b61c5bf8212aec9382d7a4542765c9e941bb06710e700fbddd51448e5265c0e5 |
File details
Details for the file scikit_ntk-1.2.0-py3-none-any.whl
.
File metadata
- Download URL: scikit_ntk-1.2.0-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.12.6 Linux/6.8.0-1014-azure
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1fb201b998fea61d925853660d834ee6a3d4460707491f7f1305ce7be823e18f |
|
MD5 | 88fa9e427d7fc040cfe66aa408a2c51f |
|
BLAKE2b-256 | 195e82c316b27a0cb519c6bda684f23d0a16a8bca21f28183614963c8d5da6fa |