Random thoughts on
Paper Implementation
Taehoon Kim / carpedm20
Taehoon Kim / carpedm20 /
Paper Implementation
Release of
2015.11.08
Sukhbaatar, Sainbayar, Jason Weston, and Rob Fergus. "End-to-end memory networks." Advances in neural information processing systems. 2015.
Sukhbaatar, Sainbayar, Jason Weston, and Rob Fergus. "End-to-end memory networks." Advances in neural information processing systems. 2015.
Sukhbaatar, Sainbayar, Jason Weston, and Rob Fergus. "End-to-end memory networks." Advances in neural information processing systems. 2015.
https://github.com/facebook/MemNN/tree/mater/MemN2N-lang-model
https://github.com/carpedm20/MemN2N-tensorflow
Lua Torch →
Lua Torch →
Simple Translation
→
https://github.com/carpedm20/MemN2N-tensorflow/blob/master/model.py
Lua Torch 0.5.0
Translation
20+ implementations
900 days
https://carpedm20.github.io/#personal-projects
13,000+
Received questions about implementation
4 random thoughts
1. What to implement
2. What to read
3. TensorFlow or PyTorch?
4. Grants and Competitions
1. What to implement
Computer Vision
Natural Language Processing
Reinforcement Learning
Semi/Un-supervised Learning
…
Computer Vision
Natural Language Processing
Reinforcement Learning
Semi/Un-supervised Learning
…
GAN
Generative Adversarial Network
Too many GANs..
Relatively easier to implement many but not much of a difference
Reasoning
Question Answering
Controllable Text Generation
Unsupervised Embedding
Exploration Without Reward
Neural Programmers
Neural Architecture Search
Hierarchical Representation
Learning
Video Generation
Program Induction
Self-Play Learning
Adversarial Attack
Multi-agent RL
Model-based RL
Meta Learning
Learned Data Augmentation
Speech Synthesis
Music Generation
Meta (Reinforcement) Learning
Transfer Learning
https://blog.openai.com/evolved-policy-gradients/
Adaptive learning from prior experience
with Evolution Strategies (ES)
https://blog.openai.com/evolved-policy-gradients/
Easiest way : learning from pretrained network
But how can we do better?
https://blog.openai.com/evolved-policy-gradients/
𝜃
Loss : 𝑓 𝑥; 𝜃 − 𝑦 (
Neural Network : 𝑓 𝑥; 𝜃
https://blog.openai.com/evolved-policy-gradients/
𝜃𝜙
Loss : 𝐿 𝑥, 𝑦; 𝜙
Neural Network : 𝑓 𝑥; 𝜃
https://blog.openai.com/evolved-policy-gradients/
𝜃𝜙
https://blog.openai.com/evolved-policy-gradients/
https://blog.openai.com/evolved-policy-gradients/
Evolved Policy Gradient Policy Gradient
Ganin, Yaroslav, et al. "Synthesizing Programs for Images using Reinforced Adversarial Learning." arXiv preprint arXiv:1804.01118 (2018).
Distributed RL + GAN
Ganin, Yaroslav, et al. "Synthesizing Programs for Images using Reinforced Adversarial Learning." arXiv preprint arXiv:1804.01118 (2018).
Ganin, Yaroslav, et al. "Synthesizing Programs for Images using Reinforced Adversarial Learning." arXiv preprint arXiv:1804.01118 (2018).
https://blog.openai.com/ingredients-for-robotics-research/
https://blog.openai.com/robots-that-learn/
https://blog.openai.com/competitive-self-play/
2. What to Read
“How to implement a paper FASTER?”
Read others code a lot
Recommendations
• NLP: End-to-End Memory Network
• https://github.com/carpedm20/MemN2N-tensorflow
• Vision: (Fast) Style Transfer
• https://github.com/lengstrom/fast-style-transfer
• RL: Asynchronous Methods for Deep Reinforcement Learning
• https://github.com/openai/universe-starter-agent (TBH code is dirty but there are lots of things to learn)
• https://github.com/ikostrikov/pytorch-a3c
• Etc: Neural Turing Machine
• https://github.com/loudinthecloud/pytorch-ntm
More (nerdy) recommendations
• from tensorflow.contrib.seq2seq import Helper:
• https://github.com/keithito/tacotron/blob/master/models/helpers.py
• tf.while_loop:
• https://github.com/melodyguan/enas/blob/master/src/ptb/ptb_enas_child.py
• import tensorflow.contrib.graph_editor as ge:
• https://github.com/openai/gradient-checkpointing/blob/master/memory_saving_gradients.py
• Google’s production level code example:
• https://github.com/tensorflow/tensor2tensor
• The Annotated Transformer
• http://nlp.seas.harvard.edu/2018/04/03/attention.html
• Relatively safe-to-read codes:
• https://github.com/tensorflow/models
Two useful code snippets
https://github.com/carpedm20/SPIRAL-tensorflow/blob/master/utils/train.py
https://github.com/carpedm20/SPIRAL-tensorflow/blob/master/utils/train.py
https://github.com/carpedm20/SPIRAL-tensorflow/blob/master/utils/train.py
https://github.com/carpedm20/SPIRAL-tensorflow/blob/master/utils/image.py
https://github.com/carpedm20/SPIRAL-tensorflow/blob/master/utils/image.py
https://github.com/carpedm20/SPIRAL-tensorflow/blob/master/utils/image.py
64 batch image → 8 × 8 image grid summary
https://github.com/carpedm20/SPIRAL-tensorflow/blob/master/utils/image.py
64 batch image → 8 × 8 image grid summary
Read more recent and correct code
Never read carpedm20’s code (no joke. BAD examples)
3. TensorFlow or PyTorch?
or
or
Mom
Dad
• Dirty long code
• More stressful debugging
• Faster development (1.5.0: Jan. 18, 1.6.0-1.7.0: Mar. 18, 1.8.0: Apr. 18, possibly more reliable)
• Easier (partial) save and load models (tf.Supervisor)
• Harder dynamic computation (tf.fold)
• XLA, TensorBoard, TPU, tf.eager, Multi-node distribution, Documentation
… compiling parts of the computational graph with XLA (a TensorFlow Just-In-Time compiler) and
…
Espeholt, Lasse, et al. "IMPALA: Scalable Distributed Deep-RL with Importance Weighted Actor-Learner Architectures." arXiv preprint arXiv:1802.01561 (2018).
tensorboard --port 6006 --debugger_port 6064
https://github.com/tensorflow/tensorboard/tree/master/tensorboard/plugins/debugger
https://github.com/tensorflow/tensorboard/tree/master/tensorboard/plugins/debugger
https://github.com/tensorflow/tensorboard/tree/master/tensorboard/plugins/debugger
https://twitter.com/jordannovet/status/977645002200252416
• Clean short code
• Less stressful debugging
• Slower development (0.2.0: Aug. 17, 0.3.0: Dec. 17)
• Dirty (partial) save and load models
• Easier dynamic computation
4. Grants and Competitions
This is not about
https://blog.openai.com/openai-scholars/
https://blog.openai.com/openai-scholars/
Open Challenges
https://blog.openai.com/retro-contest/
https://contest.openai.com/
Workshop Challenges
NIPS, ICML, ICLR
http://www.cs.mcgill.ca/~jpineau/ICLR2018-ReproducibilityChallenge.html
http://www.cs.mcgill.ca/~jpineau/ICLR2018-ReproducibilityChallenge.html
https://openreview.net/forum?id=r1dHXnH6-
Feedback from Authors
https://arxiv.org/abs/1802.03198
So,
Read a paper
Implement a code
Seize the day :)
Great opportunities await you
One more thing...
2015.06 ~
https://www.slideshare.net/carpedm20/ai-67616630
Teaching Machines to Understand Visual Manuals
via Attention Supervision for Object Assembly
Teaching Machines to Understand Visual Manuals via Attention Supervision for Object Assembly (work in progress)
https://www.slideshare.net/carpedm20/deview-2017-80824162
https://carpedm20.github.io/tacotron/
Person A
https://carpedm20.github.io/tacotron/
Person A
https://carpedm20.github.io/tacotron/
Person A
https://carpedm20.github.io/tacotron/
Person B
https://carpedm20.github.io/tacotron/
Person B
https://carpedm20.github.io/tacotron/
Person B
http://www.devsisters.com/jobs/
Thank you
@carpedm20

Random Thoughts on Paper Implementations [KAIST 2018]