Package com.github.raimannma.methods
Enum Mutation
- All Implemented Interfaces:
Serializable
,Comparable<Mutation>
,Constable
public enum Mutation extends Enum<Mutation>
Mutation methods.
- Author:
- Manuel Raimann
-
Nested Class Summary
-
Enum Constant Summary
Enum Constants Enum Constant Description ADD_BACK_CONN
ADD BACK CONN.ADD_CONN
ADD CONN.ADD_GATE
ADD GATE.ADD_NODE
ADD NODE.ADD_SELF_CONN
ADD SELF CONN.MOD_ACTIVATION
MOD ACTIVATION.MOD_BIAS
MOD BIAS.MOD_WEIGHT
MOD WEIGHT.SUB_BACK_CONN
SUB BACK CONNSUB_CONN
SUB CONN.SUB_GATE
SUB GATE.SUB_NODE
SUB NODE.SUB_SELF_CONN
SUB SELF CONNECTION.SWAP_NODES
SWAP NODES -
Field Summary
Fields Modifier and Type Field Description static Mutation[]
ALL
Contains all possible mutations.Activation[]
allowed
All allowed ActivationTypes.static Mutation[]
FFW
Contains all feedforward mutations.boolean
keepGates
Should gates be kept?int
max
The max bias/weight.int
min
The min bias/weight.boolean
mutateOutput
Should the output be mutated? -
Method Summary
Modifier and Type Method Description abstract void
mutate(Network network)
Mutate a network with the enum method.void
setAllowed(Activation[] allowedActivations)
Sets allowed activations.void
setKeepGates(boolean keepGates)
Sets keep gates.void
setMax(int max)
Sets max bias/weight.void
setMin(int min)
Sets min bias/weight.static Mutation
valueOf(String name)
Returns the enum constant of this type with the specified name.static Mutation[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ADD_NODE
ADD NODE.Adds a node to the network
-
SUB_NODE
SUB NODE.Removes a node from the network
-
ADD_CONN
ADD CONN.Adds a connection to the network
-
SUB_CONN
SUB CONN.Removes a connection from the network
-
MOD_WEIGHT
MOD WEIGHT.Modifies the weight of a connection
-
MOD_BIAS
MOD BIAS.Modifies the bias of a node
-
MOD_ACTIVATION
MOD ACTIVATION.Modifies the activation function of a node
-
ADD_SELF_CONN
ADD SELF CONN.Adds a connection to a node itself
-
SUB_SELF_CONN
SUB SELF CONNECTION.Removes a connection to a node itself
-
ADD_GATE
ADD GATE.Add a gate to the network
-
SUB_GATE
SUB GATE.Removes a gate from the network
-
ADD_BACK_CONN
ADD BACK CONN.Adds a backward pointing connection
-
SUB_BACK_CONN
SUB BACK CONNRemoves a backward pointing connection
-
SWAP_NODES
SWAP NODESSwaps to nodes inside a network
-
-
Field Details
-
ALL
Contains all possible mutations. -
FFW
Contains all feedforward mutations. -
mutateOutput
public final boolean mutateOutputShould the output be mutated? -
allowed
All allowed ActivationTypes. -
min
public int minThe min bias/weight. -
max
public int maxThe max bias/weight. -
keepGates
public boolean keepGatesShould gates be kept?
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
mutate
Mutate a network with the enum method.- Parameters:
network
- the network
-
setAllowed
Sets allowed activations.- Parameters:
allowedActivations
- the allowed activations
-
setMin
public void setMin(int min)Sets min bias/weight.- Parameters:
min
- the min bias/weight
-
setMax
public void setMax(int max)Sets max bias/weight.- Parameters:
max
- the max bias/weight
-
setKeepGates
public void setKeepGates(boolean keepGates)Sets keep gates.- Parameters:
keepGates
- the keep gates
-