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.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ x86-64

torch_geopooling-1.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.0 MB view details)

Uploaded CPython 3.12 manylinux: glibc 2.17+ ARM64

torch_geopooling-1.0.1-cp312-cp312-macosx_11_0_arm64.whl (208.0 kB view details)

Uploaded CPython 3.12 macOS 11.0+ ARM64

torch_geopooling-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.1 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ x86-64

torch_geopooling-1.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.0 MB view details)

Uploaded CPython 3.11 manylinux: glibc 2.17+ ARM64

torch_geopooling-1.0.1-cp311-cp311-macosx_11_0_arm64.whl (209.9 kB view details)

Uploaded CPython 3.11 macOS 11.0+ ARM64

torch_geopooling-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ x86-64

torch_geopooling-1.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.0 MB view details)

Uploaded CPython 3.10 manylinux: glibc 2.17+ ARM64

torch_geopooling-1.0.1-cp310-cp310-macosx_11_0_arm64.whl (208.3 kB view details)

Uploaded CPython 3.10 macOS 11.0+ ARM64

torch_geopooling-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (6.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ x86-64

torch_geopooling-1.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (6.0 MB view details)

Uploaded CPython 3.9 manylinux: glibc 2.17+ ARM64

torch_geopooling-1.0.1-cp39-cp39-macosx_11_0_arm64.whl (208.5 kB view details)

Uploaded CPython 3.9 macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.0.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 4cd393da5b0b848be30f9c53f92182a043f139ab2d8572db10248063909d9a02
MD5 aee430996a6c110f10dd865bd2903aa9
BLAKE2b-256 ebea7b9c685b774ef0383f922184a0c7350ac66b314017ce2543b39028890859

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.0.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 6ee3870ce057af2651e764be0277590b9ddd13f3317ece3e4865fce1e7184a14
MD5 3c46c654a858c3ff2bfb89c16e6db1f3
BLAKE2b-256 95e519e7eed2241798948ca1ae2ac4209b47e2933ada1d6b37e23450a97b3bc0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.0.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8b23cd301d9582b4a142ab271bf0d632dbc0e35c0c95aee7cdb544155e4344fe
MD5 5dd294cde6309930cae6d189923c921a
BLAKE2b-256 48a1c6ad06371d942c6dfe84c5185a5b2090b08eccdc8b379614df751f3c048c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.0.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b244bb48c91e35003a8f93319155bcde82850674aa708358fb5e074d64ace6d6
MD5 82d558f131fb32392d0b6452eb567bb0
BLAKE2b-256 fc9df11f924489739404f1ace92174cbfc3f756ab4bc156298a944dcbcce19c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.0.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 91c5d501870943807c8289a86000319ed2037cc46e29f221709023af5c51caed
MD5 cadba6f2379671549d3325e0ee32f0be
BLAKE2b-256 e2a96750f8291997c5acfbfbbe4c4fa65fc3dfa7d5de8ae9a1cfd4160263f885

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.0.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4c1b2efb30e805d2dea53bf0ec856574033f759843161e904f753703e59a830a
MD5 9bdfc0a84591f50d508f6db2b5dd6275
BLAKE2b-256 8d617fe64d01b36d4c6db416c7a7392d3c9c53476df65cd9c38a7067d66ad34c

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.0.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c46aa43ced883bc04d596d8efca418e45deb18b9ceb35751b2cea4b9c381c1d1
MD5 7b27112e7cc3b654bbacb64f70a2bc37
BLAKE2b-256 fb77f2e1136f0134c9df0c40b72723269d4f13747fcaef7bf4c79d3e3c8f55a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 314b04b5a7ec7ab233868c35a3e7db9a1a85edc134f6f16924c63ab295551317
MD5 f3a4f8be8fa0c5cf9969fdfdacf17364
BLAKE2b-256 7614b8d99a2ca08752c3f7fa6bffb5e9a32276613dbc0f5f1da46545ca8bb2cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.0.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 05ca69cf96e94897c8ed4a327a8b4aa2c9fa70ca51e8bc9fd74716b7e1d60cf3
MD5 15f8438fccc4a4942c66ae13407d987a
BLAKE2b-256 3868a35ff7cfe56285973697659bfdfbfec5322852410123171dda45c1398e0b

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.0.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 c2137718d629ec42e1de5d7ccf9c3eb1a99357dfd91df4d947dc660bc113a45e
MD5 07dc9803bf251c1c2960dd1077b6b97f
BLAKE2b-256 d1ef1f39e105833a07fbaf79e03b8e7a882394ec726cd20e509d22ddcc78f5cf

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 87b9ca44c41875638e9eccfe526e239ea443b3a9d2b7c7aa7191b7697b551d06
MD5 7e33f6621d3347b0b1cc888a74e8a677
BLAKE2b-256 c8a52c9a2dde0039a0fa045c35a31d3f77d18bb5fc17a1c6883b2ea3f211cdbc

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.0.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5b1e66b54d41bb806a60ce74a4ed7a481c3f55db4742be92bd922d516add76bf
MD5 b9ccfe0083ac122531ba8333d8addab6
BLAKE2b-256 085f1d072f09b072c73fe5218a6c0899ab3b61f7303ea104cdcfa8128ab1c471

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