I hereby claim:
- I am cberzan on github.
- I am cberzan (https://keybase.io/cberzan) on keybase.
- I have a public key whose fingerprint is FEEB 0FF1 D39A 1323 C732 323A D712 8D28 B3D8 0DA1
To claim this, I am signing this object:
# Supporting code for this blog article: | |
# https://thirld.com/blog/2018/05/17/linear-algebra-solves-a-childhood-mystery/ | |
# | |
# License: public domain. | |
import itertools | |
import numpy as np | |
def pretty_print_matrix(name, M): |
#!/usr/bin/env python | |
# Find anagram groups in the given dictionary file. | |
# | |
# Example usage: ./anagrams.py /usr/share/dict/words | |
# | |
# The input file must have one word per line. We do not do any | |
# preprocessing, like lowercasing or removing punctuation. | |
# | |
# The output (stdout) contains one anagram group per line. |
////////////////////////////////////////////////////////////////////////////// | |
// Dynamics model: | |
// Car parameters: | |
random Real car_a ~ DontCare(); | |
random Real car_b ~ DontCare(); | |
random Real car_h ~ DontCare(); | |
random Real car_L ~ DontCare(); | |
// Initial car pose: |
# Utils for handling files in ~/Downloads: | |
DOWNLOADS_DIR="$HOME/Downloads" | |
function lsdl() { | |
ls --color -1 -t "$DOWNLOADS_DIR" |head |nl | |
} | |
function cpdl() { | |
if [ "a$1" == 'a-h' ] || [ "a$1" == 'a--help' ]; then |
import com.cra.figaro.language._ | |
import com.cra.figaro.library._ | |
import com.cra.figaro.library.compound._ | |
import com.cra.figaro.algorithm.sampling._ | |
import scala.math | |
object Node extends Enumeration { | |
type Node = Value |
../example/galaxy.blog | |
../example/galaxy.blog::108.7: Number expression expecting implicit set | |
../example/infinite-GMM.blog | |
java.lang.IllegalArgumentException: The mean given is not a valid row vector. It has dimensions 2 by 1. at blog.distrib.MultivarGaussian.setParams(MultivarGaussian.java:89) at blog.distrib.MultivarGaussian.setParams(MultivarGaussian.java:70) at blog.model.DistribSpec.initCPD(DistribSpec.java:260) at blog.model.DistribSpec.compile(DistribSpec.java:192) at blog.model.DependencyModel.compile(DependencyModel.java:202) at blog.model.RandomFunction.compile(RandomFunction.java:127) at blog.model.Model.compile(Model.java:531) at blog.Main.setup(Main.java:472) at blog.Main.main(Main.java:152) Error initializing CPD at 21: couldn't instantiate class class blog.distrib.MultivarGaussian Encountered 1 errors in compilation phase. | |
../example/aircraft-position.blog | |
../example/aircraft-position.blog::26.7: Number expression expecting implicit set (no location): Symbol "B1" is neither a variable in th |
Error Examples | |
../example/galaxy.blog | |
../example/infinite-GMM.blog | |
../example/aircraft-position.blog | |
../example/solutions/simple-aircraft.blog | |
../example/sybil-attack-exp3.blog | |
../example/general-fixed-fun.blog | |
../example/balls/id-uncert-det.blog | |
../example/balls/id-uncert-noisy.blog | |
../example/multivar-gaussian-random-params/random-mu-fixed-sigma.blog |
////////////////////////////////////////////////////////////////////////////// | |
// BLOG use case: Want some burn-in samples at the beginning of the run. | |
model = new Model.fromFile("burglary.blog") | |
evidence = new Evidence() | |
evidence.addFromFile("burglary.evi") | |
queries = new List() | |
sampler = new blog.sample.MHSampler(model, evidence, queries) | |
engine = new blog.engine.SamplingEngine(sampler) | |
// Burn-in: Since no queries are set yet, no results are recorded. |
import java.util.Random; | |
public class Benchmark { | |
public Benchmark() { | |
rng = new Random(); | |
hasLower = false; | |
hasUpper = false; | |
} | |
public void setParams(Double lower, Double upper) { |
I hereby claim:
To claim this, I am signing this object: