{"id":15043614,"url":"https://github.com/zang-langyan/autolik","last_synced_at":"2026-01-25T00:02:30.599Z","repository":{"id":57676809,"uuid":"489131194","full_name":"zang-langyan/autolik","owner":"zang-langyan","description":"Provide the automatic differentiation for Likelihood maximization routine","archived":false,"fork":false,"pushed_at":"2022-06-24T18:00:15.000Z","size":3343,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-21T10:29:27.667Z","etag":null,"topics":["automatic-differentiation","distributions","loglikelihood","maximum-likelihood","numpy","python"],"latest_commit_sha":null,"homepage":"https://autolik.readthedocs.io/en/latest/","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/zang-langyan.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":"2022-05-05T21:30:10.000Z","updated_at":"2022-07-23T21:13:16.000Z","dependencies_parsed_at":"2022-09-02T22:31:27.277Z","dependency_job_id":null,"html_url":"https://github.com/zang-langyan/autolik","commit_stats":null,"previous_names":["zang-langyan/autolik","7lang2yan/autolik"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/zang-langyan/autolik","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zang-langyan%2Fautolik","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zang-langyan%2Fautolik/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zang-langyan%2Fautolik/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zang-langyan%2Fautolik/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zang-langyan","download_url":"https://codeload.github.com/zang-langyan/autolik/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zang-langyan%2Fautolik/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28739321,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-24T22:12:27.248Z","status":"ssl_error","status_checked_at":"2026-01-24T22:12:10.529Z","response_time":89,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["automatic-differentiation","distributions","loglikelihood","maximum-likelihood","numpy","python"],"created_at":"2024-09-24T20:49:20.677Z","updated_at":"2026-01-25T00:02:30.582Z","avatar_url":"https://github.com/zang-langyan.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Autolik [![Documentation Status](https://readthedocs.org/projects/autolik/badge/?version=latest)](https://autolik.readthedocs.io/en/latest/?badge=latest)\n\nAutolik aims at providing interface of automatic differentiation for likelihood maximization routine. It not only supports various distributions probability density function and their log-likelihood functions, but also the gradient of log-likelihood functions. For example, Normal, Gamma, Laplace, Pareto, T, Generalized Gamma, Generalized Pareto, ,Inverse Gaussian, Inverted Gamma, Lomax, Minimax, Rayleigh, Weibull and so on. It also supports self-defined python functions and provides fast automatic differentiation api on it.\n\n**_Example use:_**\n\n```python\n\u003e\u003e\u003e from autolik import Dual # for self-defined functions use\n\u003e\u003e\u003e import autolik\n\u003e\u003e\u003e import matplotlib.pyplot as plt\n\u003e\u003e\u003e from matplotlib.pyplot import cm\n\u003e\u003e\u003e import numpy as np\n\u003e\u003e\u003e def z(x,y): # self-defined function\n...     if isinstance(x,Dual) or isinstance(y,Dual): # autolik.Dual computation\n...         return x * (-x**2 - y**2).exp()\n...     else:\n...         return x * np.exp(-x**2 - y**2)\n\u003e\u003e\u003e z_grad = autolik.grad(z) # gradient function\n\u003e\u003e\u003e x = np.linspace(-2,2,100)\n\u003e\u003e\u003e y = np.linspace(-2,2,100)\n\u003e\u003e\u003e X,Y = np.meshgrid(x,y)\n\u003e\u003e\u003e Z = np.array([[z(i,j) for i in x] for j in y])\n\u003e\u003e\u003e vx = np.linspace(-2,2,50)\n\u003e\u003e\u003e vy = np.linspace(-2,2,50)\n\u003e\u003e\u003e vX,vY = np.meshgrid(vx,vy)\n\u003e\u003e\u003e Z_grad = np.array([z_grad([i,j]) for i in vx for j in vy]) # gradient vectors\n\u003e\u003e\u003e ax = plt.axes()\n\u003e\u003e\u003e ax.contourf(X,Y,Z,levels=50, cmap=cm.jet, alpha = 0.7)\n\u003e\u003e\u003e ax.quiver(vX,vY,Z_grad[:,0],Z_grad[:,1])\n\u003e\u003e\u003e plt.show()\n```\n\n\u003cimg src=\"examples/figures/contourf_x_exp_x2_y2.png\"\u003e\n\n## Use the built in log-likelihood functions to compute the gradients\n\n[List of supported build-in log-likelihhood api](docs/api_list.md) for gradient computation\n\n**_Example:_**\n\n```python\n\u003e\u003e\u003e import autolik\n\u003e\u003e\u003e import numpy as np\n\u003e\u003e\u003e y = np.random.normal(-1,2,100)\n\u003e\u003e\u003e def loglik_normal(mu,sigma): # prepare the logliklihood function\n...    return autolik.ll.normal(y, mu, sigma)\n\u003e\u003e\u003e g = autolik.grad(loglik_normal) # generate the gradient for the logliklihood function\n\u003e\u003e\u003e import matplotlib.pyplot as plt\n\u003e\u003e\u003e from matplotlib.pyplot import cm\n\u003e\u003e\u003e mu = np.linspace(-2,2,50)\n\u003e\u003e\u003e sig = np.linspace(1,6,50)\n\u003e\u003e\u003e Mu,Sigma = np.meshgrid(mu,sig)\n\u003e\u003e\u003e loglik = np.array([[loglik_normal(i,j) for i in mu] for j in sig])\n\u003e\u003e\u003e loglik_grad = np.array([g([i,j]) for i in mu for j in sig])\n\u003e\u003e\u003e ax = plt.axes()\n\u003e\u003e\u003e ax.contourf(Mu,Sigma,loglik, levels=50, cmap=cm.jet, alpha = 0.8) # plot the contour of log-likelihood function\n\u003e\u003e\u003e ax.quiver(Mu,Sigma,loglik_grad[:,0],loglik_grad[:,1]) # plot the gradient vectors of log-likelihood function\n\u003e\u003e\u003e plt.show()\n```\n\n\u003cimg src=\"examples/figures/contourf_loglik_normal.png\"\u003e\n\n## Supported operators and functions\n\n[List of supported operators and functions](docs/operator_list.md) for gradient computation\n\nAutolik supports the basic operators (e.g. `+`, `-`, `*`, `**`, `/` ...) and special functions (e.g. `sin`, `cos`, `exp`, `log`, `gamma`, `beta` ...)\n\n## Installation\n\nSimply run the following code in terminal or prompt:\n\n```shell\npip install autolik\n```\n\n## Author\n\nAutolik is written by Langyan Zang. The package is currently in the very beginning stage, any kind of contribution is welcome. Autolik is currently developed by Langyan solely, the understanding of the slow development would be appreciated. For advices, please do not hesitate to write an email [\u003clangyan.zang@uzh.ch\u003e](langyan.zang@uzh.ch) and instruct me ^.^.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzang-langyan%2Fautolik","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzang-langyan%2Fautolik","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzang-langyan%2Fautolik/lists"}