{"id":15600886,"url":"https://github.com/beegass/hippo-jax","last_synced_at":"2025-09-21T13:18:26.839Z","repository":{"id":164616843,"uuid":"614164117","full_name":"BeeGass/HiPPO-Jax","owner":"BeeGass","description":"Implementing and testing HiPPO and S4","archived":false,"fork":false,"pushed_at":"2023-12-26T01:14:55.000Z","size":214366,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-10-10T02:40:55.638Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"Dana-Farber-AIOS/HiPPO-Jax","license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/BeeGass.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-03-15T02:47:08.000Z","updated_at":"2024-02-05T06:32:30.000Z","dependencies_parsed_at":"2023-12-24T04:33:02.351Z","dependency_job_id":null,"html_url":"https://github.com/BeeGass/HiPPO-Jax","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeeGass%2FHiPPO-Jax","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeeGass%2FHiPPO-Jax/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeeGass%2FHiPPO-Jax/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/BeeGass%2FHiPPO-Jax/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/BeeGass","download_url":"https://codeload.github.com/BeeGass/HiPPO-Jax/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":236335823,"owners_count":19132817,"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":[],"created_at":"2024-10-03T02:07:08.294Z","updated_at":"2025-09-21T13:18:21.785Z","avatar_url":"https://github.com/BeeGass.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HiPPO-Jax\n\n\u003cimg src=https://upload.wikimedia.org/wikipedia/commons/thumb/e/eb/Typical_State_Space_model.svg/472px-Typical_State_Space_model.svg.png width=600\u003e\n\nThis repo uses ideas and code that can be both found at [HazyResearch/state-spaces](https://github.com/HazyResearch/state-spaces). This code base implements the ideas and code in jax. \n\n## Installation\n\nThere are several ways to install HiPPO-Jax:\n\n1. Use a package manager\n    1. poetry install (recommended for users)\n    2. pip install from PyPI\n2. Clone repo to local machine and install from source (recommended for developers/contributors)\n\nEnsure your [CUDA drivers](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#installation) have been installed correctly, this will effect dependencies like [Jax](https://github.com/google/jax#installation) and [PyTorch](https://pytorch.org/)\n\nNote: these instructions are for Linux. Commands may be different for other platforms.\n\n### Installation option 1: poetry install\n\n---\n\n1. Install [poetry](https://python-poetry.org/):\n\n```bash\ncurl -sSL https://install.python-poetry.org | python3 -\n```\n\n2. Ensure python version is set to 3.8:\n\n```bash\n$ python --version\n\u003e 3.8.x\n```\n\n3. Activate poetry virtual environment\n\n```bash\npoetry shell\n```\n\n4. (optional) Update the dependencies to ensure dependencies work with your system\n\n```bash\npoetry update\n```\n\n5. Install lock file dependencies:\n\n```bash\npoetry install --with jax,torch,mltools,jupyter,additional,dataset\n```\n\n### Installation option 1: pip install\n\n---\n\n1. Create and activate virtual environment\n\n```bash\nconda create --name hippo_jax python=3.8\nconda activate hippo_jax\n```\n\n2. Install dependencies\n\n```bash\npip install -r requirements.txt\n```\n\n### Installation option 2: clone repo and install from source\n\n---\n\n1. Clone repo:\n\nvia HTTPS:\n\n```bash\ngit clone https://github.com/Dana-Farber-AIOS/HiPPO-Jax.git\ncd HiPPO-Jax\n```\n\nvia SSH\n\n```bash\ngit clone git@github.com:Dana-Farber-AIOS/HiPPO-Jax.git\ncd HiPPO-Jax\n```\n\n2. Create conda environment:\n\n```bash\nconda env create -f requirements.txt\nconda activate hippo_jax\n```\n\n3. Install `Hippo-Jax` from source:\n\n```bash\npip install -e .\n```\n\nThats it!\n\n## Examples\n\n```python\nimport jax.random as jr\n\nkey, subkey = jr.split(jr.PRNGKey(0), 2)\n```\n\n**HiPPO Matrices**\n\n```python\nfrom src.models.hippo.transition import TransMatrix\n\nN = 100\nmeasure = \"legs\"\n\nmatrices = TransMatrix(N=N, measure=measure)\nA = matrices.A\nB = matrices.B\n```\n\n**HiPPO (LTI) Operator**\n\n```python\nfrom src.models.hippo.hippo import HiPPOLTI\n\nN = 50\nT = 3\nstep = 1e-3\nmeasure = \"legs\"\ndesc_val = 0.0\n\nhippo = HiPPOLTI(\n        N=N,\n        step_size=step,\n        GBT_alpha=desc_val,\n        measure=measure,\n        basis_size=T,\n        unroll=False,\n    )\n\n```\n\n**HiPPO (LSI) Operator**\n\n```python\nfrom src.models.hippo.hippo import HiPPOLSI\n\nN = 50\nT = 3\nstep = 1e-3\nL = int(T / step)\nmeasure = \"legs\"\ndesc_val = 0.0\n\nhippo = HiPPOLSI(\n        N=N,\n        max_length=L,\n        step_size=step,\n        GBT_alpha=desc_val,\n        measure=measure,\n        unroll=True,\n    )\n\n```\n\n**Use right out of the box, no training needed**\n\n```python\nparams = hippo.init(key, f=x)\nc, y = hippo.apply(params, f=x)\n```\n\n# Contributing\n\n`HiPPO-Jax` is an open source project. Consider contributing to benefit the entire community!\n\nThere are many ways to contribute to `HiPPO-Jax`, including:\n\n- Submitting bug reports\n- Submitting feature requests\n- Writing documentation and examples\n- Fixing bugs\n- Writing code for new features\n- Sharing workflows\n- Sharing trained model parameters\n- Sharing `HiPPO-Jax` with colleagues, students, etc.\n\n# License\n\nThe GNU GPL v2 version of HiPPO-Jax is made available via Open Source licensing.\nThe user is free to use, modify, and distribute under the terms of the GNU General Public License version 2.\n\nCommercial license options are available also.\n\n# Contact\n\nQuestions? Comments? Suggestions? Get in touch!\n\n[bagass@wpi.edu](mailto:bagass@wpi.edu)\n\n\u003cp align=\"center\"\u003e\n\u003cimg style=\"vertical-align:middle\" src=https://raw.githubusercontent.com/Dana-Farber-AIOS/pathml/master/docs/source/_static/images/dfci_cornell_joint_logos.png width=\"525\"\u003e\n\u003cimg style=\"vertical-align:middle\" src=https://www.wpi.edu/sites/default/files/inline-image/Offices/Marketing-Communications/WPI_Inst_Prim_FulClr_PREVIEW.png?1670371200029 width=200\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeegass%2Fhippo-jax","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeegass%2Fhippo-jax","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeegass%2Fhippo-jax/lists"}