{"id":21182627,"url":"https://github.com/fandreuz/parallel-mapped-distance-matrix","last_synced_at":"2026-02-22T10:38:44.601Z","repository":{"id":107377318,"uuid":"548084608","full_name":"fandreuz/parallel-mapped-distance-matrix","owner":"fandreuz","description":"Parallel mapped distance matrix with NumPy and Numba","archived":false,"fork":false,"pushed_at":"2025-02-17T15:50:55.000Z","size":45,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-07T20:36:55.863Z","etag":null,"topics":["hacktoberfest","hpc","numba","numpy"],"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/fandreuz.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":"2022-10-08T22:32:22.000Z","updated_at":"2025-02-17T15:50:58.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4368112-36fa-4bc4-88de-ebb171afe78c","html_url":"https://github.com/fandreuz/parallel-mapped-distance-matrix","commit_stats":null,"previous_names":["fandreuz/parallel-mapped-distance-matrix"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fandreuz%2Fparallel-mapped-distance-matrix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fandreuz%2Fparallel-mapped-distance-matrix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fandreuz%2Fparallel-mapped-distance-matrix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fandreuz%2Fparallel-mapped-distance-matrix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fandreuz","download_url":"https://codeload.github.com/fandreuz/parallel-mapped-distance-matrix/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252954125,"owners_count":21830892,"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":["hacktoberfest","hpc","numba","numpy"],"created_at":"2024-11-20T17:57:32.735Z","updated_at":"2026-02-22T10:38:39.570Z","avatar_url":"https://github.com/fandreuz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Parallel MDM\n\n## Mapped distance matrix\nThe Mapped Distance Matrix (MDM) of two sets $\\mathcal{X}, \\mathcal{Y}$ of\nn-dimensional points is an algebraic structure which is defined in general as\nfollows, given a mapping $f$:\n\n$$\\mathbf{M}(\\mathcal{X}, \\mathcal{Y}, f)\\_{i,j} := f(\\Vert \\mathcal{X}\\_i - \\mathcal{Y}\\_j\\Vert)$$\n\nwhere $\\Vert \\cdot \\Vert$ is an appropriate distance notion on the space of\ndefinition of $\\mathcal{X}$ and $\\mathcal{Y}$.\n\nThe problem might be augmented by weighting the contributions with a matrix\nof weights $\\mathbf{W}$; the updated definition is then:\n\n$$\\mathbf{M}(\\mathcal{X}, \\mathcal{Y}, f)\\_{i,j} := \\mathbf{W}_{i,j} f(\\Vert \\mathcal{X}\\_{i} - \\mathcal{Y}\\_{j}\\Vert)$$\n\nA particularly popular form of the problem (which is also what we treat in this\nrepository) occurs when weights are defined individually for the members of\n$\\mathcal{Y}$ (i.e. the columns of $\\mathbf{W}$ are taken constants):\n\n$$\\mathbf{M}(\\mathcal{X}, \\mathcal{Y}, f)\\_{i,j} := \\mathbf{W}\\_{j} f(\\Vert \\mathcal{X}\\_{i} - \\mathcal{Y}\\_{j}\\Vert)$$\n\n### A notable case: uniform grid\n\nIn general $\\mathcal{X}, \\mathcal{Y}$ identify two general sets of points. A\nfew applications allow more assumptions on the two sets. For instance,\n$\\mathcal{X}$ might be taken to be an uniform grid. In this case a few\ninteresting optimizization can be taken into account for the computation of the\nmatrix.\n\n### More assumptions\n\nPractical applications usually require huge sets of points, which causes\nmemory errors on commonly used devices. This is why it's preferrable to\ncompute the vector $\\tilde{\\mathbf{M}}$ defined below instead of $\\mathbf{M}$:\n\n$$\\tilde{\\mathbf{M}}\\_{i} := \\sum\\_{j} \\mathbf{M}\\_{i,j}$$\n\nFor most use cases this is enough.\n\n## Roadmap\n- Algorithms\n  - [x] Uniform grid algorithm\n  - [x] Scattered points algorithm\n  - [ ] Fourier-transfor based algorithm\n- [ ] Backends\n  - [ ] NumPy/Numba\n  - [ ] PyTorch\n  - [ ] JAX(?)\n- [ ] Parallelization\n  - [x] Multithreading/Multiprocessing\n  - [ ] GPU w/ PyTorch\n  - [ ] GPU w/ JAX\n  - [ ] CUDA kernels(?)\n- [ ] Tests\n- [ ] Documentation\n- [ ] Benchmark (+comparison with competitors)\n  - [ ] CPU\n  - [ ] GPU\n  - [ ] Several different bin sizes\n  - [ ] `pts_per_future`\n- [ ] Future\n  - [ ] Periodicity\n  - [ ] More general about distance definitions\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffandreuz%2Fparallel-mapped-distance-matrix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffandreuz%2Fparallel-mapped-distance-matrix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffandreuz%2Fparallel-mapped-distance-matrix/lists"}