Skip to main content

The geospatial pooling modules for neural networks in PyTorch

Project description

Torch Geopooling - The geospatial pooling library for PyTorch

The Torch Geopooling library is an extension for PyTorch library that provide extra layers for building geospatial neural networks.

Here is an example of how you can use modules from Torch Geopooling library to train neural networks predicting geospatial features: example

Installation

The library is distributed as PyPI package, to install that package, execute the following command:

pip install torch_geopooling

You can use the torch_geopooling library for building neural networks with geospatial indexing. The interface of the provided modules is compatible with PyTorch library, including automatic gradient computation.

Documentation

The Torch Geopooling Documentation contains additional details on how to get started with this library as well a few examples of training neural networks that use geo-pooling modules.

Usage

The module provides adaptive and regular modules that implement decomposition of point coordinates in 2-dimensional space. Decomposition in this context implies separation of the space into rectangles (quads).

Adaptive modules are building the decomposition during the training, while for regular modules the decomposition should be computed beforehand. As a result, adaptive module builds sparse decomposition, while regular module builds dense (regular) decomposition.

Using adaptive decomposition module for EPSG:4326 coordinates:

import torch
from torch_geopooling.nn import AdaptiveQuadPool2d

# Create 5-feature vector for each node in a decomposition.
pool = AdaptiveQuadPool2d(5, (-180, -90, 360, 180), max_depth=12, capacity=10)
input = torch.DoubleTensor(1024, 2).uniform_(-90, 90)
output = pool(input)

Using regular decomposition module for arbitrary polygon:

import torch
from shapely import Polygon
from torch_geopooling.nn import QuadPool2d

# Polygon for regular decomposition should be within an exterior boundary.
poly = Polygon([(0.0, 0.0), (10.0, 0.0), (10.0, 10.0), (0.0, 10.0)])
exterior = (-100.0, -100.0, 200.0, 200.0)
# Create 3-feature vector for each node in a decomposition.
pool = QuadPool2d(3, poly, exterior, max_depth=10)
input = torch.DoubleTensor(200, 2).uniform_(0.0, 10.0)
output = pool(input)

License

The Torch Geopooling is distributed under GPLv3 license. See the LICENSE file for full license text.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

torch_geopooling-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.0 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

torch_geopooling-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (7.9 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

torch_geopooling-1.1.0-cp312-cp312-macosx_11_0_arm64.whl (227.1 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

torch_geopooling-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

torch_geopooling-1.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (7.9 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

torch_geopooling-1.1.0-cp311-cp311-macosx_11_0_arm64.whl (228.4 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

torch_geopooling-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

torch_geopooling-1.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (7.9 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

torch_geopooling-1.1.0-cp310-cp310-macosx_11_0_arm64.whl (226.8 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

torch_geopooling-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (8.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

torch_geopooling-1.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (7.9 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

torch_geopooling-1.1.0-cp39-cp39-macosx_11_0_arm64.whl (227.0 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

File details

Details for the file torch_geopooling-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.1.0-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 8985d26d2050642e2e5c3bf2d169ab4a0f21b60fc4e18a87ddbd17c30207352e
MD5 c8ab5c88dbd0c5f28af3a410f051d3a8
BLAKE2b-256 2804a1a7f79a3bc6d1f997d4c52b31d5e9f6a4e0bacb86a78789526dac748424

See more details on using hashes here.

File details

Details for the file torch_geopooling-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.1.0-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 52e9b52875a3a0088a52323ca5353e0d12bc4dd91e37066923061d521af516bc
MD5 51518626bf53e2dd37284e596f42b339
BLAKE2b-256 04273de79e40d9950638880f6b5ff8f24c3cbdb1bdcfee00e894ba59bf2ea2d1

See more details on using hashes here.

File details

Details for the file torch_geopooling-1.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5745e8e5aec6b7df242fdab5dfae9b549c9cc8f840301e4a5ee688a080032f8b
MD5 093838b1b539dada2e7966e9f0867ef2
BLAKE2b-256 10cedc7141e746c84b578e4d471c0a20bbf71704199b9536315fbf7d785399a7

See more details on using hashes here.

File details

Details for the file torch_geopooling-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.1.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b405cee8dedf6a35cc415b85dd8873fddfaef55b10d3f84dfb55371a61e7350b
MD5 d6965460cc66a4c2ba2a80e0761d4071
BLAKE2b-256 521ed9c89e86db35a9e068a78dbe9d90a0c76dd0e835b6c44944f1a79dcd7925

See more details on using hashes here.

File details

Details for the file torch_geopooling-1.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.1.0-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c982fadfdfe4377807edb54676b560409c8bd7cd94f7c015cd4a15992cca6860
MD5 50706ce0394bc7d5c905c836672afe04
BLAKE2b-256 57d7e1af84717360cf021bd5bc4516b1dd5f696ee5816fc737f2ed351304c3fa

See more details on using hashes here.

File details

Details for the file torch_geopooling-1.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d9a028e3509ba4e7e7a94555ac448bab80a8dbd232cc65d0729e2eb1c7432aee
MD5 73e481e46d7d20a53c673f07970b6a2c
BLAKE2b-256 d755389e39b106d8c1b1b6fb504307005b23464e8f3bec662665f58c50ab8e0d

See more details on using hashes here.

File details

Details for the file torch_geopooling-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.1.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d4206dda405194e2824acc680b0b63442b23776c081de6d914944007d2319d21
MD5 4845ac3a00bd4b076ec1282c22ea1133
BLAKE2b-256 4024f0e98696d72ee7c60df0be5928ebd97e43e8940442baf23e94abce2d0ad3

See more details on using hashes here.

File details

Details for the file torch_geopooling-1.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.1.0-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8bc773aae95c6ed457bd00ba5dbd7c3ad74c315747dbf8e0011bebdb23d3721a
MD5 4128b6110e07dec8eb762d1297bd219b
BLAKE2b-256 dee6a8ba84cf591c70a9a0a2f9265d4e1a7d4a47d400f3fe8b531a4e8d561a7d

See more details on using hashes here.

File details

Details for the file torch_geopooling-1.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 aa38ff3385c6b41e225a45bbb4546f7941c3e93ff00343825152999f3b85d60b
MD5 d0aba91fa685cd54ecd0706a349bb2a4
BLAKE2b-256 a8a88c83d22bfdb844a5c8d9e549258d4f39e8e6dc010d479610efa34e096795

See more details on using hashes here.

File details

Details for the file torch_geopooling-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.1.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3093fa160ce9a0df44eb0ce93d9a0b05cc0b4fb4552362a9fc33f9569a1f9904
MD5 7c981dda777747475bd556cdbe2103e3
BLAKE2b-256 a2d6ac98c3996aa86697ae0ffb1857340e40555ae5f2394ba4f7c809fb5fd5a6

See more details on using hashes here.

File details

Details for the file torch_geopooling-1.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.1.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 aa834266cd93ccdf245374274881eaf31865094c2c43e2b8938444f86cfb4aa7
MD5 b0daea70f539cd1df8a30479acd70858
BLAKE2b-256 5a96684d56c52b4185d9d4624bad9bb7d2762dbcf5150a154b40973d193311df

See more details on using hashes here.

File details

Details for the file torch_geopooling-1.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4eaa1fe63dc7e38697161a8cb798d7b8a729f104bac97f43c39689ad3a665bb4
MD5 e29cc914e84c1a0f9daea99a388e24db
BLAKE2b-256 9cbd43dc518c08be8d4a3d3729b521e69f9c2ecfc8eac5c5fc90af926097b35b

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page