Skip to content

Instantly share code, notes, and snippets.

View madanh's full-sized avatar

Hennadii Madan madanh

View GitHub Profile
@madanh
madanh / gist:928cf444b22bac4764262fe19843f54a
Created January 10, 2021 03:29
throw away gist for fcc
{
"name": "uniqueuntruemicrokernel",
"version": "1.0.0",
"description": "throw away for fcc",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "Hennadii Madan",
"license": "ISC"
@madanh
madanh / pymc3test0.py
Created August 9, 2017 11:33
Strange shape of internal logp function .stats._log_post_trace() test case
import numpy as np
import matplotlib.pyplot as plt
import pymc3 as pm
import theano
print("numpy version",np.__version__)
print("theano version",theano.__version__)
print("pymc version",pm.__version__)
floatX = theano.config.floatX # "float32"
@madanh
madanh / slicer.py
Created July 21, 2017 09:50
new astep function for Slice sampler
# Modified from original implementation by Dominik Wabersich (2013)
import numpy as np
import numpy.random as nr
from .arraystep import ArrayStep, Competence
from ..model import modelcontext
from ..theanof import inputvars
from ..vartypes import continuous_types
@madanh
madanh / gist:a3e9a7e621f7fc5c50d7513de37f7ab8
Created December 1, 2016 07:37
a lnl that gives memory leaks
def lnl(theta,ndim,nparams):
'''
A dumb implementation of log-likelihood for the multigauss(tm) model.
We follow separation strategy of Barnard and McCuloch and
parametrize the covariance matrix through stds and correlation coeffs.
Inversion to precision matrix is done in the loop [facepalm.jpg].
'''
# Unpack the theta
##infer the number of proper parameters and truth from data size