{"id":15629846,"url":"https://github.com/alshedivat/keras-gp","last_synced_at":"2025-09-07T20:10:45.086Z","repository":{"id":41413160,"uuid":"69705340","full_name":"alshedivat/keras-gp","owner":"alshedivat","description":"Keras + Gaussian Processes: Learning scalable deep and recurrent kernels.","archived":false,"fork":false,"pushed_at":"2024-08-02T16:12:47.000Z","size":93,"stargazers_count":249,"open_issues_count":11,"forks_count":54,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-05-26T05:13:23.166Z","etag":null,"topics":["gaussian-processes","keras","machine-learning","neural-networks","tensorflow","theano"],"latest_commit_sha":null,"homepage":"","language":"Python","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/alshedivat.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,"publiccode":null,"codemeta":null}},"created_at":"2016-09-30T22:07:01.000Z","updated_at":"2025-01-05T12:05:02.000Z","dependencies_parsed_at":"2024-10-22T10:19:54.640Z","dependency_job_id":null,"html_url":"https://github.com/alshedivat/keras-gp","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/alshedivat/keras-gp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alshedivat%2Fkeras-gp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alshedivat%2Fkeras-gp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alshedivat%2Fkeras-gp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alshedivat%2Fkeras-gp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alshedivat","download_url":"https://codeload.github.com/alshedivat/keras-gp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alshedivat%2Fkeras-gp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274088625,"owners_count":25220260,"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-09-07T02:00:09.463Z","response_time":67,"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":["gaussian-processes","keras","machine-learning","neural-networks","tensorflow","theano"],"created_at":"2024-10-03T10:29:18.364Z","updated_at":"2025-09-07T20:10:45.038Z","avatar_url":"https://github.com/alshedivat.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Gaussian Processes for Keras\n----------------------------\n\n[![Build Status](https://travis-ci.org/alshedivat/keras-gp.svg)](https://travis-ci.org/alshedivat/keras-gp)\n[![Coverage Status](https://coveralls.io/repos/github/alshedivat/keras-gp/badge.svg)](https://coveralls.io/github/alshedivat/keras-gp)\n[![license](https://img.shields.io/github/license/mashape/apistatus.svg?maxAge=2592000)](https://github.com/alshedivat/keras-gp/blob/master/LICENSE)\n\nKGP extends [Keras](https://github.com/fchollet/keras/) with Gaussian Process (GP) layers.\nIt allows one to build flexible GP models with kernels structured with [deep](http://jmlr.org/proceedings/papers/v51/wilson16.pdf) and [recurrent](https://arxiv.org/abs/1610.08936) networks built with Keras.\nThe structured part of the model (the neural net) runs on [Theano](http://deeplearning.net/software/theano/) or [Tensorflow](https://www.tensorflow.org/).\nThe GP layers use a custom backend based on [GPML 4.0](http://www.gaussianprocess.org/gpml/code/matlab/doc/) library, and builds on [KISS-GP](http://www.jmlr.org/proceedings/papers/v37/wilson15.pdf) and [extensions](https://arxiv.org/abs/1511.01870).\nThe models can be trained in stages or jointly, using full-batch or semi-stochastic optimization approaches (see [our paper](https://arxiv.org/abs/1610.08936)).\nFor additional resources and tutorials on Deep Kernel Learning and KISS-GP see\n[https://people.orie.cornell.edu/andrew/code/](https://people.orie.cornell.edu/andrew/code/)\n\n\nKGP is compatible with: Python **2.7-3.5**.\n\nIn particular, this package implements the method described in our paper: \u003cbr\u003e\n**Learning Scalable Deep Kernels with Recurrent Structure** \u003cbr\u003e\nMaruan Al-Shedivat, Andrew Gordon Wilson, Yunus Saatchi, Zhiting Hu, Eric P. Xing \u003cbr\u003e\n[Journal of Machine Learning Research](https://arxiv.org/abs/1610.08936), 2017.\n\n\n## Getting started\n\nKGP allows to build models in the same fashion as Keras, using the [functional API](https://keras.io/getting-started/functional-api-guide/).\nFor example, a simple GP-RNN model can be built and compiled in just a few lines of code:\n\n```python\nfrom keras.layers import Input, SimpleRNN\nfrom keras.optimizers import Adam\n\nfrom kgp.layers import GP\nfrom kgp.models import Model\nfrom kgp.losses import gen_gp_loss\n\ninput_shape = (10, 2)  # 10 time steps, 2 dimensions\nbatch_size = 32\nnb_train_samples = 512\ngp_hypers = {'lik': -2.0, 'cov': [[-0.7], [0.0]]}\n\n# Build the model\ninputs = Input(shape=input_shape)\nrnn = SimpleRNN(32)(inputs)\ngp = GP(gp_hypers,\n        batch_size=batch_size,\n        nb_train_samples=nb_train_samples)\noutputs = [gp(rnn)]\nmodel = Model(inputs=inputs, outputs=outputs)\n\n# Compile the model\nloss = [gen_gp_loss(gp) for gp in model.output_layers]\nmodel.compile(optimizer=Adam(1e-2), loss=loss)\n```\n\nNote that KGP models support arbitrary off-the-shelf optimizers from Keras.\n\n**Further resources:**\n- A [quick tutorial](https://github.com/alshedivat/keras-gp/tree/master/tutorials) that walks you through the key components of the library.\n- A few more [examples](https://github.com/alshedivat/kgp/tree/master/examples).\n\n\n## Installation\n\nKGP depends on [Keras](https://github.com/fchollet/keras/) and requires either [Theano](http://deeplearning.net/software/theano/) or [TensorFlow](http://tensorflow.org/) being installed.\nThe GPML backend requires either MATLAB or Octave and a corresponding Python interface package: [Oct2Py](https://blink1073.github.io/oct2py/) for Octave or the [MATLAB engine for Python](https://www.mathworks.com/help/matlab/matlab-engine-for-python.html).\nGenerally, MATLAB backend seems to provide faster runtime.\nHowever, if you compile the latest version of Octave with JIT and OpenBLAS support, the overhead gets reduced to minimum.\n\nIf you are using Octave, you will need the `statistics` package.\nYou can install the package using Octave-Forge:\n```bash\n$ octave --eval \"pkg install -forge -verbose io\"\n$ octave --eval \"pkg install -forge -verbose statistics\"\n```\n\nThe requirements can be installed via [pip](https://pypi.python.org/pypi/pip) as follows (use `sudo` if necessary):\n\n```bash\n$ pip install -r requirements.txt\n```\n\nTo install the package, clone the repository and run `setup.py` as follows:\n\n```bash\n$ git clone --recursive https://github.com/alshedivat/kgp\n$ cd kgp\n$ python setup.py develop [--user]\n```\n\nThe `--user` flag (optional) will install the package for a given user only.\n\n**Note:** Recursive clone is required to get GPML library as a submodule.\nIf you already have a copy of GPML, you can set `GPML_PATH` environment variable to point to your GPML folder instead.\n\n## Contribution\n\nContributions and especially bug reports are more than welcome.\n\n## Citation\n\n```bibtex\n@article{alshedivat2017srk,\n  title={Learning scalable deep kernels with recurrent structure},\n  author={Al-Shedivat, Maruan and Wilson, Andrew Gordon and Saatchi, Yunus and Hu, Zhiting and Xing, Eric P},\n  journal={Journal of Machine Learning Research},\n  volume={18},\n  number={1},\n  year={2017},\n}\n```\n\n## License\n\nFor questions about the code and licensing details, please contact [Maruan Al-Shedivat](https://www.cs.cmu.edu/~mshediva/) and [Andrew Gordon Wilson](https://people.orie.cornell.edu/andrew).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falshedivat%2Fkeras-gp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falshedivat%2Fkeras-gp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falshedivat%2Fkeras-gp/lists"}