{"id":15664496,"url":"https://github.com/ybubnov/torch_geopooling","last_synced_at":"2025-09-01T20:40:37.058Z","repository":{"id":248276448,"uuid":"763694586","full_name":"ybubnov/torch_geopooling","owner":"ybubnov","description":"The geospatial pooling modules for neural networks in PyTorch","archived":false,"fork":false,"pushed_at":"2024-10-10T19:58:54.000Z","size":7501,"stargazers_count":19,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-12T12:12:59.030Z","etag":null,"topics":["deep-learning","deep-learning-library","geospatial","machine-learning","python","pytorch"],"latest_commit_sha":null,"homepage":"https://torch-geopooling.readthedocs.io","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ybubnov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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},"funding":{"github":["ybubnov"]}},"created_at":"2024-02-26T18:54:04.000Z","updated_at":"2025-02-07T13:14:17.000Z","dependencies_parsed_at":"2024-08-14T22:28:38.190Z","dependency_job_id":"43b13d21-f890-4749-b53b-c6c650c14057","html_url":"https://github.com/ybubnov/torch_geopooling","commit_stats":null,"previous_names":["ybubnov/torch_geopooling"],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybubnov%2Ftorch_geopooling","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybubnov%2Ftorch_geopooling/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybubnov%2Ftorch_geopooling/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ybubnov%2Ftorch_geopooling/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ybubnov","download_url":"https://codeload.github.com/ybubnov/torch_geopooling/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710437,"owners_count":21149188,"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":["deep-learning","deep-learning-library","geospatial","machine-learning","python","pytorch"],"created_at":"2024-10-03T13:42:49.381Z","updated_at":"2025-04-13T11:52:37.925Z","avatar_url":"https://github.com/ybubnov.png","language":"C++","funding_links":["https://github.com/sponsors/ybubnov"],"categories":[],"sub_categories":[],"readme":"# Torch Geopooling - The geospatial pooling library for PyTorch\n\nThe Torch Geopooling library is an extension for PyTorch library that provide extra layers for\nbuilding geospatial neural networks.\n\nHere is an example of how you can use modules from Torch Geopooling library to train neural\nnetworks predicting geospatial features:\n![example](docs/index.png)\n\n## Installation\n\nThe library is distributed as PyPI package, to install that package, execute the following\ncommand:\n```sh\npip install torch_geopooling\n```\n\nYou can use the `torch_geopooling` library for building neural networks with geospatial indexing.\nThe interface of the provided modules is compatible with [PyTorch](https://pytorch.org) library,\nincluding automatic gradient computation.\n\n## Documentation\n\nThe [Torch Geopooling Documentation](https://torch-geopooling.readthedocs.org) contains additional\ndetails on how to get started with this library as well a few examples of training neural networks\nthat use geo-pooling modules.\n\n## Usage\n\nThe module provides adaptive and regular modules that implement decomposition of point coordinates\nin 2-dimensional space. Decomposition in this context implies separation of the space into\nrectangles (quads).\n\nAdaptive modules are building the decomposition during the training, while for regular modules\nthe decomposition should be computed beforehand. As a result, adaptive module builds sparse\ndecomposition, while regular module builds dense (regular) decomposition.\n\nUsing adaptive decomposition module for [EPSG:4326](https://epsg.io/4326) coordinates:\n```py\nimport torch\nfrom torch_geopooling.nn import AdaptiveQuadPool2d\n\n# Create 5-feature vector for each node in a decomposition.\npool = AdaptiveQuadPool2d(5, (-180, -90, 360, 180), max_depth=12, capacity=10)\ninput = torch.DoubleTensor(1024, 2).uniform_(-90, 90)\noutput = pool(input)\n```\n\nUsing regular decomposition module for arbitrary polygon:\n```py\nimport torch\nfrom shapely import Polygon\nfrom torch_geopooling.nn import QuadPool2d\n\n# Polygon for regular decomposition should be within an exterior boundary.\npoly = Polygon([(0.0, 0.0), (10.0, 0.0), (10.0, 10.0), (0.0, 10.0)])\nexterior = (-100.0, -100.0, 200.0, 200.0)\n# Create 3-feature vector for each node in a decomposition.\npool = QuadPool2d(3, poly, exterior, max_depth=10)\ninput = torch.DoubleTensor(200, 2).uniform_(0.0, 10.0)\noutput = pool(input)\n```\n\nUsing 2-dimensional embedding module for learning data on sphere:\n```py\nimport torch\nfrom torch_geopooling.nn import Embedding2d\n\nembedding = Embedding2d((16, 16, 2), padding=(3, 3), exterior=(-100, 100, 200.0, 200.0))\ninput = torch.DoubleTensor(1024, 2).normal_(5.0, 1.0)\noutput = embedding(input)\n```\n\n## License\n\nThe Torch Geopooling is distributed under GPLv3 license. See the [LICENSE](LICENSE) file for full\nlicense text.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fybubnov%2Ftorch_geopooling","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fybubnov%2Ftorch_geopooling","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fybubnov%2Ftorch_geopooling/lists"}