Skip to content

Instantly share code, notes, and snippets.

View zenna's full-sized avatar

Zenna Tavares zenna

View GitHub Profile
@zenna
zenna / interpretclevr.py
Created October 18, 2017 05:00
Simple interpreter and datraloader for CLEVR
import ijson
import os
from enum import Enum
def clevr_iter(clevr_root,
data_type,
train=True):
path = os.path.join(clevr_root, data_type)
train_val = "train" if train else "val"
if train:
@zenna
zenna / qax.py
Created March 7, 2017 20:08
:-O
class Axiom(object):
def __init__(self, lhs, rhs, name):
self.lhs = lhs
self.rhs = rhs
self.name = name
def q_ax(empty, push, pop, items):
nitems = len(items)
axioms = []
eqqueue = empty
class Axiom(object):
def __init__(self, lhs, rhs, name):
self.lhs = lhs
self.rhs = rhs
self.name = name
def q_ax(empty, push, pop, items):
nitems = len(items)
axioms = []
eqqueue = empty
@zenna
zenna / nmf.js
Created September 14, 2015 21:18
NMF
var V_data = [
[Math.random(), Math.random()],
[Math.random(), Math.random()],
[Math.random(), Math.random()]]
var H_data = [
[Math.random(), Math.random(), Math.random()],
[Math.random(), Math.random(), Math.random()]]
var W_data = numeric.dot(V_data, H_data)
Here's a gist by me.
Now an update.
(set-logic QF_NRA)
(declare-fun omega0 () Real)
(declare-fun omega1 () Real)
(push 1)
(push 1)
(assert(<= 0 omega0))
(assert(<= omega0 1))
(assert(<= 0 omega1))
(assert(<= omega1 1))
OS: Linux
CXX: g++-4.8 found at /usr/bin/g++-4.8...
CC: gcc-4.8 found at /usr/bin/gcc-4.8...
-- The C compiler identification is GNU 4.8.2
-- The CXX compiler identification is GNU 4.8.2
-- Check for working C compiler: /usr/bin/gcc-4.8
-- Check for working C compiler: /usr/bin/gcc-4.8 -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/g++-4.8
rr2 = RemoteRef(2)
put!(rr2,"test2")
rr3 = RemoteRef(3)
put!(rr3,"test3")
a = "hello"
function rand2()
return 2*rand(3)
julia> procs()
3-element Array{Int64,1}:
1
2
3
julia> rr = RemoteRef(3)
RemoteRef(3,1,4)
julia> put!(rr,"test")
@zenna
zenna / gist:13dd7c3b8fd1618cbec7
Created January 14, 2015 03:27
Trying to esc vector of variables in macro
macro window(name, data...)
namestring = string(name)
quote
filters = getfilters(symbol($namestring))
if !isempty(filters)
for filter in filters
filter.enabled && filter.f($(data...))
end
end
end