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.2.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.2.0-cp312-cp312-manylinux_2_28_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ ARM64

torch_geopooling-1.2.0-cp312-cp312-macosx_11_0_arm64.whl (510.5 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

torch_geopooling-1.2.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.2.0-cp311-cp311-manylinux_2_28_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ ARM64

torch_geopooling-1.2.0-cp311-cp311-macosx_11_0_arm64.whl (513.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

torch_geopooling-1.2.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.2.0-cp310-cp310-manylinux_2_28_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ ARM64

torch_geopooling-1.2.0-cp310-cp310-macosx_11_0_arm64.whl (512.4 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

torch_geopooling-1.2.0-cp39-cp39-manylinux_2_28_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ x86-64

torch_geopooling-1.2.0-cp39-cp39-manylinux_2_28_aarch64.whl (1.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.28+ ARM64

torch_geopooling-1.2.0-cp39-cp39-macosx_11_0_arm64.whl (512.6 kB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

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

File metadata

File hashes

Hashes for torch_geopooling-1.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b015dc46ec1cd2682bc16fc3e4f46ae35534b75b43daa7a704bbeab4c39f23ae
MD5 252607a5219db0b5f0716ace6351b6fa
BLAKE2b-256 d533ed75447c3b68762746e3a37ffeb14420b4b67cc6900ef3d99415a648dbfe

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torch_geopooling-1.2.0-cp312-cp312-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 47001b57b599723e3de2dad8849e8b5f9f020155ed7024d0f939dfa301b818b0
MD5 f609aa69755afffe8e4512b1e9cf857f
BLAKE2b-256 42f456d7d56e5ae6f7ebb4e329ab65b588fe901b203d3bed28416116ecaa6c55

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torch_geopooling-1.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5110fd1ac694e82f5f111600f1fe8ee4660e97974714039360361cde9fe4022b
MD5 016fcbee9f94ad2d756fc07f63d3535a
BLAKE2b-256 4ae0128aa5f5a12c3ea13d09ecf4caeeabcafce35a758e1578f43c03985eb830

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torch_geopooling-1.2.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cc6ee3d065e74cf1bd5777016e6be0484a889ee5deaffccf57b60223644053a3
MD5 bcbc961b5e69f014290d39ff4835b6e3
BLAKE2b-256 50d66a831a1f8167216b4cbd4c4ea690b261ddac9bb6d9b5232f7f0236a24c61

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torch_geopooling-1.2.0-cp311-cp311-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 87f5f5faf8ccb6f663ea11f82275786b60867b5c79722ee58799b31338204b40
MD5 da6d4470dae4070d94eb4a7f96310703
BLAKE2b-256 cf3784fb359858b3ddcecc678c09e9b107c330f935a3552b3b18e095e13871a0

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torch_geopooling-1.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8cadaa4ec795ad90696b912ee6e640bb8c261aa90574b2cde71ac5532403e26a
MD5 dca20875974be623655bc6483faab244
BLAKE2b-256 bd6f2a489bd5a167b9f0aa8c2923c4b3a2b72e4bab9ca15ef589553e937852bf

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torch_geopooling-1.2.0-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 566bed9ce54dfc04cd084c2baf74497722899f48a27fdfcd8e5be073ab721f88
MD5 f7b0b3ad5aff1d349bb7aec4fce593ba
BLAKE2b-256 7826ce6e08a6e2d703bcd615d31268d5aaea25fca3a24ddd094200cc3da32a58

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torch_geopooling-1.2.0-cp310-cp310-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fead84398bf8ec2144806bb433452f074afe947eb5177a34fe957b98462b02cc
MD5 005dc0cd176c6cb370d3f6bd3fa14208
BLAKE2b-256 357b1953193536199d5a4a4705ae3a6f1272c3e754df073fb6131e3e42493cf1

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for torch_geopooling-1.2.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2a32506fe14bdee0dfdfe0233cb2ba71196eee9ba6b1f12ef91bc185979e7647
MD5 8754e35597816078cb976e81fe8e676f
BLAKE2b-256 f8b1dbaf3c474caeac9883cbf281bc05d978fa313fb7197f2a0915424c1d955d

See more details on using hashes here.

Provenance

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

File details

Details for the file torch_geopooling-1.2.0-cp39-cp39-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.2.0-cp39-cp39-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cbf0497def84b7241f4f9fb61291e40ae1e230b0d2cee2bd073d0f963e8cf6ef
MD5 3430a2eba48c25a84668c1cae6a937c8
BLAKE2b-256 7928327a7a1823da5958e2aace92f2622b5231ab2d930879b91780a601d7b0f7

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.2.0-cp39-cp39-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.2.0-cp39-cp39-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.2.0-cp39-cp39-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 97a0442d96be669450fd51f1bf802e7d9e7a9499692b9ba14f9faa5f7dacd478
MD5 7c69de4fa5bbdfc79ac7805d9427409e
BLAKE2b-256 c0b49fb978af885cdd305ca371fe9b248f7cbecc987508c39849fc6198831ed1

See more details on using hashes here.

Provenance

The following attestation bundles were made for torch_geopooling-1.2.0-cp39-cp39-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.2.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for torch_geopooling-1.2.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5a457e1783910be8dabc94180147ae18eca5425ec8837b84ec1929770d8c0379
MD5 906dd442e26f840735b5bc401178876c
BLAKE2b-256 5fd5db63741d57f6bacb3ed4a8c8405ed336e8ad2b4be8f61491385a5cb7af13

See more details on using hashes here.

Provenance

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