Skip to main content

A Proximal One-step Geometric Orthoptimizer

This a PyTorch implementation of the POGO algorithm proposed in An Embarrassingly Simple Way to Optimize Orthogonal Matrices at Scale. This is a lightweight and easy-to-use library containing the optimizer as a normal Pytorch Optimizer, and two base optimizers to choose for from now: SGD and Vector Adam.

Beware: You should pass only orthogonal parameters to POGO and initialize them as such. See below!

Installation

You can install pogo from pip by simply running

pip install pogo-torch

Or, if you are using uv, you can add it to your project with

uv add pogo-torch

Alternatively, you can install it directly from the repository:

pip install git+https://github.com/adrianjav/pogo

Getting started

POGO is implemented as a Pytorch optimizer, so it should be quite intuitive to use. Moreover, the default parameters should work for most use cases. If that were not the case, feel free to check the docstrings and ultimately open an issue.

To initialize your parameters as orthogonal, you can either use torch.init.orthogonal_ (but make sure it does what you intend given the shape of your parameters) or use any other initialization method and then project them to be orthogonal. For example:

X = ... # My parameter
U, S, VT = torch.linalg.svd(X, full_matrices=False)
X.data = U @ VT

Then, you can use POGO as any other optimizer:

from pogo import base, POGO

model = ...  # Ensure that your parameters are initialized as orthogonal!
optimizer = POGO(model.parameters(), base.VectorAdam(), learning_rate)

for epoch in range(num_epochs):
    optimizer.zero_grad()
    ...
    loss.backward()
    optimizer.step()

By default, POGO expects matrices of the form [num_matrices, p, n] with $p < n$ and such that torch.bmm(X, X) yields num_matrices identity matries of size $p \times p$. If that does not fit your needs (e.g. you have more than one leading axis, or you need colum-orthogonal matrices), then please do check POGO's flatten_fn and rows parameters.

Citation

@article{javaloy2026pogo,
    title   = {An Embarrassingly Simple Way to Optimize Orthogonal Matrices at Scale},
    author  = {Javaloy, Adri{\'a}n and Vergari, Antonio},
    year    = 2025,
	journal = {ArXiv preprint},
	volume  = {2602.14656},
	url     = {https://arxiv.org/abs/2602.14656}
}

Metadata

Release files for pogo-torch 1.0.2

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

Source distribution (sdist)

Source distribution for pogo-torch 1.0.2
File Size Uploaded
pogo_torch-1.0.2.tar.gz 20.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pogo-torch 1.0.2
File Interpreter ABI Platform
pogo_torch-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 40.3 kB

Release files / pogo_torch-1.0.2.tar.gz

Download URL pogo_torch-1.0.2.tar.gz
Size 20.1 kB
Tags Source
SHA-256 checksum
How to use checksums
1692174d7c4c8ec26d65ce259c8d2e73d5b16a261de4d55c6eb635a97d88801a
BLAKE2b-256 checksum
How to use checksums
72d58481cd46ed481e02b8586e82ee6b81de73f4f09aa16fe0cf721627e3f966
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 19, 2026.

Transparency log

Release files / pogo_torch-1.0.2-py3-none-any.whl

Download URL pogo_torch-1.0.2-py3-none-any.whl
Size 20.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d5d63e956ea02ea54c1572ce4900fe3b665191580adc9e464f339354a39af504
BLAKE2b-256 checksum
How to use checksums
554484d0867325801817deeecfc7c55133193bdd7a452a40939091f2851bfbdb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Mar 19, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

1.0.0

2 release files

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