https://slides.com/henrye/deck-2/
A Python based scientific computing package
Research
NumPy
Celebrity endorsements
Dynamic computation graphs
Dynamic computation graphs
Can use regular control flow statements eg. for loops
Much easier to debug, can set breakpoints anywhere in the code
Dynamic computation graphs
Want to execute layers conditionally, such as an RNN that stops whenever an end-of-sentence (EOS) token is produced? Someone using Pytorch will be on their 3rd failed AI startup by the time you’re done with that.
import numpy as np
import torch
from torch.autograd import Variable
model = torch.nn.Linear(1, 1)
loss_fn = torch.nn.MSELoss(size_average=False)
optimizer = torch.optim.SGD(model.parameters(), lr=0.01)
for t in range(10000):
x = Variable(torch.from_numpy(np.random.random((1,1)).astype(np.float32)))
y = x * 3
y_pred = model(x)
loss = loss_fn(y_pred, y)
optimizer.zero_grad()
loss.backward()
optimizer.step()
print loss.data[0]
Source: Tensorflow sucks
import tensorflow as tf
import numpy as np
X = tf.placeholder("float")
Y = tf.placeholder("float")
W = tf.Variable(np.random.random(), name="weight")
pred = tf.multiply(X, W)
cost = tf.reduce_sum(tf.pow(pred-Y, 2))
optimizer = tf.train.GradientDescentOptimizer(0.01).minimize(cost)
init = tf.global_variables_initializer()
with tf.Session() as sess:
sess.run(init)
for t in range(10000):
x = np.array(np.random.random()).reshape((1, 1, 1, 1))
y = x * 3
(_, c) = sess.run([optimizer, cost], feed_dict={X: x, Y: y})
print c
Source: Tensorflow sucks
Deployment and multi GPU training
TensorBoard visualisation
Are doing research, especially NLP
Like debugging things easily
Are a machine learning hipster
https://slides.com/henrye/deck-2/
Pytorch dynamic computation graph gif
Pytorch or tensorflow - good overview on a category by category basis with the winner of each
Tensor Flow sucks - a good comparison between pytorch and tensor flow
What does google brain think of pytorch - most upvoted question on recent google brain
Pytorch in five minutes - video by siraj
I realised I like @pytorch because it's not a deeplearning framework, it is truly a lightweight, no-brainer numpy replacement and extension - ferenc huszar tweet
Cs231n slides comparing tensorflow and pytorch
Smerity talking on hacker news about pytorch and dynamic computation graphs
Pytorch distilled - Good example of pytorch code on training a model
Everytime a deep learning frame work dies Jeff Dean experiences a quickening - gif meme
Can’t scooped by google if you’re not using tensor flow - karpathy image meme
Using pytorch for a few months, eye sight improved, skin cleaerer - karpath tweet
Pro-pytorch iclr people having more fun - tweet
Informal list of sources for the talk