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_CONNADD BACK CONN.ADD_CONNADD CONN.ADD_GATEADD GATE.ADD_NODEADD NODE.ADD_SELF_CONNADD SELF CONN.MOD_ACTIVATIONMOD ACTIVATION.MOD_BIASMOD BIAS.MOD_WEIGHTMOD WEIGHT.SUB_BACK_CONNSUB BACK CONNSUB_CONNSUB CONN.SUB_GATESUB GATE.SUB_NODESUB NODE.SUB_SELF_CONNSUB SELF CONNECTION.SWAP_NODESSWAP NODES -
Field Summary
Fields Modifier and Type Field Description static Mutation[]ALLContains all possible mutations.Activation[]allowedAll allowed ActivationTypes.static Mutation[]FFWContains all feedforward mutations.booleankeepGatesShould gates be kept?intmaxThe max bias/weight.intminThe min bias/weight.booleanmutateOutputShould the output be mutated? -
Method Summary
Modifier and Type Method Description abstract voidmutate(Network network)Mutate a network with the enum method.voidsetAllowed(Activation[] allowedActivations)Sets allowed activations.voidsetKeepGates(boolean keepGates)Sets keep gates.voidsetMax(int max)Sets max bias/weight.voidsetMin(int min)Sets min bias/weight.static MutationvalueOf(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
-