{"id":19120468,"url":"https://github.com/juliagaussianprocesses/scalarkernelfunctions.jl","last_synced_at":"2026-02-09T15:08:46.342Z","repository":{"id":223560667,"uuid":"760796243","full_name":"JuliaGaussianProcesses/ScalarKernelFunctions.jl","owner":"JuliaGaussianProcesses","description":"Kernel functions optimized for 1d input","archived":false,"fork":false,"pushed_at":"2024-03-01T14:09:39.000Z","size":28,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-06-25T07:06:09.705Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Julia","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/JuliaGaussianProcesses.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2024-02-20T20:22:57.000Z","updated_at":"2024-02-20T20:23:42.000Z","dependencies_parsed_at":"2024-03-01T15:27:13.068Z","dependency_job_id":"c5804821-9acc-44a3-a39a-8a074ff39ff8","html_url":"https://github.com/JuliaGaussianProcesses/ScalarKernelFunctions.jl","commit_stats":null,"previous_names":["juliagaussianprocesses/scalarkernelfunctions.jl"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/JuliaGaussianProcesses/ScalarKernelFunctions.jl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaGaussianProcesses%2FScalarKernelFunctions.jl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaGaussianProcesses%2FScalarKernelFunctions.jl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaGaussianProcesses%2FScalarKernelFunctions.jl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaGaussianProcesses%2FScalarKernelFunctions.jl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/JuliaGaussianProcesses","download_url":"https://codeload.github.com/JuliaGaussianProcesses/ScalarKernelFunctions.jl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/JuliaGaussianProcesses%2FScalarKernelFunctions.jl/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266972081,"owners_count":24014549,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-07-25T02:00:09.625Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-09T05:14:13.387Z","updated_at":"2026-02-09T15:08:41.323Z","avatar_url":"https://github.com/JuliaGaussianProcesses.png","language":"Julia","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ScalarKernelFunctions.jl\n\n[![Project Status: WIP – Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)\n[![CI](https://github.com/JuliaGaussianProcesses/ScalarKernelFunctions.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/JuliaGaussianProcesses/ScalarKernelFunctions.jl/actions/workflows/CI.yml)\n[![Codecov](https://codecov.io/gh/JuliaGaussianProcesses/ScalarKernelFunctions.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/JuliaGaussianProcesses/ScalarKernelFunctions.jl/tree/master)\n\nThis package implements kernel functions that are optimized for one-dimensional input and\nthat are GPU-compatible by default.\n\n## Usage\nThis package expands the KernelFunctions.jl package (which is automatically loaded and\nreexported) by a new abstract type `ScalarKernel`.\nIts subtypes include a couple of base kernels with the `Scalar` prefix.\nOn 1-dimensional inputs, they give exactly the same output as their KernelFunctions.jl\ncounterparts, e.g.:\n```julia\nusing ScalarKernelFunctions\n\nk1 = ScalarSEKernel() # from this package\nk2 = SEKernel() # from KernelFunctions.jl\nx = rand(100)\nkernelmatrix(k1, x) ≈ kernelmatrix(k2, x) # true\n```\nWhen combining subtypes of `ScalarKernel` using `+`, `with_lengthscale`, another subtype of\n`ScalarKernel` will be produced, which means that specialized implementations will be used\nfor the composite kernel as well.\nMixing specialized and \"normal\" kernels will also work, but will no longer use the\nspecialized implementation.\n\nSpecializing on 1d input allows to achieve lower allocation counts and faster evaluation,\nespecially combined with AD packages such as Zygote or Enzyme. Parameter fields are also\nscalar, which saves allocations with repeated construction of the kernel, e.g. when kernel\nparameters are being optimized.\n\n### GPU-compatibility by default\nThe kernels in this package are implemented using broadcast, which allows them to work on\nthe GPU by default. We also export a `gpu` function, which converts any kernel to use\n`Float32` parameters (where needed), and calling `kernelmatrix` will preserve `Float32` to\nbe most efficient on GPUs. For example, this is how we use a kernel on `CuArray`s:\n```julia\nusing CUDA\nx = CUDA.rand(100)\nk = ScalarPeriodicKernel() |\u003e gpu # ScalarPeriodicKernel{Float32}(1.0f0)\nkernelmatrix(k, x) # returns 100×100 CuArray{Float32, 2, CUDA.Mem.DeviceBuffer}\n```\nOmitting the `gpu` conversion will of course also work, but will be quite a bit slower.\n\n## Supported kernels\n### Base kernels\n- [x] `ScalarSEKernel`\n- [x] `ScalarLinearKernel`\n- [x] `ScalarPeriodicKernel`\n- [x] `ScalarMatern12Kernel` === `ScalarExponentialKernel`\n- [x] `ScalarMatern32Kernel`\n- [x] `ScalarMatern52Kernel`\n- [x] `ScalarMaternKernel`\n\n### Composite kernels\n- [x] `ScalarKernelSum`, when doing `k1 + k2`, where `k1` and `k2` are `ScalarKernel`s\n- [ ] `ScalarKernelProduct`\n- [x] `ScalarTransformedKernel`, when doing `k ∘ t`, where `k` is a `ScalarKernel` and `t` is a `Transform`\n- [x] `ScalarScaledKernel`, when doing `a * k`, where `k` is a `ScalarKernel` and `a` is a `Real`\n\n### Transforms\n- [x] `ScalarScaleTransform`\n\u003c!-- - [ ] `ScalarConstantKernel`\n- [ ] `WhiteKernel`\n- [ ] `EyeKernel`\n- [ ] `ZeroKernel`\n- [ ] `WienerKernel`\n- [ ] `CosineKernel`\n- [ ] `GaussianKernel`\n- [ ] `LaplacianKernel`\n- [ ] `ExponentialKernel`\n- [ ] `GammaExponentialKernel`\n- [ ] `ExponentiatedKernel`\n- [ ] `FBMKernel`\n- [ ] `MaternKernel`\n- [ ] `PolynomialKernel`\n- [ ] `RationalKernel`\n- [ ] `RationalQuadraticKernel`\n- [ ] `GammaRationalKernel`\n- [ ] `PiecewisePolynomialKernel`\n- [ ] `NeuralNetworkKernel`\n- [ ] `KernelTensorProduct`\n- [ ] `NormalizedKernel`\n- [ ] `GibbsKernel` --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliagaussianprocesses%2Fscalarkernelfunctions.jl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjuliagaussianprocesses%2Fscalarkernelfunctions.jl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjuliagaussianprocesses%2Fscalarkernelfunctions.jl/lists"}