# AlexHex7/Non-local_pytorch

Implementation of Non-local Block.

Repository: https://github.com/AlexHex7/Non-local_pytorch
Canonical: https://ross.abutalabs.com/products/non-local_pytorch
Language: Python
License: Apache-2.0
License Family: permissive
Topics: non-local, pytorch, non-local-block, nonlocal, nl-map, automatic-mixed-precision-training, amp
Last push: 2023-04-12T06:40:56+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3192, "days_push": 1239, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1564, forks 269 (observed 2026-08-28T04:05:04.199825+00:00)

## What it is
A PyTorch implementation of the Non-local Neural Block from the paper 'Non-local Neural Networks', providing multiple variants (concatenation, gaussian, embedded gaussian, dot product). It includes demo training on MNIST and tools for visualizing non-local attention maps.

## Use cases
- add non-local attention blocks to my pytorch model
- implement non-local neural networks in pytorch
- visualize non-local attention maps
- compare different non-local block variants
- train a network with non-local blocks on MNIST
- use mixed precision training with non-local blocks

## When to choose
- you need a ready-made, well-starred PyTorch implementation of the Non-local Block
- you want to experiment with all four non-local block variants
- you want to visualize non-local attention maps for interpretability

## When to avoid
- you need a maintained library with recent updates and broad model integrations
- you want attention modules beyond the non-local family (e.g., transformers, SE blocks)
- you need production training pipelines rather than demo code

## Facets
- artifact type: library
- maturity: maintenance
- function: machine-learning, deep-learning, image-processing, computer-vision
- domain: deep-learning, computer-vision, machine-learning
- platform: python
- tags: non-local-block, pytorch, attention, neural-networks, mnist, mixed-precision, visualization, gpu

## Member repositories
- AlexHex7/Non-local_pytorch (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:05:04.199825+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:00:12.076059+00:00, confidence not recorded.
  - readme: https://github.com/AlexHex7/Non-local_pytorch (fetched 2026-08-28T04:05:04.199825+00:00, sha 0ab089f283a1)
- Data as of 2026-08-30T08:39:29.467469+00:00.
