Browse Source

fix _assign_new_value for BatchNormaliztion.

tags/v0.30
Oceania2018 4 years ago
parent
commit
1623bb87a7
2 changed files with 4 additions and 1 deletions
  1. +3
    -0
      src/TensorFlowNET.Core/Gradients/TapeTensor.cs
  2. +1
    -1
      src/TensorFlowNET.Keras/Layers/BatchNormalization.cs

+ 3
- 0
src/TensorFlowNET.Core/Gradients/TapeTensor.cs View File

@@ -22,5 +22,8 @@ namespace Tensorflow.Gradients

public Tensor OnesLike()
=> tf.ones(shape: shape, dtype: dtype);

public override string ToString()
=> $"{id}, {shape}, {dtype.as_numpy_name()}";
}
}

+ 1
- 1
src/TensorFlowNET.Keras/Layers/BatchNormalization.cs View File

@@ -196,7 +196,7 @@ namespace Tensorflow.Keras.Layers
_assign_moving_average(moving_variance, variance, momentum_tensor);

if (use_fused_avg_updates)
_assign_new_value(moving_variance, mean);
_assign_new_value(moving_variance, variance);
else
_assign_moving_average(moving_variance, variance, momentum_tensor);



Loading…
Cancel
Save