You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

NeuralNetworkTest.cs 510 B

123456789101112131415161718
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using static Tensorflow.Binding;
  3. using Tensorflow.NumPy;
  4. namespace TensorFlowNET.UnitTest.NenuralNetwork
  5. {
  6. [TestClass]
  7. public class NeuralNetworkTest : EagerModeTestBase
  8. {
  9. [TestMethod]
  10. public void l2_loss()
  11. {
  12. var x = tf.Variable(np.array(new[,] { { 1, 2, 3, 4 }, { 5, 6, 7, 8 } }), dtype: tf.float32);
  13. var l2 = tf.nn.l2_loss(x);
  14. Assert.AreEqual(l2.numpy(), 102f);
  15. }
  16. }
  17. }