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)

Using 2-dimensional embedding module for learning data on sphere:

import torch
from torch_geopooling.nn import Embedding2d

embedding = Embedding2d((16, 16, 2), padding=(3, 3), exterior=(-100, 100, 200.0, 200.0))
input = torch.DoubleTensor(1024, 2).normal_(5.0, 1.0)
output = embedding(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.2-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.2-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.2-cp312-cp312-macosx_11_0_arm64.whl (227.7 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

torch_geopooling-1.1.2-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.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (8.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

torch_geopooling-1.1.2-cp311-cp311-macosx_11_0_arm64.whl (228.8 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

torch_geopooling-1.1.2-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.2-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.2-cp310-cp310-macosx_11_0_arm64.whl (227.5 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

torch_geopooling-1.1.2-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.2-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.2-cp39-cp39-macosx_11_0_arm64.whl (227.6 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4730eb4d669b5535a99d7020e1f83f2a3843b807d16f780e6a847dcbd7d150d0
MD5 0bc1bc6828a793e475b950fb47f399c7
BLAKE2b-256 f4139cb2103a0a8db20eb867d9d8a6fed358dc122a3d3f0a8e04547cd64d527f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f4b6b4e01420c107349614ef0c639ccb1ba9e7a9251f240178de683d8a007872
MD5 aad085e2d78cdefb38bf69238e57fb88
BLAKE2b-256 ea3a7590f400795a6454a9ff37364cdefcc0c9123c6584a21bbf55c7f1b4d253

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.2-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 37640ff650c10da5fa6701589fe59d78c0b57be10c46898ab60d7eb9ef39d2e9
MD5 f47acc0816f2c728eef80dcf1b23f4d7
BLAKE2b-256 a9df0dec317213dd9ae57d034a3f2bef08f088a76546a51b0f2afdc706d34f71

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bd404d132c708766828e5cd49c9bd61878654fc83cf0386da98f6abded45a620
MD5 f2a28c11261922008fb5bc900bd2930f
BLAKE2b-256 e51c6a521336eb58974a522412585371dce65649f9b54a46478062d3e5412b3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 b20d159d247b700e5ffa8ea7b23a830685ae3087c74b632d91ab50917bcdec86
MD5 19400c7b8768a50d7c60ea0325d31b6c
BLAKE2b-256 0d679b54383fd5ec78874bfa53a9cbe7dff8f939e1f94051e9b700340a5c2627

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.2-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ebc5523944563eb142f7d3d16ad915e1d8fa434ad7436810d9c9d79bdc121c41
MD5 244adc21d89b68ade7f6d1cb119df2f0
BLAKE2b-256 61a889f042cf3269a379e983c2cf57ec4d097465a785176eb61db7e7ac799715

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 12578941330ef60fafc8e9a7ac4977f0e0cd79d080c39f815af12e24de9abc0f
MD5 b057d6011eeefe3dcc76dedcd0aa406a
BLAKE2b-256 c6250c401fb2d7499b483eef4201fa98d2c8c2618c496eeacbfe18bed0bc5e91

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f0043b046b9addedabe706cbe6c43923cd4a54d539840a1a6e456a3968ad1593
MD5 97aa28eb01b3719ae90d3784dd17d0d7
BLAKE2b-256 781745732cd238e11565fa0c99335374df438b3142915771934024eb053c2a51

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.2-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 971d541beca31fc994a486d3c913fa6ba0e9bcd61208549383cf627ebbf5c6ee
MD5 fd1978df457d420b1ff0276d8c9a1c8a
BLAKE2b-256 8ddc3fec0cec8be1faf46553c5ebd9c68941ec56ac8f84faadf66c7bbbb4ca93

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 ad5b5b1aee78c695256bf07f4201c9e2070585799f6641d8bed15036a77d331f
MD5 031b904d580bb14345e6966d6d036200
BLAKE2b-256 bd9f2dc1821f128aa4c24f47b2d33197a6f4e192bb547806212a6398b1f4e7f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 80323b56aa3bf7ec8515bc875f7c5fbe7faa0359e0ba963a58f974fba0e13095
MD5 500ec9023afdc7c8b5d589fb0645bca8
BLAKE2b-256 abfabce1386a3db6d9c92e995a58a4a3d824e2a54d28c8f64a608d21a402cc95

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.2-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 858b7c6724b530a85cb8d0ad242997df6cb7b401555a323b77c468b31ed56ec7
MD5 a527a162843ccae5a7ef517e8a5b1ce4
BLAKE2b-256 e9f79c090ca2890990d071252baabf50b7dfa346c92632a328cc81816d79ab81

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