Ignore:
Timestamp:
05/08/21 12:42:58 (4 years ago)
Author:
Maciej Komosinski
Message:

Added --debug mode that prints names of steps; final multiple evaluation now evaluates genotypes in hall of fame instead of the last population

Location:
framspy/evolalg/fitness
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • framspy/evolalg/fitness/fitness_step.py

    r1113 r1139  
    88class FitnessStep(FramsStep):
    99    def __init__(self, frams_lib, fields: Dict, fields_defaults: Dict, commands: List[str] = None,
    10                  vectorized: bool = True, evaluation_count=None):
     10                 vectorized: bool = True, evaluation_count=None, *args, **kwargs):
    1111
    12         super().__init__(frams_lib, commands)
     12        super().__init__(frams_lib, commands, *args, **kwargs)
    1313        self.fields = fields
    1414        self.fields_defaults = fields_defaults
     
    2828
    2929    def call(self, population: List[Individual]):
     30        super(FitnessStep, self).call(population)
    3031        if self.vectorized:
    3132            data = self.frams.evaluate([_.genotype for _ in population])
  • framspy/evolalg/fitness/multiple_evaluations.py

    r1113 r1139  
    77class MultipleEvaluationFitness(FitnessStep):
    88    def __init__(self, frams_lib, fields: Dict, fields_defaults: Dict, commands: List[str] = None,
    9                  vectorized: bool = True, number_evaluations = 10):
    10         super().__init__(frams_lib, fields, fields_defaults, commands, vectorized)
     9                 vectorized: bool = True, number_evaluations = 10, *args, **kwargs):
     10        super().__init__(frams_lib, fields, fields_defaults, commands, vectorized, *args, **kwargs)
    1111        self.number_evaluations = number_evaluations
    1212
    1313
    1414    def call(self, population: List[Individual]):
     15        super(MultipleEvaluationFitness, self).call(population)
    1516        pop = copy.deepcopy(population)
    1617        statistics = [{} for _ in range(len(population))]
Note: See TracChangeset for help on using the changeset viewer.