Bardo.AgentManager.TuningDuration (Bardo v0.1.0)

View Source

The TuningDuration module contains all the tuning duration functions, functions which calculate how long the tuning phase must run. The tuning duration function sets the max_attempts value, with the function format being as follows: - Input: Neuron_Ids, AgentGeneration - Output: Max_Attempts. The tuning duration function can output a constant, which is what we used thus far. It can output a value that is proportional to the number of neurons composing the NN, or it can produce a value based on the number of all neurons in the population.

NOTE: When creating tuning duration functions that take into account NN's size, we must ensure that this factor skews the fitness towards producing smaller NN systems, not larger. We do not want to reward neural bloating. For example, if we create a tuning duration function which uses the following equation: MaxAttempts = 100 * TotNeurons, we will be giving an incentive for the NNs to bloat. Since just be adding one extra neuron, the NN has 100 extra tries to improve its fitness, chances are that it will be a bit more fit than its better counterparts which did not get as many attempts.

The nsize_proportional and wsize_proportional functions have their exponential power parameters set to 0.5, and thus take the square root of the number of neurons and weights respectively. Thus, the NN systems which have a larger number of weights or neurons to optimize, will have a larger number of chances, but just barely.

Hopefully, this approach will not overwrite and undermine the fitness function, still push towards more concise topologies, while at the same time provide for a few more optimization attempts to the larger NN based agents, which need them due to having that many more synaptic weight permutations which can be explored.

Summary

Functions

Returns the preset const max_attempts value.

Calculates the max_attempts to be proportional to the number of neurons which were within the last 3 generations mutated or added to the NN.

Calculates the max_attempts value based on the individual agent's parameters, in this case the max_attempts is proportional to the agent's number of weights belonging to the neurons which were added or mutated within the last 3 generations.

Functions

const(parameter, n_ids, generation)

@spec const(integer(), [Bardo.Models.neuron_id()], integer()) :: integer()

Returns the preset const max_attempts value.

nsize_proportional(parameter, n_ids, generation)

@spec nsize_proportional(float(), [Bardo.Models.neuron_id()], integer()) :: integer()

Calculates the max_attempts to be proportional to the number of neurons which were within the last 3 generations mutated or added to the NN.

wsize_proportional(parameter, n_ids, generation)

@spec wsize_proportional(float(), [Bardo.Models.neuron_id()], integer()) :: integer()

Calculates the max_attempts value based on the individual agent's parameters, in this case the max_attempts is proportional to the agent's number of weights belonging to the neurons which were added or mutated within the last 3 generations.