If a third party writes buggy code and it involves a Keras model, that's not "a bug in Keras", for Christ's sake
-
Show this thread
-
Just for the record, trainable weight tracking in custom layers works fine and has always worked fine. You can test it yourself, it takes 7 lines of code. Custom layers with trainable weights are used in countless workflows. Can't believe I have to say this
1 reply 1 retweet 55 likesShow this thread -
That said, it's generally good practice to write unit tests for your layers, that test basic assumptions: number of weights, number of trainable weights, output shape, test that the layer produces the same output after deserialization, etc. It enables you to catch common mistakes
1 reply 1 retweet 45 likesShow this thread -
So do, in fact, check it yourself, via a unit test -- it's never wasted time. For any codebase that's actively maintained, you should always aim for 100% coverage
1 reply 2 retweets 52 likesShow this thread -
François Chollet Retweeted François Chollet
Unit tests are the most useful maintenance tool there is -- they enable you to make changes with confidence.https://twitter.com/fchollet/status/1273713171111440385?s=19 …
François Chollet added,
2 replies 9 retweets 75 likesShow this thread -
Replying to @fchollet
Do you know of any useful examples of "good" unit testing in Keras that you don't mind sharing?
1 reply 0 retweets 1 like
Well, you can check out the utility we use for standardized tests on all built-in layers -- it's not comprehensive but it covers the bits that are common to all layers. Search for layer_test
-
-
Replying to @fchollet
Got it, thanks! Here it is if anyone else is interested: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/keras/testing_utils.py …
0 replies 0 retweets 1 likeThanks. Twitter will use this to make your timeline better. UndoUndo
-
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.