Skip to content

Instantly share code, notes, and snippets.

View gpantalos's full-sized avatar

Georges Pantalos gpantalos

View GitHub Profile
@gpantalos
gpantalos / numpy_gp.py
Created April 13, 2021 08:46
Gaussian Process in NumPy
import matplotlib.pyplot as plt
import numpy as np
inv = np.linalg.inv
class GaussianProcess:
def __init__(self, kernel, observed_index_points, observed_values,
mean_function=None, stddev=1.0, noise_var=0.0):
self.observed_index_points = self._handle(observed_index_points)
@gpantalos
gpantalos / stein_identity.ipynb
Last active November 7, 2021 00:15
Stein's Identity in Tensorflow
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@gpantalos
gpantalos / laplace_approximation.py
Created February 4, 2021 13:48
Laplace Approximation in PyTorch
"""
Laplace approximation of a Beta distribution.
"""
import matplotlib.pyplot as plt
import torch
x = torch.linspace(0, 1, 200)
p = torch.distributions.Beta(2, 5)