You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jul 1, 2023. It is now read-only.
What has really helped in assuring our layers' correctness is adding a Python reproducer per layer test like this example. Thank you @eaplatanios, @Shashi456, @jon-tow and @t-ae for doing this! As we make more progress towards finishing #402, we need to make sure all the reproducers we add are high-quality (@dan-zheng also mentioned this to me earlier). I propose that we follow the following guidelines in future Python code examples:
Use TensorFlow 2.0 and tf.keras.
Include all code necessary for reproducing the gradients. This includes any import statements.
Use the same variable names for values being differentiated with respect to as the surrounding Swift code.
Leave no blank lines.
Call print() on the gradient, so that reproducing is as easy as copy-paste.
Zero base indentation. Currently I'm seeing:
// ```
// maxpool2D = tf.keras.layers.MaxPool2D(strides=(2, 2))
// with tf.GradientTape() as t:
... which should be changed to:
// ```
// import tensorflow as tf
// maxpool2D = tf.keras.layers.MaxPool2D(strides=(2, 2))
// with tf.GradientTape() as t:
Add a sentence above the code block:
// The expected value of the gradient was computed using the following Python code: