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
[ | |
{"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}}, | |
] |
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
%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 |
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 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 |
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 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) |
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 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 |
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
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: |
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
```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>() |
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 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) | |
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
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 |
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
[ | |
{"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}}, | |
] | |
/* |