Giter Site home page Giter Site logo

nocotan / geodesical_skew_divergence Goto Github PK

View Code? Open in Web Editor NEW
10.0 2.0 1.0 1.89 MB

PyTorch implementation of α-geodesical skew divergence

License: MIT License

Python 100.00%
statistics machine-learning divergence kl-divergence js-divergence information-geometry

geodesical_skew_divergence's Introduction

α-Geodesical Skew Divergence

GitHub license GitHub repo size PyPI arXiv GitHub Repo stars Downloads

GitHub Workflow Status GitHub issues

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

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

Install gs_divergence from PyPI via

$ pip install gs_divergence

From GitHub

Alternatively, you can install the latest version directly from the GitHub repository with the following command.

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

Usage

Compute divergence from two Tensors

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)

Compute gradients

import torch
from gs_divergence import gs_div

a = torch.tensor([0.1, 0.2, 0.3, 0.4], requires_grad=True)
b = torch.tensor([0.2, 0.2, 0.4, 0.2])

div = gs_div(a, b, alpha=-1, lmd=0.5)
dif.backward()
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

@Article{e23050528,
AUTHOR = {Kimura, Masanari and Hino, Hideitsu},
TITLE = {alpha-Geodesical Skew Divergence},
JOURNAL = {Entropy},
VOLUME = {23},
YEAR = {2021},
NUMBER = {5},
ARTICLE-NUMBER = {528},
URL = {https://www.mdpi.com/1099-4300/23/5/528},
ISSN = {1099-4300},
ABSTRACT = {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.},
DOI = {10.3390/e23050528}
}

geodesical_skew_divergence's People

Contributors

nocotan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ismhinolab

geodesical_skew_divergence's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.