Skip to content

Instantly share code, notes, and snippets.

View bayerj's full-sized avatar

Justin Bayer bayerj

View GitHub Profile
X = predicted position
Z = true position
lds = our learned lds on [X, Z]
# Get marginal LDS
marginal_lds = marginal(lds, (7, 8, 9, 10, 11, 12, 13)) #
# Compile a function to calculate hidden state given position predictions.
f = marginal_lds.function(['inpt'], ['filtered_means'])
#! /usr/bin/env python
import numpy
import time
import sys
N = int(sys.argv[1])
try:
import numpy.core._dotblas
print 'Using ATLAS:'
#! /usr/bin/env python
import numpy
import time
try:
import numpy.core._dotblas
print 'Using ATLAS:'
except ImportError:
print 'No ATLAS:'
print numpy.__version__
In [87]: A, B = np.ones((1, 2)), np.random.random((3, 3, 1))
In [88]: B
Out[88]:
array([[[ 0.02738198],
[ 0.23332334],
[ 0.12513209]],
[[ 0.48753864],
[ 0.45401342],
@bayerj
bayerj / code
Created January 11, 2012 06:38
Theano differentiation through scan
import theano, theano.tensor as T
inpt = T.vector('inpt')
W = T.matrix('weights')
output = T.dot(inpt, W)
d_output_wrt_inpt, _ = theano.map(lambda i: T.grad(output[i], inpt),
T.arange(output.shape[0]))
f = theano.function([inpt, W], d_output_wrt_inpt)
import scipy
import theano, theano.tensor as T
# Create parameters.
#
# Parameters are first allocated in a long consecutive array as a shared
# variable. Afterwards, reshaped subtensors are used in the expressions in.
# Why? We want to be able to differentiate wrt groups of parameters which
# are in consecutive memory.
import scipy
import theano, theano.tensor as T
# Create parameters.
#
# Parameters are first allocated in a long consecutive array as a shared
# variable. Afterwards, reshaped subtensors are used in the expressions in.
# Why? We want to be able to differentiate wrt groups of parameters which
# are in consecutive memory.
$ py -c 'import zmq'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/Library/Python/2.6/site-packages/zmq/__init__.py", line 38, in <module>
from zmq import core, devices
File "/Library/Python/2.6/site-packages/zmq/core/__init__.py", line 26, in <module>
from zmq.core import (constants, error, message, context,
ImportError: dlopen(/Library/Python/2.6/site-packages/zmq/core/error.so, 2): Symbol not found: _zmq_errno
Referenced from: /Library/Python/2.6/site-packages/zmq/core/error.so
Expected in: flat namespace
diff --git a/theano/tensor/basic.py b/theano/tensor/basic.py
index f9e7240..091486b 100644
--- a/theano/tensor/basic.py
+++ b/theano/tensor/basic.py
@@ -5091,6 +5091,7 @@ class AdvancedSubtensor(Op):
rest = inputs[1:]
return [AdvancedIncSubtensor(self.args)(zeros_like(x), gz, *rest)] + [None]*len(rest)
+
class AdvancedIncSubtensor(Op):
@bayerj
bayerj / build.sh
Created September 30, 2011 15:43 — forked from reklis/build.sh
Archive post-action
asdasd#in older versions of Xcode4 you may need to set PRODUCT_NAME manually
DIST_LIST=<TestFlight Distribution List name here>
API_TOKEN=<TestFlight API token here>
TEAM_TOKEN=<TestFlight team token here>
SIGNING_IDENTITY="iPhone Distribution: Development Seed"
PROVISIONING_PROFILE="${HOME}/Library/MobileDevice/Provisioning Profiles/MapBox Ad Hoc.mobileprovision"
LOG="/tmp/testflight.log"
DATE=$( /bin/date +"%Y-%m-%d" )