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 theano import tensor as T | |
| import theano | |
| import numpy as np | |
| x = T.tensor3('') | |
| xf = x.flatten() | |
| xr1 = x.reshape((x.shape[0] * x.shape[1], x.shape[-1])) | |
| xr2 = x.reshape((-1, x.shape[-1])) | |
| ff = theano.function([x], xf) |
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
| ====================================================================== | |
| ERROR: learn.test_cnn.test_cnn_fit | |
| ---------------------------------------------------------------------- | |
| Traceback (most recent call last): | |
| File "/Users/bayerj/anaconda/lib/python2.7/site-packages/nose/case.py", line 197, in runTest | |
| self.test(*self.arg) | |
| File "/Users/bayerj/devel/breze/tests/learn/test_cnn.py", line 52, in test_cnn_fit | |
| m.fit(X, Z) | |
| File "/Users/bayerj/devel/breze/breze/learn/base.py", line 235, in fit | |
| for i, info in enumerate(itr): |
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
| Error compiling Cython file: | |
| ------------------------------------------------------------ | |
| ... | |
| (H5E_ARGS, H5E_BADTYPE): ValueError, # Invalid location in file | |
| (H5E_REFERENCE, H5E_CANTINIT): ValueError, # Dereferencing invalid ref | |
| } | |
| cdef struct err_data_t: | |
| H5E_error_t err |
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 theano | |
| import theano.tensor as T | |
| import theano.sandbox.cuda as cuda | |
| from theano.printing import pydotprint | |
| from theano.misc import pycuda_utils | |
| from pycuda.gpuarray import zeros | |
| import pycuda.driver as drv | |
| import pycuda.autoinit | |
| from pycuda.compiler import SourceModule |
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 theano, theano.tensor as T | |
| from theano.tensor.shared_randomstreams import RandomStreams | |
| def theano_expr_bfs(expr): | |
| stack = [expr] | |
| while True: | |
| if not stack: | |
| break | |
| expr = stack.pop() |
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
| dot = (target[:, :, 3:7] * prediction[:, :, 6:10]).sum(axis=2).dimshuffle(0, 1, 'x') | |
| dot = T.clip(dot, -.99, .99) | |
| angle_loss = T.arccos(dot) | |
| return residuals ** 2 + c * angle_loss |
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
| numpydoc>=0.4 |
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
| Traceback (most recent call last): | |
| File "theanorngclone.py", line 12, in <module> | |
| f = theano.function([x_sub], samples_sub) | |
| File "/Users/bayerj/devel/Theano/theano/compile/function.py", line 222, in function | |
| profile=profile) | |
| File "/Users/bayerj/devel/Theano/theano/compile/pfunc.py", line 506, in pfunc | |
| on_unused_input=on_unused_input) | |
| File "/Users/bayerj/devel/Theano/theano/compile/function_module.py", line 1298, in orig_function | |
| on_unused_input=on_unused_input).create( | |
| File "/Users/bayerj/devel/Theano/theano/compile/function_module.py", line 994, in __init__ |
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
| def q_mult(q1, q2): | |
| w1, x1, y1, z1 = q1[:, 0], q1[:, 1], q1[:, 2], q1[:, 3] | |
| w2, x2, y2, z2 = q2[:, 0], q2[:, 1], q2[:, 2], q2[:, 3] | |
| w = w1 * w2 - x1 * x2 - y1 * y2 - z1 * z2 | |
| x = w1 * x2 + x1 * w2 + y1 * z2 - z1 * y2 | |
| y = w1 * y2 + y1 * w2 + z1 * x2 - x1 * z2 | |
| z = w1 * z2 + z1 * w2 + x1 * y2 - y1 * x2 | |
| if isinstance(q1, np.ndarray): | |
| w = w[:, np.newaxis] |
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 theano | |
| import theano.tensor as T | |
| import gnumpy | |
| import theano.misc.gnumpy_utils as gput | |
| g = gnumpy.zeros((1, 2)) | |
| g += np.array([[2, 1]]) | |
| x = T.matrix() | |
| expr = 2 * x |