geneticengine.algorithms.gp.operators.weight_learning ===================================================== .. py:module:: geneticengine.algorithms.gp.operators.weight_learning Classes ------- .. autoapisummary:: geneticengine.algorithms.gp.operators.weight_learning.WeightLearningStep geneticengine.algorithms.gp.operators.weight_learning.ConditionalWeightLearningStep Module Contents --------------- .. py:class:: WeightLearningStep(learning_rate = 0.01) Bases: :py:obj:`geneticengine.algorithms.gp.structure.GeneticStep` Applies weight learning to the grammar with a given learning rate. .. py:attribute:: learning_rate :value: 0.01 .. py:method:: wrap(representation, genotype) .. py:method:: count_productions(individual, g) .. py:method:: compute_production_probabilities(individuals, g) Calculates production probabilities by aggregating counts from a list of individuals. .. py:method:: iterate(problem, evaluator, representation, random, population, target_size, generation) .. py:class:: ConditionalWeightLearningStep(fitness_threshold = 0.5, weight_learning_rate = 0.01) Bases: :py:obj:`geneticengine.algorithms.gp.structure.GeneticStep` A genetic step that applies weight learning using only individuals from the Pareto front that are above a specified fitness threshold. :param fitness_threshold: The minimum average fitness an individual must have to be included in the weight learning process. :type fitness_threshold: float :param weight_learning_rate: The learning rate for the grammar update. :type weight_learning_rate: float .. py:attribute:: fitness_threshold :value: 0.5 .. py:attribute:: internal_weight_learning_step .. py:method:: iterate(problem, evaluator, representation, random, population, target_size, generation) The main iteration logic for the conditional step.