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.

ActivationTest.cs 594 B

12345678910111213141516171819202122
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using NumSharp;
  6. using static Tensorflow.KerasApi;
  7. using Tensorflow;
  8. namespace TensorFlowNET.Keras.UnitTest
  9. {
  10. [TestClass]
  11. public class ActivationTest : EagerModeTestBase
  12. {
  13. [TestMethod]
  14. public void LeakyReLU()
  15. {
  16. var layer = keras.layers.LeakyReLU();
  17. Tensor output = layer.Apply(np.array(-3.0f, -1.0f, 0.0f, 2.0f));
  18. Equal(new[] { -0.9f, -0.3f, 0.0f, 2.0f }, output.ToArray<float>());
  19. }
  20. }
  21. }