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.3-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.3-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.3-cp312-cp312-macosx_11_0_arm64.whl (227.7 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

torch_geopooling-1.1.3-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.3-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.3-cp311-cp311-macosx_11_0_arm64.whl (228.8 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

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

Uploaded CPython 3.10 macOS 11.0+ ARM64

torch_geopooling-1.1.3-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.3-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.3-cp39-cp39-macosx_11_0_arm64.whl (227.7 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1862896fd6f7a14ad02b26e12d31136371cfce07dfe3e676ef38d71c1a73935a
MD5 a5258fcd9ad475335309f6b500663fe3
BLAKE2b-256 cf8443ec97895a857bf7314293debb10a13c637c050986e14167624b3562dd68

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 98353fa4a5bc75dcecbe6444a1eb5e3f1765a2babc56305d9a14e2dd9e64213d
MD5 e6917af018f14c42b960e4a53ca086dc
BLAKE2b-256 4d23b0dafcd45e80e4ea92b88e870c737eb525df2396f9983efefda0142d9783

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.3-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 e9b5bfb56b299ea5417253fe1330d38d53a4dc4082273b1957f4cb6ba282babb
MD5 40166f6c9661e23693e7e8040e8043db
BLAKE2b-256 4e986d5cc9ced9e6907df77f8f132243bf702fccf31894a2655c770e7d94feae

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 7ea2fbc833cb2311e2d68acf9f3ba6dff1c524a18cbb78cd0bc1b6f0e6e2c494
MD5 e0c83cb3d7034b59a6dbeea31855c8a9
BLAKE2b-256 9ddb1a413b9d81ff3f0bb2f8740970d262c9014d61fff18498aefba90aa73cdf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 5463429e1d1a4612dc71722bebb1ebbf6b0616bdf2881b18158ba2dad987616b
MD5 7230815b84f24a671af30954fce89b89
BLAKE2b-256 867e30bc2a3700b060d438db0dd013b31dcce92e52eaaf6d9e6b3d8ab2b406d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.3-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9b5959a02f09395aac236ab1af117663ec647a1485c4185dda250efffc352600
MD5 b616ab5fa81e2b9e7948518911ac1b56
BLAKE2b-256 439ca58204ff7ced9d6c16f31c8817f9419c32ee9cdf317120d13a0281c08b5e

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 6527acd6ff3a3accb80bc1b4d50fa2346a2c3b04583972aedb7daa3b9f3e01ee
MD5 9f86b943817cd5d43926a16ef8cbf931
BLAKE2b-256 d1c8e4e7c3cfeaba9ebd5218590a895d939b63c3fb66a6505dc75274e84ba619

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 2e9a757443bc51b938189290e14b05081849110ef5c40cf5bbd1067e47c76f86
MD5 664a5d53e7924115ed892903953d40dd
BLAKE2b-256 f7e2aee300c8ca82d72fbb0ed5393c6fb956e1bcab1f3c5c103bfcef2bdc3c9b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.3-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 112a99897fe7ef2312a85da8a0f18443f21c6771a7b1a97adeb6e048a8b5af1c
MD5 b85af29b7dd5499fbf25bd5cd3eb46cf
BLAKE2b-256 5f737e1633576c22f3cecc56ea86441808257f75b33f1cd051d752cb7bb2b70a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 71895361a7fda3623dcc129f0332129597ba35704ff17b7f5db89dfa1685bc6a
MD5 444e6c7371acfe773f437feaca2e83b4
BLAKE2b-256 bbba3648e2c79bfe7d66a0d446340c42af7a0bf033b19f57b47a10df6bd07128

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 60926bdaedc15cea74f5fdf25dd374fccff9bc74c174d5414417d8779bb256d7
MD5 84c370bc7037b44f8220f42f5d1d5e15
BLAKE2b-256 4c94b5626efc08560193179c5853211999fab8376822662d67ea714acd1ac188

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.1.3-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d49bd0c16838f5373ba84b7fed681867ea29baabb64cb4d510946cbc3da567a
MD5 d43b454e8fc4a560f3781efad7fd74c5
BLAKE2b-256 c4528561b293c81637b71bbbe71095a2ee3dff48b7c5cbfe40ccef0c4998e7e9

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