This file contains hidden or 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 pylab import * | |
| from numpy.random import dirichlet, rand | |
| def _unit_weight(dim): | |
| return ones(dim) / float(dim) | |
| def _feature_vec(dim, storage = None): | |
| result = rand(dim) | |
| result[where(result > 0.5)] = 1.0 | |
| result[where(result <= 0.5)] = 0.0 |
This file contains hidden or 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 PyPlot | |
| function em_exact(a, b, c, d) | |
| total = 0.0 | |
| for i = 0:(c-1) | |
| total += exp(lbeta(a+i, d+b) - log(d+i) - lbeta(1+i, d) - lbeta(a, b)) | |
| end | |
| return total | |
| end |
This file contains hidden or 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 pylab import * | |
| from numpy.random import dirichlet, rand, binomial, uniform, normal | |
| def _unit_weight(dim): | |
| return ones(dim) / float(dim) | |
| ONE_FRAC = 0.5 | |
| SQRT_TWO_INV = 1.0 / sqrt(2.0) | |
| def _feature_vec(dim, method="bernoulli"): | |
| if method == "bernoulli": |
This file contains hidden or 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
| package benchmark | |
| import akka.actor._ | |
| object ActorBenchmark { | |
| class IntermediateMapper(target: ActorRef) extends Actor { | |
| var state: Wrapper = Wrapper(0,0) | |
| def receive = { | |
| case (w:Wrapper) => { |
This file contains hidden or 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
| package benchmark | |
| import scala.concurrent._ | |
| import scala.concurrent.ExecutionContext | |
| import scalaz._ | |
| import Scalaz._ | |
| import scalaz.stream._ | |
| import scalaz.stream.async._ | |
| import scalaz.concurrent.{Task, Strategy} |
This file contains hidden or 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 ubuntu:14.04 | |
| MAINTAINER Chris Stucchio <stucchio@gmail.com> | |
| # Necessary to add a ppa | |
| RUN apt-get update && apt-get install -y python-software-properties software-properties-common | |
| # Julia repository | |
| RUN add-apt-repository ppa:staticfloat/juliareleases && apt-get update | |
| # Yay julia |
This file contains hidden or 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 stucchio/juliabase:0.3.2 | |
| MAINTAINER Chris Stucchio <stucchio@gmail.com> | |
| # Julia libs we want | |
| ADD REQUIRE /.julia/v0.3/REQUIRE | |
| RUN julia -e "Pkg.resolve()" | |
| # C Libraries we need | |
| RUN apt-get install -y unixodbc unixodbc-dev libsqliteodbc odbc-postgresql libhttp-parser-dev libicu-dev # Utility libs |
This file contains hidden or 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
| module Storage | |
| DB_HOST = ENV["POSTGRES_PORT_5432_TCP_ADDR"] | |
| DB_PORT = ENV["POSTGRES_PORT_5432_TCP_PORT"] | |
| DB_NAME = ENV["POSTGRES_DBNAME"] | |
| DB_USER = ENV["POSTGRES_PGUSER"] | |
| DB_PASS = ENV["POSTGRES_PGPASS"] | |
| conn = connect(Postgres, DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT) |
This file contains hidden or 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 ubuntu:14.04 | |
| MAINTAINER Chris Stucchio <stucchio@gmail.com> | |
| # Nginx | |
| RUN apt-get update && apt-get install -y nginx nginx-extras && mkdir /var/www | |
| ADD nginx.conf /etc/nginx/nginx.conf | |
| ADD run_nginx.sh /bin/run_nginx.sh | |
| RUN chmod +x /bin/run_nginx.sh |
This file contains hidden or 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 ghalton | |
| from pylab import * | |
| from scipy.stats import gamma | |
| def qmc_gamma(alpha, N): | |
| M = len(alpha) | |
| sequencer = ghalton.Halton(2*M) | |
| valid = ones(shape=(N,), dtype=bool) | |
| hs = array(sequencer.get(N)).transpose() |