This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
####################################################### | |
# EXPORTS | |
####################################################### | |
# Expand the history size | |
export HISTFILESIZE=10000 | |
export HISTSIZE=500 | |
# Set the default editor |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible | |
color pablo | |
syntax on | |
set number | |
set backspace=indent,eol,start | |
" highlight found words | |
set hlsearch | |
" show matching parenthesis |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
%s/\({.*}\)\(([^)]*)\)\(\s=\)/\2 where \1\3/g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Turing, Turing.RandomMeasures | |
@model dpmixture(x) = begin | |
rpm = DirichletProcess(1.0) | |
n = zeros(Int, length(x)) | |
z = zeros(Int, length(x)) | |
for i in eachindex(x) | |
z[i] ~ ChineseRestaurantProcess(rpm, n) | |
n[z[i]] += 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Turing | |
using Optim | |
using UnicodePlots | |
import StatsBase.mode | |
@model gdemo_d() = begin | |
s ~ InverseGamma(2, 3) | |
m ~ Normal(0, sqrt(s)) | |
1.5 ~ Normal(m, sqrt(s)) | |
2.0 ~ Normal(m, sqrt(s)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using DrWatson | |
@quickactivate "DynamicPPL_NeurIPS" | |
using Turing | |
using LinearAlgebra | |
using Random: seed! | |
seed!(1) | |
@model testmodel(p, O) = begin | |
x ~ Categorical(p) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Turing | |
using Bijectors | |
using LinearAlgebra | |
Bijectors.bijector(d::LKJ) = PDBijector() | |
@model function correlation(y) | |
N,D = size(y) | |
mu ~ filldist(truncated(Normal(0, 100), -10, 10), D) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Turing | |
@model function ibp(y, α, kmax, ::Type{MV}=Vector{Float64}) where {MV} | |
N = length(y) | |
ks = tzeros(Int, N) | |
ks[1] ~ Poisson(α) | |
ks[1] = ks[1] <= kmax ? ks[1] : kmax | |
z = tzeros(Int, N, kmax) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Turing | |
# This is a crappy implementation of Isabel's model. | |
# For simplicity, I assume all data to be positiv-real valued. | |
# Isabel's paper: http://proceedings.mlr.press/v70/valera17a/valera17a.pdf | |
@model function adst(y, ::Type{TV}=Vector{Float64}) where {TV} | |
N,D = size(y) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Turing | |
using Turing.RandomMeasures | |
# Implementation of infinite mixture model | |
@model function imm(y, α, ::Type{T}=Vector{Float64}) where {T} | |
N = length(y) | |
nk = tzeros(Int, N) | |
z = tzeros(Int, N) | |
for i in 1:N |
OlderNewer