Skip to content

Instantly share code, notes, and snippets.

View binarybana's full-sized avatar

Jason Knight binarybana

View GitHub Profile
import tvm
from tvm import relay
from tvm.contrib import graph_runtime
import numpy as np
shapes = []
for sort in [1000, 10000, 100000, 1000000]:
for non_sort in [1, 10, 100]:
for axis in [0, 1, 2]:

Keybase proof

I hereby claim:

  • I am binarybana on github.
  • I am jmknight (https://keybase.io/jmknight) on keybase.
  • I have a public key ASAfhwLxKMGSO7MGvJqN0H3b8edS8W1IvVK05MDnY2YrvAo

To claim this, I am signing this object:

@binarybana
binarybana / cf-k8s.json
Last active October 13, 2015 21:17
Cloudformation script to spin up K8S without many permissions
{
"AWSTemplateFormatVersion": "2010-09-09",
"Description": "Kubernetes 1.0.4 on EC2 powered by CoreOS 766.3.0 (stable)",
"Mappings": {
"RegionMap": {
"eu-central-1" : {
"AMI" : "ami-bececaa3"
},
"ap-northeast-1" : {
"AMI" : "ami-f2338ff2"
@binarybana
binarybana / interview.jl
Created January 13, 2015 21:00
Interview Question
using PyPlot
using Base.Test
function minops{T<:Integer}(n::T)
queue = (T,T)[]
push!(queue, (n,0))
visited = Set{T}()
pops,evals = 0,0
while true
pops += 1
data = rand(0:1000,48,18000)
function test()
reload("uniquename2.jl")
normfac = vec(mapslices(x->quantile(x,0.75), data, 2))
cls = MPM.mpm_classifier(rand(0:100,4,3), rand(0:100,4,3))
MPM.sample(cls,1)
end
for i=1:100
@binarybana
binarybana / console output
Created September 23, 2014 21:35
Julia Segfault on Module Reloading
jason@toxicvm:~/test3$ ~/src/julia/julia testcase.jl
1
2
Warning: replacing module MPM
3
Warning: replacing module MPM
4
Warning: replacing module MPM
5
@binarybana
binarybana / Julia console
Created August 25, 2014 18:37
Segfault in Julia
julia> include(joinpath(Pkg.dir(), "OBC/test/testcase.jl"))
(1.8508481979370117,0.0008389949798583984)
julia> include(joinpath(Pkg.dir(), "OBC/test/testcase.jl"))
Warning: replacing module OBC
Warning: replacing module NSum
Warning: replacing module MPM
Warning: Method definition sum(Float64,) in module MPM at /home/jason/.julia/v0.4/OBC/src/mpm.jl:141 overwritten in module MPM at /home/jason/.julia/v0.4/OBC/src/mpm.jl:141.
Warning: replacing module SAMC
@binarybana
binarybana / attempt.jl
Created July 14, 2014 21:15
Mamba Distribution
using Mamba
data = (Symbol=>Any)[:x1 => [10, 12, 14, 9],
:x2 => [10,11,12,8]]
N = length(data[:x2])
data[:N] = N
d=10.0
@binarybana
binarybana / bench.jl
Last active August 29, 2015 14:01
Benchmarking Sampling Code
using StatsBase
randsubseq2(A::AbstractVector, m::Integer) = randsubseq2!(Array(eltype(A),m), A)
function randsubseq2!(S::AbstractVector, A::AbstractArray)
m = length(S)
m == 0 && return S # needed for correctness: code below requires m > 0
n = length(A)
m == n && return copy!(S, A)
0 <= m <= n || throw(DomainError())
@binarybana
binarybana / pongcl.jl
Created April 20, 2014 00:40
ZMQ.jl Ping Pong Performance Benchmark
using ZMQ
ctx = Context(1)
s = Socket(ctx, ZMQ.REQ)
ZMQ.connect(s, "tcp://localhost:7001")
gc_disable()
readline()
for i=1:20
tic()