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

If you're not sure about the file name format, learn more about wheel file names.

torch_geopooling-1.3.0-cp312-cp312-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

torch_geopooling-1.3.0-cp312-cp312-manylinux_2_28_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

torch_geopooling-1.3.0-cp312-cp312-macosx_11_0_arm64.whl (507.6 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

torch_geopooling-1.3.0-cp311-cp311-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

torch_geopooling-1.3.0-cp311-cp311-manylinux_2_28_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

torch_geopooling-1.3.0-cp311-cp311-macosx_11_0_arm64.whl (510.7 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

torch_geopooling-1.3.0-cp310-cp310-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

torch_geopooling-1.3.0-cp310-cp310-manylinux_2_28_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

torch_geopooling-1.3.0-cp310-cp310-macosx_11_0_arm64.whl (509.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file torch_geopooling-1.3.0-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0d9fde9eac8a9931e43a0555eb8b304eb17a00b38efebe710eae2c09748f5495
MD5 b328f9618ef5692396eca73e522c4cc4
BLAKE2b-256 4aec3f7c8f65a60eb61ebbc723131da6f0d523dbfe576935c545b14f2f7b1d29

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.0-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: python_build_wheel.yaml on ybubnov/torch_geopooling

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_geopooling-1.3.0-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 b9dbd4c7d308d99b2f633bf49695233e764278dc0b36dd87a2d534bef2c68181
MD5 f56425428a0900e8cc08a7f6128f96af
BLAKE2b-256 8c16b7b0c8e5731d37812b31e90df5d73aef9e69855036ed554f22b66fac4d0b

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.0-cp312-cp312-manylinux_2_28_aarch64.whl:

Publisher: python_build_wheel.yaml on ybubnov/torch_geopooling

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.3.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 761de4229f649607e34e6c0b6b16c4e2bcae43144c2c20d555bfaf13189619c5
MD5 a222a0462c517a7437855af1cd0c129e
BLAKE2b-256 c3363c293b30c7895cfbfc27d02fccdff80ab25d65d50a60536a9426f79437bd

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.0-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: python_build_wheel.yaml on ybubnov/torch_geopooling

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_geopooling-1.3.0-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 38c6a293cef843a838a600695b76d941da45c7c2c7500b821f4fd23da107b0a6
MD5 9ad81b091f3bde877453a0c0f294a2cb
BLAKE2b-256 722ed0792d84d6260aeb41c100ea061732d9243e499d291964609891c9216ca7

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.0-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: python_build_wheel.yaml on ybubnov/torch_geopooling

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_geopooling-1.3.0-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 1ce40b0b36b391605e1e4d0a4fdc8ff5816c3963c316243e8e6e0ead8037b3ab
MD5 281de5fbbf64e9c647dc285516dc0945
BLAKE2b-256 f678a3cf62d886ba93005d659a38ebe12cd32462bf54b528ca0b20ebef1ab229

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.0-cp311-cp311-manylinux_2_28_aarch64.whl:

Publisher: python_build_wheel.yaml on ybubnov/torch_geopooling

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.3.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 983e2a5a4e0cf37ad253922c8598416d77ab95d9a229590c66ab435fcb29a53e
MD5 05c017b0c5468b2b8ee1119d12080954
BLAKE2b-256 7adf81d8ae244a21ddb0c19dbc45684b614110bdea39e9cd1bf522aa62cc55b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.0-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: python_build_wheel.yaml on ybubnov/torch_geopooling

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_geopooling-1.3.0-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2c3df63b64f54413547962dc0ad8209c774428d7fc1100f85c62666da64eeb4f
MD5 32aac45062408fae9a093e04cb031dd4
BLAKE2b-256 ff7a41ae6b309138cab43afe7b3f382bf0c3e5e75f0ca48116bc991115621c17

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.0-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: python_build_wheel.yaml on ybubnov/torch_geopooling

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file torch_geopooling-1.3.0-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 06089bf3d4ce38635f9b2a74555105295b6c8b53c3cefb031bf4b527b0e8f2dc
MD5 63d158da22f17c71f1fb67ea0480bec7
BLAKE2b-256 9158326de8c733c4d6b4b28230bfc74de012a1ae55956e0b3cdb546b7e93e158

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.0-cp310-cp310-manylinux_2_28_aarch64.whl:

Publisher: python_build_wheel.yaml on ybubnov/torch_geopooling

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.3.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8c656f27e6fed2dbdbe8fbf32d0a84922a644f8a5927d670464b2e9f17569ac4
MD5 80a00627a11968178ffc84d2a33abbc6
BLAKE2b-256 aa341f95c108367a767c876958668cc19bee46f3298e109ef153a14f9efee938

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.0-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: python_build_wheel.yaml on ybubnov/torch_geopooling

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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