Skip to main content

α-Geodesical Skew Divergence

GitHub license GitHub repo size GitHub Workflow Status PyPI arXiv GitHub Repo stars

Official PyTorch Implementation of "α-Geodesical Skew Divergence".

[arXiv]

The asymmetric skew divergence smooths one of the distributions by mixing it, to a degree determined by the parameter λ, with the other distribution. Such divergence is an approximation of the KL divergence that does not require the target distribution to be absolutely continuous with respect to the source distribution. In this paper, an information geometric generalization of the skew divergence called the α-geodesical skew divergence is proposed, and its properties are studied.

Installation

From PyPi

$ pip install gs_divergence

From GitHub

$ git clone https://github.com/nocotan/geodesical_skew_divergence
$ python setup.py install

Usage

import torch
from gs_divergence import gs_div

a = torch.Tensor([0.1, 0.2, 0.3, 0.4])
b = torch.Tensor([0.2, 0.2, 0.4, 0.2])

div = gs_div(a, b, alpha=-1, lmd=0.5)
parameter description
input Tensor of arbitrary shape
target Tensor of the same shape as input
alpha Specifies the coordinate systems which equiped the geodesical skew divergence (default=-1)
lmd Specifies the position on the geodesic (default=0.5)
reduction Specifies the reduction to apply to the output: 'none' | 'batchmean' | 'sum' | 'mean'. 'none': no reduction will be applied 'batchmean': the sum of the output will be divided by the batchsize 'sum': the output will be summed 'mean': the output will be divided by the number of elements in the output default='sum'

Definition of α-Geodesical Skew Divergence

Visualizations of the α-Geodesical Skew Divergence

Monotonicity of the α-geodesical skew divergence with respect to α

Continuity of the α-geodesical skew divergence with respect to α and λ.

Citation

@misc{kimura2021geodesical,
    title={$α$-Geodesical Skew Divergence},
    author={Masanari Kimura and Hideitsu Hino},
    year={2021},
    eprint={2103.17060},
    archivePrefix={arXiv},
    primaryClass={cs.IT}
}

Release files for gs-divergence 1.0.8

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

Source distribution (sdist)

Source distribution for gs-divergence 1.0.8
File Size Uploaded
gs_divergence-1.0.8.tar.gz 4.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for gs-divergence 1.0.8
File Interpreter ABI Platform
gs_divergence-1.0.8-py3-none-any.whl Python 3 none any Details

Total release size: 11.3 kB

Release files / gs_divergence-1.0.8.tar.gz

Download URL gs_divergence-1.0.8.tar.gz
Size 4.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3c7473b40e2460972ee36f68ad58d99b32e0e4c980ef58ea2fe42e2381220ce7
BLAKE2b-256 checksum
How to use checksums
51da04389a3cd19ee29244afd86eff028d02db995123b6b9851aa384108f14bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

Release files / gs_divergence-1.0.8-py3-none-any.whl

Download URL gs_divergence-1.0.8-py3-none-any.whl
Size 6.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6b4d9f52b9b1ebd2837649b0b6300b7421960ea69f8c1875059e870c623f4a92
BLAKE2b-256 checksum
How to use checksums
512118c4c4d73be6c53dcd6ea039e693b0b80eb377a6822baa15fed2333adf1b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.5.0.1 requests/2.24.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.8.3

Release history Release notifications | RSS feed

This release

1.0.8 This release

2 release files

1.0.7

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.0.1

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