{"id":17336824,"url":"https://github.com/wesselb/neuralprocesses","last_synced_at":"2025-04-04T11:16:57.867Z","repository":{"id":37957762,"uuid":"323677247","full_name":"wesselb/neuralprocesses","owner":"wesselb","description":"A framework for composing Neural Processes in Python","archived":false,"fork":false,"pushed_at":"2024-12-17T21:08:13.000Z","size":8390,"stargazers_count":82,"open_issues_count":8,"forks_count":15,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-28T10:05:06.474Z","etag":null,"topics":["machine-learning","meta-learning","neural-processes"],"latest_commit_sha":null,"homepage":"https://wesselb.github.io/neuralprocesses","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/wesselb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2020-12-22T16:25:33.000Z","updated_at":"2025-03-11T23:21:34.000Z","dependencies_parsed_at":"2025-01-09T01:18:15.319Z","dependency_job_id":null,"html_url":"https://github.com/wesselb/neuralprocesses","commit_stats":{"total_commits":786,"total_committers":16,"mean_commits":49.125,"dds":"0.15267175572519087","last_synced_commit":"51da29336a1c649d34129bf7789f034c7f297af9"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesselb%2Fneuralprocesses","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesselb%2Fneuralprocesses/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesselb%2Fneuralprocesses/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wesselb%2Fneuralprocesses/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wesselb","download_url":"https://codeload.github.com/wesselb/neuralprocesses/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247166171,"owners_count":20894654,"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","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":["machine-learning","meta-learning","neural-processes"],"created_at":"2024-10-15T15:32:38.903Z","updated_at":"2025-04-04T11:16:57.833Z","avatar_url":"https://github.com/wesselb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Neural Processes](http://github.com/wesselb/neuralprocesses)\n\n[![CI](https://github.com/wesselb/neuralprocesses/workflows/CI/badge.svg)](https://github.com/wesselb/neuralprocesses/actions?query=workflow%3ACI)\n[![Coverage Status](https://coveralls.io/repos/github/wesselb/neuralprocesses/badge.svg?branch=main)](https://coveralls.io/github/wesselb/neuralprocesses?branch=master)\n[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://wesselb.github.io/neuralprocesses)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n\nA framework for composing Neural Processes in Python.\n\n## Installation\n\n```\npip install neuralprocesses tensorflow tensorflow-probability  # For use with TensorFlow\npip install neuralprocesses torch                              # For use with PyTorch\n```\n\nIf something is not working or unclear, please feel free to open an issue.\n\n## Documentation\n\nSee [here](https://wesselb.github.io/neuralprocesses).\n\n## TL;DR! Just Get me Started!\n\nHere you go:\n\n```python\nimport torch\n\nimport neuralprocesses.torch as nps\n\n# Construct a ConvCNP.\nconvcnp = nps.construct_convgnp(dim_x=1, dim_y=2, likelihood=\"het\")\n\n# Construct optimiser.\nopt = torch.optim.Adam(convcnp.parameters(), 1e-3)\n\n# Training: optimise the model for 32 batches.\nfor _ in range(32):\n    # Sample a batch of new context and target sets. Replace this with your data. The\n    # shapes are `(batch_size, dimensionality, num_data)`.\n    xc = torch.randn(16, 1, 10)  # Context inputs\n    yc = torch.randn(16, 2, 10)  # Context outputs\n    xt = torch.randn(16, 1, 15)  # Target inputs\n    yt = torch.randn(16, 2, 15)  # Target output\n\n    # Compute the loss and update the model parameters.\n    loss = -torch.mean(nps.loglik(convcnp, xc, yc, xt, yt, normalise=True))\n    opt.zero_grad(set_to_none=True)\n    loss.backward()\n    opt.step()\n\n# Testing: make some predictions.\nmean, var, noiseless_samples, noisy_samples = nps.predict(\n    convcnp,\n    torch.randn(16, 1, 10),  # Context inputs\n    torch.randn(16, 2, 10),  # Context outputs\n    torch.randn(16, 1, 15),  # Target inputs\n)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwesselb%2Fneuralprocesses","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwesselb%2Fneuralprocesses","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwesselb%2Fneuralprocesses/lists"}