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.
scikit-ntk requires:
- Python (>=3.8)
- scikit-learn (>=1.0.1)
In terminal using pip
run:
pip install scikit-ntk
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.
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 [email protected]:392781/scikit-ntk.git
- Enable a Poetry virtual environment
poetry shell
- Build and install
poetry build
poetry install --with dev
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}}
}