{"id":13686402,"url":"https://github.com/nocotan/geodesical_skew_divergence","last_synced_at":"2026-03-11T17:31:26.484Z","repository":{"id":52134270,"uuid":"352574235","full_name":"nocotan/geodesical_skew_divergence","owner":"nocotan","description":"PyTorch implementation of α-geodesical skew divergence","archived":false,"fork":false,"pushed_at":"2021-07-05T23:36:07.000Z","size":1937,"stargazers_count":10,"open_issues_count":6,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-27T06:01:51.752Z","etag":null,"topics":["divergence","information-geometry","js-divergence","kl-divergence","machine-learning","statistics"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nocotan.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-03-29T08:45:17.000Z","updated_at":"2024-03-12T04:27:08.000Z","dependencies_parsed_at":"2022-09-06T01:11:38.132Z","dependency_job_id":null,"html_url":"https://github.com/nocotan/geodesical_skew_divergence","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/nocotan/geodesical_skew_divergence","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nocotan%2Fgeodesical_skew_divergence","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nocotan%2Fgeodesical_skew_divergence/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nocotan%2Fgeodesical_skew_divergence/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nocotan%2Fgeodesical_skew_divergence/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nocotan","download_url":"https://codeload.github.com/nocotan/geodesical_skew_divergence/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nocotan%2Fgeodesical_skew_divergence/sbom","scorecard":{"id":691719,"data":{"date":"2025-08-11","repo":{"name":"github.com/nocotan/geodesical_skew_divergence","commit":"293648a30e86bdd14749af5b107f1d3687d67700"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/16 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:8: update your workflow using https://app.stepsecurity.io/secureworkflow/nocotan/geodesical_skew_divergence/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/nocotan/geodesical_skew_divergence/python-publish.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:15","Info:   0 out of   2 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   1 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 25 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-22T02:27:27.819Z","repository_id":52134270,"created_at":"2025-08-22T02:27:27.819Z","updated_at":"2025-08-22T02:27:27.819Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27724145,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-14T02:00:11.348Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["divergence","information-geometry","js-divergence","kl-divergence","machine-learning","statistics"],"created_at":"2024-08-02T15:00:31.732Z","updated_at":"2025-12-14T09:03:59.842Z","avatar_url":"https://github.com/nocotan.png","language":"Python","funding_links":[],"categories":["Computational Information Geometry"],"sub_categories":[],"readme":"# α-Geodesical Skew Divergence\n\n[![GitHub license](https://img.shields.io/github/license/nocotan/geodesical_skew_divergence)](https://github.com/nocotan/geodesical_skew_divergence/blob/main/LICENSE)\n![GitHub repo size](https://img.shields.io/github/repo-size/nocotan/geodesical_skew_divergence)\n[![PyPI](https://img.shields.io/pypi/v/gs-divergence)](https://pypi.org/project/gs-divergence/)\n[![arXiv](http://img.shields.io/badge/math.IT-arXiv%3A2103.17060-B31B1B.svg)](https://arxiv.org/abs/2103.17060)\n![GitHub Repo stars](https://img.shields.io/github/stars/nocotan/geodesical_skew_divergence?style=social)\n[![Downloads](https://pepy.tech/badge/gs-divergence)](https://pepy.tech/project/gs-divergence)\n\n![GitHub Workflow Status](https://img.shields.io/github/workflow/status/nocotan/geodesical_skew_divergence/Run%20Python%20Tests)\n![GitHub issues](https://img.shields.io/github/issues/nocotan/geodesical_skew_divergence)\n\n\nOfficial PyTorch Implementation of \"[α-Geodesical Skew Divergence](https://www.mdpi.com/1099-4300/23/5/528)\".\n\n- [[Entropy](https://www.mdpi.com/1099-4300/23/5/528)]\n- [[arXiv](https://arxiv.org/abs/2103.17060)]\n\n\u003e 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.\n\n## Installation\n\n### From PyPI\n\nInstall gs_divergence from PyPI via\n\n```bash\n$ pip install gs_divergence\n```\n\n### From GitHub\n\nAlternatively, you can install the latest version directly from the GitHub repository with the following command.\n\n```bash\n$ git clone https://github.com/nocotan/geodesical_skew_divergence\n$ python setup.py install\n```\n\n## Usage\n\n### Compute divergence from two Tensors\n\n```python\nimport torch\nfrom gs_divergence import gs_div\n\na = torch.Tensor([0.1, 0.2, 0.3, 0.4])\nb = torch.Tensor([0.2, 0.2, 0.4, 0.2])\n\ndiv = gs_div(a, b, alpha=-1, lmd=0.5)\n```\n\n### Compute gradients\n\n```python\nimport torch\nfrom gs_divergence import gs_div\n\na = torch.tensor([0.1, 0.2, 0.3, 0.4], requires_grad=True)\nb = torch.tensor([0.2, 0.2, 0.4, 0.2])\n\ndiv = gs_div(a, b, alpha=-1, lmd=0.5)\ndif.backward()\n```\n\n| parameter | description                                                                                                                                                                                                                                                                                                                                                                                                                              |\n|-----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| input     | Tensor of arbitrary shape                                                                                                                                                                                                                                                                                                                                                                                                                |\n| target    | Tensor of the same shape as input                                                                                                                                                                                                                                                                                                                                                                                                        |\n| alpha     | Specifies the coordinate systems which equiped the geodesical skew divergence (default=``-1``)                                                                                                                                                                                                                                                                                                                                               |\n| lmd       | Specifies the position on the geodesic (default=``0.5``)                                                                                                                                                                                                                                                                                                                                                                                     |\n| 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'`` |\n\n\n## Definition of α-Geodesical Skew Divergence\n\n![](./assets/def_interpolation.png)\n\n![](./assets/def_gs_divergence.png)\n\n\n\n## Visualizations of the α-Geodesical Skew Divergence\n\n### Monotonicity of the α-geodesical skew divergence with respect to α\n\n![](./assets/gs_divergence.png)\n\n### Continuity of the α-geodesical skew divergence with respect to α and λ.\n\n![](./assets/gs_divergence_surface.png)\n\n## Citation\n\n```bibtex\n@Article{e23050528,\nAUTHOR = {Kimura, Masanari and Hino, Hideitsu},\nTITLE = {alpha-Geodesical Skew Divergence},\nJOURNAL = {Entropy},\nVOLUME = {23},\nYEAR = {2021},\nNUMBER = {5},\nARTICLE-NUMBER = {528},\nURL = {https://www.mdpi.com/1099-4300/23/5/528},\nISSN = {1099-4300},\nABSTRACT = {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.},\nDOI = {10.3390/e23050528}\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnocotan%2Fgeodesical_skew_divergence","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnocotan%2Fgeodesical_skew_divergence","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnocotan%2Fgeodesical_skew_divergence/lists"}