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.

Softplus.cs 1.0 kB

12345678910111213141516171819202122232425262728
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Tensorflow.Common.Types;
  5. using Tensorflow.Keras.ArgsDefinition;
  6. using Tensorflow.Keras.Engine;
  7. using static Tensorflow.Binding;
  8. namespace Tensorflow.Keras.Layers {
  9. public class Softplus : Layer {
  10. public Softplus ( LayerArgs args ) : base(args) {
  11. // Softplus has no arguments
  12. }
  13. <<<<<<< HEAD
  14. protected override Tensors Call ( Tensors inputs, Tensors state = null, bool? training = null, IOptionalArgs? optional_args = null) {
  15. =======
  16. protected override Tensors Call(Tensors inputs, Tensor mask = null, bool? training = null, Tensors initial_state = null, Tensors constants = null)
  17. {
  18. >>>>>>> master
  19. Tensor x = inputs;
  20. return tf.log(
  21. tf.add(tf.exp(x), 1f));
  22. }
  23. public override Shape ComputeOutputShape ( Shape input_shape ) {
  24. return input_shape;
  25. }
  26. }
  27. }