Giter Club home page Giter Club logo

beautifulalgorithms.jl's Introduction

BeautifulAlgorithms.jl

Build Status codecov

Concise algorithms written in Julia and formatted with Carbon.

Algorithms for machine learning, optimization, reinforcement learning, online planning, decision making under uncertainty, and sorting. All implementations are working and self-contained; refer to the test cases.

Note, these are primarily for academic purposes and are not designed for real-world usage. There are many other Julia packages that implement more sound versions of these algorithms.

] add http://github.com/mossr/BeautifulAlgorithms.jl

Note: Algorithms are modified from their original sources.

Gradient descent

Percy Liang and Dorsa Sadigh, Artificial Intelligence: Principles and Techniques, Stanford University, 2019.

Stochastic gradient descent

Percy Liang and Dorsa Sadigh, Artificial Intelligence: Principles and Techniques, Stanford University, 2019.

Two-layer neural network

Two-layer neural network (one-liner)

Multi-layer neural network

Loss functions

Distance functions

Nearest neighbor

K-nearest neighbors

K-means clustering

Percy Liang and Dorsa Sadigh, Artificial Intelligence: Principles and Techniques, Stanford University, 2019.

The EM algorithm

Andrew Ng, Mixtures of Gaussians and the EM algorithm, Stanford University, 2020.1

Linear regression

Mykel J. Kochenderfer and Tim A. Wheeler, Algorithms for Optimization, MIT Press, 2019. (Credit @HenriDeh for use of ones)

Linear regression (one-liner)

Ridge regression

Basis regression

Mykel J. Kochenderfer and Tim A. Wheeler, Algorithms for Optimization, MIT Press, 2019.

Radial basis regression

Mykel J. Kochenderfer and Tim A. Wheeler, Algorithms for Optimization, MIT Press, 2019.

Logistic regression

Cross-entropy method

Mykel J. Kochenderfer and Tim A. Wheeler, Algorithms for Optimization, MIT Press, 2019.

Finite difference methods

Mykel J. Kochenderfer and Tim A. Wheeler, Algorithms for Optimization, MIT Press, 2019.

Simulated annealing

Mykel J. Kochenderfer and Tim A. Wheeler, Algorithms for Optimization, MIT Press, 2019.

Twiddle

Sebatian Thrun, Artificial Intelligence for Robotics, Udacity, 2012.

Newton's method

John Wallis, A Treatise of Algebra both Historical and Practical, 1685.

Gaussian process

Mykel J. Kochenderfer and Tim A. Wheeler, Algorithms for Optimization, MIT Press, 2019.

Gaussian process kernels

Thompson sampling

Daniel J. Russo, Benjamin Van Roy, Abbas Kazerouni, Ian Osband, and Zheng Wen, A Tutorial on Thompson Sampling, arXiv:1707.02038, 2020.

Particle filter

Mykel J. Kochenderfer, Tim A. Wheeler, and Kyle H. Wray, Algorithms for Decision Making, Preprint.

Value iteration

Mykel J. Kochenderfer, Tim A. Wheeler, and Kyle H. Wray, Algorithms for Decision Making, Preprint.

Branch and bound

Mykel J. Kochenderfer, Tim A. Wheeler, and Kyle H. Wray, Algorithms for Decision Making, Preprint.

Monte Carlo tree search

Mykel J. Kochenderfer, Tim A. Wheeler, and Kyle H. Wray, Algorithms for Decision Making, Preprint.

Huffman coding

David A. Huffman, A Method for the Construction of Minimum-Redundancy Codes, IEEE, 1952.

Hailstone sequence (Collatz conjecture)

Bubble sort

Karey Shi, Design and Analysis of Algorithms, Stanford University, 2020.

Merge sort

Karey Shi, Design and Analysis of Algorithms, Stanford University, 2020.

Insertion sort

Karey Shi, Design and Analysis of Algorithms, Stanford University, 2020.

Bogo sort

Bogo sort (one-liner)

Quine

Nathan Daly, Julia Discord, 2019.2


Written by Robert Moss.

beautifulalgorithms.jl's People

Contributors

moelf avatar mossr avatar pitmonticone avatar wikunia avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

beautifulalgorithms.jl's Issues

Missing license

What is the license for this code?

If you want people to be able to copy/paste this into projects, I would recommend putting the code in the public domain. Without a license, it cannot be used at all.

Additional methods for solving Dynamic Programming problems

Hi and thank you for this package.
The algorithms are indeed very beautiful!

I find your value_iteration.jl especially useful.
Is there a chance you can include some other common algorithms for solving dynamic programming problems?
A recent paper provides 7 common algorithms to solve a routine dynamic programming problem:

image
(the AR process will be discretized into a discrete state Markov Chain)

Optimality conditions:
image

7 standard methods:
image

image

image

image

image

image

image

EM

The implementation of the EM algorithm for GMMs is incorrect as it mixes univariate data x and multivariate component pdfs. Moreover, the calculations should be done in the log space and not in the space of probabilities for numerical reasons.

I believe the double sum in the E step should also be simplified to a single for loop.

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.