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
#!/usr/bin/env python | |
""" | |
A ~very~ simple template engine. | |
This script replaces variables in FILES with the values | |
found in variables.yml. This could be used to refer to | |
the HIT payment in multiple files without needing to update | |
every file when the payment changes. | |
The experiment directory is copied to an output directory, deploy/ |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
#!/usr/bin/env python | |
"""Hidden Markov Models | |
Abstract base class for HMMs and an implementation of an HMM | |
with discrete states and gaussian emissions. | |
""" | |
import tensorflow as tf | |
import edward as ed | |
from edward.models import Bernoulli, Categorical, Normal |
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
from itertools import chain, combinations | |
def powerset(iterable): | |
xs = list(iterable) | |
return chain.from_iterable( combinations(xs,n) for n in range(len(xs)+1) ) | |
# Features are binary. An item either has or does not have every feature. | |
features = 'abcde' | |
hypotheses_sets = { |
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
from toolz import pipe | |
class Blank(object): | |
"""Forgive me Lord, for I have sinned. | |
Inspired by implicit partial application in Coconut: | |
http://coconut.readthedocs.io/en/master/DOCS.html#implicit-partial-application | |
""" | |
def __getattr__(self, attr): |
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
import numpy as np | |
import pymc3 as pm | |
import theano | |
class StochasticMatrix(pm.Continuous): | |
"""A stochastic matrix has rows that sum to 1.""" | |
def __init__(self, theta, *args, **kwargs): | |
shape = (theta.shape[-1], theta.shape[-1]) | |
kwargs.setdefault('shape', shape) | |
super(StochasticMatrix, self).__init__(*args, **kwargs) |
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
import itertools as it | |
import numpy as np | |
ivs = [ | |
('hit', [0, 1, 2]), | |
('layout', 'ABCDEF'), | |
('cue', 'TF'), | |
] | |
# At present, the first iv defines the number and orderof trials. Thus, |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
@font-face { | |
font-family: 'Cinzel'; | |
font-style: normal; | |
font-weight: 400; | |
src: local('Cinzel-Regular'), url(//themes.googleusercontent.com/static/fonts/cinzel/v1/mLL0ZqnXRx3m16FnBy9gcg.woff) format('woff'); | |
} | |
@font-face { | |
font-family: 'Droid Sans'; | |
font-style: normal; | |
font-weight: 400; |