Ignore:
Timestamp:
06/30/20 00:30:39 (4 years ago)
Author:
Maciej Komosinski
Message:

Introduced a separate function to mutate neuron connection weight

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/genetics/genooperators.h

    r967 r968  
    187187        static bool mutateRandomNeuroClassProperty(Neuro* n); ///<high-level neuron mutation function, will select and mutate a random property of Neuron's NeuroClass. Returns true if successful and some property was actually mutated. Could return false when the NeuroClass of the Neuron have no properties, or when a randomly selected property was not suitable for mutation (for example a string or another non-number type).
    188188        static int selectRandomNeuroClassProperty(Neuro* n); ///<selects random property (either 0-based extraproperty of NeuroClass or NEUROCLASS_PROP_OFFSET-based standard property of NeuroClass). -1 if Neuroclass has no properties.
    189         static double getMutatedNeuroClassProperty(double current, Neuro *n, int propindex); ///<returns value \e current mutated for the property \e propindex of Neuron's NeuroClass or for extraproperty (\e propindex - NEUROCLASS_PROP_OFFSET) of Neuron's NeuroClass. Neuro \e n is used as read-only. Use \e propindex == -1 to mutate connection weight (\e n and \e i are then ignored).
     189        static double getMutatedNeuroClassProperty(double current, Neuro *n, int propindex); ///<returns value \e current mutated for the property \e propindex of Neuron's NeuroClass or for extraproperty (\e propindex - NEUROCLASS_PROP_OFFSET) of Neuron's NeuroClass. Neuro \e n is used as read-only.
     190        static double getMutatedNeuronConnectionWeight(double current); ///<returns mutated value of \e current.
    190191        static bool mutatePropertyNaive(ParamInterface &p, int propindex); ///<creep-mutate selected property. Returns true when success. mutateProperty() should be used instead of this function.
    191192        static bool mutateProperty(ParamInterface &p, int propindex); ///<like mutatePropertyNaive(), but uses special probability distributions for some neuron properties.
     
    216217};
    217218
    218 
    219 //
    220 // custom distributions for mutations of various parameters
    221 //
    222 /*
    223 static double distrib_weight[]=
    224 {
    225 5,                 // distribution -999 _-^_^-_ +999
    226 -999, 999,         // each weight value may be useful, especially...
    227 -5, -0.3,        // ...little non-zero values
    228 -3, -0.6,
    229 0.6, 3,
    230 0.3, 5,
    231 };
    232 */
    233 
    234219#endif
Note: See TracChangeset for help on using the changeset viewer.