Class AbstractActivation

java.lang.Object
org.tensorflow.framework.activations.AbstractActivation
All Implemented Interfaces:
Activation
Direct Known Subclasses:
ELU, Exponential, GELU, HardSigmoid, Linear, ReLU, SELU, Sigmoid, Softmax, Softplus, Softsign, Swish, Tanh

public abstract class AbstractActivation extends Object implements Activation
Abstract base class for Activations
  • Field Details

  • Constructor Details

    • AbstractActivation

      protected AbstractActivation()
      Creates the abstract class for an AbstractActivation
  • Method Details

    • getDefaultConfig

      protected Map<String,Object> getDefaultConfig(String name)
      Gets a configuration map, this default implementation returns a singleton Map, with NAME_KEY as the key, and the name parameter as its value;
      Parameters:
      name - the name of the Activation as known by TensorFlow engine.
      Returns:
      the configuration map
    • getConfig

      public abstract Map<String,Object> getConfig()
      Gets a configuration map
      Returns:
      the configuration map
    • getName

      public abstract String getName()
      Get the name of the activation as known by the TensorFlow Engine
      Returns:
      the name of the activation as known by the TensorFlow Engine
    • getTF

      protected Ops getTF()
      Gets the TensorFlow Ops
      Returns:
      the TensorFlow Ops
    • setTF

      protected void setTF(Ops tf)
      Sets the TensorFlow Ops
      Parameters:
      tf - the TensorFlow Ops
    • checkConfigKeys

      protected void checkConfigKeys(Set<String> keysToCheck, Set<String> allowedKeys)
      Verifies that any key in keysToCheck is also in the allowedKeys set.
      Parameters:
      keysToCheck - the set with keys to check
      allowedKeys - the set to check against.
      Throws:
      IllegalArgumentException - if there is an entry in set1 that is not in set 2.
    • checkClassName

      protected void checkClassName(Map<String,Object> config)
      Verifies that the configuration is for the same Activation class.
      Parameters:
      config - the configuration
      Throws:
      IllegalArgumentException - if the value for the name key does not match the name for the Activation