Package org.ojalgo.ann
Enum ArtificialNeuralNetwork.Activator
- java.lang.Object
-
- java.lang.Enum<ArtificialNeuralNetwork.Activator>
-
- org.ojalgo.ann.ArtificialNeuralNetwork.Activator
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<ArtificialNeuralNetwork.Activator>
- Enclosing class:
- ArtificialNeuralNetwork
public static enum ArtificialNeuralNetwork.Activator extends java.lang.Enum<ArtificialNeuralNetwork.Activator>
https://en.wikipedia.org/wiki/Activation_function
-
-
Field Summary
Fields Modifier and Type Field Description private PrimitiveFunction.Unary
myDerivativeInTermsOfOutput
private java.util.function.Consumer<PhysicalStore<java.lang.Double>>
myFunction
private boolean
mySingleFolded
-
Constructor Summary
Constructors Modifier Constructor Description private
Activator(java.util.function.Consumer<PhysicalStore<java.lang.Double>> function, PrimitiveFunction.Unary derivativeInTermsOfOutput, boolean singleFolded)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) void
activate(PhysicalStore<java.lang.Double> output)
(package private) void
activate(PhysicalStore<java.lang.Double> output, double probabilityToKeep)
(package private) PrimitiveFunction.Unary
getDerivativeInTermsOfOutput()
(package private) boolean
isSingleFolded()
static ArtificialNeuralNetwork.Activator
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static ArtificialNeuralNetwork.Activator[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
IDENTITY
public static final ArtificialNeuralNetwork.Activator IDENTITY
(-,+)
-
RELU
public static final ArtificialNeuralNetwork.Activator RELU
ReLU: [0,+)
-
SIGMOID
public static final ArtificialNeuralNetwork.Activator SIGMOID
[0,1]
-
SOFTMAX
public static final ArtificialNeuralNetwork.Activator SOFTMAX
[0,1]
Currently this can only be used in the final layer in combination withArtificialNeuralNetwork.Error.CROSS_ENTROPY
. All other usage will give incorrect network training.
-
TANH
public static final ArtificialNeuralNetwork.Activator TANH
[-1,1]
-
-
Field Detail
-
myDerivativeInTermsOfOutput
private final PrimitiveFunction.Unary myDerivativeInTermsOfOutput
-
myFunction
private final java.util.function.Consumer<PhysicalStore<java.lang.Double>> myFunction
-
mySingleFolded
private final boolean mySingleFolded
-
-
Constructor Detail
-
Activator
private Activator(java.util.function.Consumer<PhysicalStore<java.lang.Double>> function, PrimitiveFunction.Unary derivativeInTermsOfOutput, boolean singleFolded)
-
-
Method Detail
-
values
public static ArtificialNeuralNetwork.Activator[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (ArtificialNeuralNetwork.Activator c : ArtificialNeuralNetwork.Activator.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static ArtificialNeuralNetwork.Activator valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
activate
void activate(PhysicalStore<java.lang.Double> output)
-
activate
void activate(PhysicalStore<java.lang.Double> output, double probabilityToKeep)
-
getDerivativeInTermsOfOutput
PrimitiveFunction.Unary getDerivativeInTermsOfOutput()
-
isSingleFolded
boolean isSingleFolded()
-
-