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.

Exponential.cs 831 B

123456789101112131415161718192021222324252627282930
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Tensorflow.Keras.ArgsDefinition;
  5. using Tensorflow.Keras.Engine;
  6. using static Tensorflow.Binding;
  7. namespace Tensorflow.Keras.Layers {
  8. public class Exponential : Layer
  9. {
  10. public Exponential(LayerArgs args) : base(args)
  11. {
  12. // Exponential has no args
  13. }
  14. public override void build(Shape input_shape)
  15. {
  16. _buildInputShape = input_shape;
  17. built = true;
  18. }
  19. protected override Tensors Call(Tensors inputs, Tensor state = null, bool? training = null)
  20. {
  21. Tensor output = inputs;
  22. return tf.exp(output);
  23. }
  24. public override Shape ComputeOutputShape(Shape input_shape)
  25. {
  26. return input_shape;
  27. }
  28. }
  29. }