Giter Site home page Giter Site logo

Testing? about haste HOT 3 CLOSED

lmnt-com avatar lmnt-com commented on May 26, 2024
Testing?

from haste.

Comments (3)

sharvil avatar sharvil commented on May 26, 2024

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.

sharvil avatar sharvil commented on May 26, 2024

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.

PetrochukM avatar PetrochukM commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.