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.1-cp313-cp313-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

torch_geopooling-1.3.1-cp313-cp313-manylinux_2_28_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ ARM64

torch_geopooling-1.3.1-cp313-cp313-macosx_11_0_arm64.whl (507.6 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

torch_geopooling-1.3.1-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.1-cp312-cp312-manylinux_2_28_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

torch_geopooling-1.3.1-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.1-cp311-cp311-manylinux_2_28_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

torch_geopooling-1.3.1-cp311-cp311-macosx_11_0_arm64.whl (510.6 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

torch_geopooling-1.3.1-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.1-cp310-cp310-manylinux_2_28_aarch64.whl (1.0 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

torch_geopooling-1.3.1-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.1-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cad66646a9e8bb9ac9ab057cfbe658a8cf87d2108678f8866e0766bc8d0722f4
MD5 fd5e5e52b507f86be2067ef5a4679998
BLAKE2b-256 4070e983ebf9dcda8252dffabc67781dbd96176cfc4f79078b56b981fb9031b7

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.1-cp313-cp313-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.1-cp313-cp313-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.1-cp313-cp313-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 75770e86aba6dc807115bc3ab3b7a5fb70422462ca50060307af6894f7fd59a7
MD5 016d75b7a4fa7c9fe39eeeb23f282ced
BLAKE2b-256 8cfb8fddf19eec7ad9b30daabf9d3474a80f5a0719f0343b0f0181cc242cbcc2

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.1-cp313-cp313-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.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1d105596dec4adc8d3bb5487863ff4c5d9ac40f5cbfeb83c026771dc0a12045c
MD5 fd75ff0480aa7735fb36783a7728e36b
BLAKE2b-256 dec12a77c18fa8df5e149ea6581ff6c6b9cc6e92482d8d3b487e49a3693e7e5a

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.1-cp313-cp313-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.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 066c5e98e621e40834db7f4fa0e8f82cd235ac8517c38f250683ea62aaa7b02d
MD5 9a57576e2abf3b29ccb379d3fa44e6cc
BLAKE2b-256 62282957ff7df0940ea8fb7e4f127e75d5ca536c021c7b33a9ee5fede403fa2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.1-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.1-cp312-cp312-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.1-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 cb7177010a34ae63a6a783da6e86ae34c18b090e917b3ba1376230a12d58201a
MD5 21e6189d6d94402e0940bab98e3fe150
BLAKE2b-256 2837e71d201cbfa7e6c43b3adcac185488980fee738b07de332da261c8b41613

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.1-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.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a801a77eb652f6a5c764a9c257ec4a37c2f3fdf1f96fca8fe8e5e73656882f93
MD5 e8c3f3293a55b8c8bfae7f67bf5a77ac
BLAKE2b-256 54cc50c00e270911492a2b360405b972a716e063f7c28771289e614a903ade3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.1-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.1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 dfb2b44a4b27292227268c0c5549c5c4c239f8aca3de49245ddf3da2b9ef23f4
MD5 fc7c50c9a7644cbb9311821645d2bda8
BLAKE2b-256 03db972372cdcbe9c103b47e6d4228f17f0abb7a7e4f6f0e3f5caa5555fde5b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.1-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.1-cp311-cp311-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.1-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 6009da49b5a37fe748aaf80c6dd6a9933e08daca60cc84d470c029e0e1c5518b
MD5 d8511360ce51c0aab6247f76bf46e884
BLAKE2b-256 b3a6ead6f54d52d1351e0d419a499421ecfd4d34ac6afaf91a4b6768cc9f163b

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.1-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.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 41445201aacda83e44a3659abf8454796f5bee8300d2ef16878aca435c6273d0
MD5 cd2b421644d1bf819a1100decec12146
BLAKE2b-256 659c8e55820ee339e2d5746798cdab4fdd97f538782dab20304d0f9a7fb8cd85

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.1-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.1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 899aeb1d3359ce5b623ce432dd224a82eb4f578a649b4b443c4aa98fa692f8d4
MD5 6f4b086dd2b2eb76941e9247bcdcae6a
BLAKE2b-256 f9ef96fcf97e208f1ffa306d272e2e156e5ca6af22f522fc2d08573eb94b7efe

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.1-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.1-cp310-cp310-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.1-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 222cdfeeac2da1c4359a5f6e2ce3bcaced64bc9244f5839e6b730d8c1bebdd45
MD5 2fc5cf0bc91869b057baa93c77720e91
BLAKE2b-256 f8120986933c716d522c67673bbbab61a1eb143f37eb8129bec7c99dd249fc1c

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.1-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.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.3.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b11595c4919f7b8444a1cd4cdeb2c21891f40724fb561d82cfb551978876e83e
MD5 726f609d2b36fb265ec36ca8d12ac366
BLAKE2b-256 006b2b29426522e3fb63b084871f008d31ae207652013ccfe7a160a52c8f325c

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.3.1-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