Skip to content

Instantly share code, notes, and snippets.

View alexbw's full-sized avatar

Alex Wiltschko alexbw

  • Google
  • Boston, MA
View GitHub Profile
[
{"keys": ["alt+shift+up"], "command": "move_by_paragraph", "args": {"forward": false, "extend": true}},
{"keys": ["alt+shift+down"], "command": "move_by_paragraph", "args": {"forward": true, "extend": true}},
{"keys": ["alt+up"], "command": "move_by_paragraph", "args": {"forward": false, "extend": false}},
{"keys": ["alt+down"], "command": "move_by_paragraph", "args": {"forward": true, "extend": false}},
]
%pylab inline
#!/usr/bin/env python
from stat import S_ISREG, ST_CTIME, ST_MODE
import os, sys, time
# path to the directory (relative or absolute)
dirpath = "/Users/Alex/Code/autograd/.asv/results/quincy.local/"
# get all entries in the directory w/ stats
from pylab import *
from autograd import grad
import autograd.numpy as np
import torch
from torch.autograd import Variable
from memory_profiler import memory_usage
from autograd.core import forward_pass, make_vjp
from autograd.convenience_wrappers import safe_type,as_scalar,cast_to_same_dtype
batch_size = 16
import autograd.numpy as np
from autograd import grad
##################################################################
def autograd_rnn(params, x, label):
W, b, Wout, bout = params
h1 = x
for i in range(10):
h1 = np.tanh(np.dot(h1, W) + b)
from pylab import *
from autograd import grad
import autograd.numpy as np
import torch
from torch.autograd import Variable
from memory_profiler import memory_usage
batch_size = 16
D = 2**10
Line # Hits Time Per Hit % Time Line Contents
==============================================================
6 def grad_fn(x):
7 1 5 5.0 0.3 x_stack = deque()
8 1 2 2.0 0.1 (_eebd10_stack, _eebd10) = (deque(), None)
9 1 1 1.0 0.1 (_dab857_stack, _dab857) = (deque(), None)
10 1 1 1.0 0.1 (_14c3e8_stack, _14c3e8) = (deque(), None)
11 1 3 3.0 0.2 _eebd10 = range(100)
12 1 2 2.0 0.1 _eebd10_stack.append(_eebd10)
13 101 73 0.7 5.0 for i in _eebd10:
```python
def f(x):
return np.sum(x)
grad(f)(np.eye(3))
```
```python
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-2-a3386d50981f> in <module>()
def f(params,image):
h1 = layer1(params,image)
h2 = layer2(params,h1)
with gradsthru(h2) as gh2:
print("Only evaluated in the backwards pass!")
print(np.linalg.norm(gh2))
print("Clipping just this gradient!")
gh2 = np.clip(gh2,-10,10)
package="lbase64"
version="20120820-1"
source = {
url = "https://www.dropbox.com/s/p5qei9czulhox6w/lbase64.tar.gz?dl=0",
dir = "base64"
}
description = {
summary = "A Base64 library for Lua",
detailed = [[
A Base64 library for Lua. Base64 is a base-64 transfer encoding that
@alexbw
alexbw / gist:89a82f2aaeecf37c33d7
Last active February 18, 2016 20:49
Move by paragraph
[
{"keys": ["alt+shift+up"], "command": "move_by_paragraph", "args": {"forward": false, "extend": true}},
{"keys": ["alt+shift+down"], "command": "move_by_paragraph", "args": {"forward": true, "extend": true}},
{"keys": ["alt+up"], "command": "move_by_paragraph", "args": {"forward": false, "extend": false}},
{"keys": ["alt+down"], "command": "move_by_paragraph", "args": {"forward": true, "extend": false}},
]
/*