Comments (3)
There are essentially 4 approaches that I'm taking.
If there are known good implementations in core PyTorch or TensorFlow, I check the output of my implementation against those. I do this for LSTM
and GRU
.
If there aren't such implementations, I write the Python equivalent forward pass, let autodiff give me gradients for the backward pass, and check my C++ forward/backward pass outputs against those.
To make sure PyTorch and TensorFlow are in sync, I compute forward/backward outputs from TensorFlow, copy weights to the PyTorch implementation and check those outputs against what I got from the TF implementation.
Finally, I do gradient checking locally during development to make sure I've derived the right equations and that my implementation matches the derivation. I haven't checked this code in yet.
You're right in saying that I don't have checked-in tests for LayerNorm or Zoneout, though I've verified them locally. The trouble with Zoneout in particular is that it's stochastic so black-box testing won't work.
As for trustworthiness, I encourage you to try Haste for yourself. It's usually pretty easy to see if an implementation is good or not. Neural nets are unforgiving when it comes to bad gradients.
from haste.
BTW, if you think there are other approaches we could be taking to test Haste, I'd love to hear them! Code contributions would be even better. :)
from haste.
Great. Those testing strategies are good :) I think it'd be helpful if your tests were checked in, documented, and reproducible. It's hard to trust, otherwise.
For us to get state-of-the-art performance, we need to be able to triple check via tests!
I'd be happy to make code contributions if I was still using Haste. Sorry!
from haste.
Related Issues (20)
- Install on pip on systems without cuda HOT 7
- Segmentation fault on Cuda 10.0 HOT 2
- Support zoneout on lstm cell state and add recurrent dropout HOT 2
- CUDA error: an illegal memory access was encountered HOT 6
- haste_pytorch: Gradient for kernel/recurrent_kernel becomes zero when trained on gpu HOT 4
- How to expose LayerNormGRUCell to python ? HOT 2
- Can't run haste layers in Keras HOT 12
- Biases in final IndRNN layer are 0 HOT 1
- Zoneout remains during eval() HOT 2
- return_state_sequence for tf version
- layer_norm_gru_cell HOT 1
- Can Bidirectional Rnn and multi-layer Rnn be supported? HOT 1
- Activation function in IndRNN HOT 1
- haste_pytorch does not install properly with conda cudatoolkit? HOT 3
- Feature request for cell classes for pytorch HOT 7
- `RNN`s with `zoneout > 0.0` have wrong gradients HOT 1
- haste_tf compilation fails with "‘bfloat16’ in namespace ‘Eigen’ does not name a type"
- Support for PyTorch packed sequences HOT 2
- Supporting RWKV (a RNN that can match transformer LM & zero-shot performance at 1B+ params)
- Nan loss when replace pytorch LSTM with your LSTM or LayerNormLSTM HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from haste.