Skip to content

Instantly share code, notes, and snippets.

View mlaves's full-sized avatar

Max-Heinrich Laves mlaves

View GitHub Profile
@mlaves
mlaves / bayesian_optimization.ipynb
Created January 23, 2021 12:50
bayesian_optimization.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mlaves
mlaves / two_moons_create_opener.ipynb
Last active April 2, 2025 08:20
Unsupervised toy experiment on the "two moons" data set.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mlaves
mlaves / linear-regression-metropolis-hastings.ipynb
Last active September 17, 2020 14:18
Linear Regression Metropolis-Hastings.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mlaves
mlaves / pyro_classification.ipynb
Last active August 8, 2024 10:32
Simple Classification Example in Pyro with SVI and MCMC
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mlaves
mlaves / fast_multidim_dot_numpy.ipynb
Created September 6, 2019 09:09
fast_multidim_dot_numpy.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mlaves
mlaves / Newton-Raphson-Clojure.clj
Last active August 29, 2015 14:05
Clojure implementation of Newton-Raphson root calculation.
(def step 1E-10)
(def eps 1E-15)
(defn rootNP
[f x]
(let [m (/ (- (f (+ x step)) (f x)) step)
b (- (f x) (* m x))
x-0 (- (/ b m))]
(if (<= (Math/abs (- x x-0)) eps)
x-0
@mlaves
mlaves / Newton-Raphson-Python.py
Last active August 29, 2015 14:05
Python implementation of Newton-Raphson root calculation.
import time
import numpy as np
def rootNR(f, start_x):
step = 1e-10 # small increment
x = start_x
eps = 1e-15 # need eps, on some functions abs(x-x_0) never reaches zero
while True:
m = (f(x+step) - f(x))/step