Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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.

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.

Release files for torch-geopooling 1.0.0rc1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for torch-geopooling 1.0.0rc1
File Interpreter ABI Platform
torch_geopooling-1.0.0rc1-cp39-cp39-macosx_11_0_arm64.whl CPython 3.9 CPython 3.9 macOS 11.0+ ARM64 Details

Release files / torch_geopooling-1.0.0rc1-cp39-cp39-macosx_11_0_arm64.whl

Download URL torch_geopooling-1.0.0rc1-cp39-cp39-macosx_11_0_arm64.whl
Size 206.7 kB
Tags CPython 3.9 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
e24c543d8ea327d545a8131a36a18771892fd627966644538ba95c7257878876
BLAKE2b-256 checksum
How to use checksums
00f4911f9191c281e827b293af245edea73a3a11ecf8747ed6f95311ea07baa4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.0 CPython/3.12.4
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page