This repository was archived by the owner on Jul 1, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -975,12 +975,13 @@ final class LayerTests: XCTestCase {
975
975
let x = Tensor < Float > ( rangeFrom: 0 , to: 20 , stride: 1 ) . reshaped ( to: [ 4 , 5 ] )
976
976
let epsilon = Tensor < Float > ( 0.001 )
977
977
let bnLayer = BatchNorm < Float > ( featureCount: 5 , axis: 1 , epsilon: epsilon)
978
- // Test inferrence before any training is only changed by epsilon value .
978
+ // Test inference before any training.
979
979
assertEqual ( bnLayer. inferring ( from: x) , x / TensorFlow. sqrt ( 1 + epsilon) , accuracy: 1e-5 )
980
- // Test inferrence after single training step.
980
+ // Perform one training step, updating the running mean and variance .
981
981
Context . local. learningPhase = . training
982
- let y = bnLayer ( x)
983
- // The expected values were computed using the following TensorFlow 2.0 Beta1 Python code :
982
+ _ = bnLayer ( x) // This line is important and cannot be removed.
983
+ // Test inference after training step.
984
+ // The expected value was computed using the following Python code:
984
985
// ```
985
986
// x = tf.reshape(tf.range(20, dtype=tf.float32), [4,5])
986
987
// y_train = bnLayer(x, training=True)
You can’t perform that action at this time.
0 commit comments