- Timestamp:
- 08/05/23 00:58:45 (16 months ago)
- Location:
- framspy/evolalg
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
framspy/evolalg/base/experiment_niching_abc.py
r1271 r1272 141 141 newpop.append(Individual().copyFrom(ind)) 142 142 143 pop_offspring = population +newpop143 pop_offspring = population + newpop # this is OK for NSGA2, but TODO verify if this should also be used for NSLC? 144 144 print(len(pop_offspring)) 145 if self.fit == "nslc": 145 if self.fit == "nslc": # TODO should NSLC be also equipped with a novelty archive? (with an admittance threshold?) 146 146 self.do_nslc_dissim(pop_offspring) 147 147 elif self.fit == "nsga2": … … 156 156 # saved generation has been completed, start with the next one 157 157 self.current_generation += 1 158 print("...Resuming from saved state: population size = %d, hof size = %d, stats size = %d, archive size = %d, generation = %d/%d" % (len(self.population_structures.population), len(self.hof), 159 len(self.stats), (len(self.population_structures.archive)), self.current_generation, generations)) # self.current_generation (and g) are 0-based, parsed_args.generations is 1-based 158 print("...Resuming from saved state: population size = %d, hof size = %d, stats size = %d, archive size = %d, generation = %d/%d" % (len(self.population_structures.population), len(self.hof), len(self.stats), (len(self.population_structures.archive)), self.current_generation, generations)) # self.current_generation (and g) are 0-based, parsed_args.generations is 1-based 160 159 else: 161 160 self.initialize_evolution(self.genformat, initialgenotype) … … 190 189 parser.add_argument("-fit",type= str, default="raw", 191 190 help="Fitness type, availible types: niching, novelty, knn_niching (local), knn_novelty (local), nsga2, nslc and raw (default)") 192 parser.add_argument("-archive",type= int, default=50, 193 help="Maximum archive size") 191 parser.add_argument("-archive",type= int, default=50, help="Maximum archive size") 194 192 parser.add_argument("-normalize",type= str, default= "max", 195 193 help="What normalization to use for the dissimilarity matrix: max (default}, sum, or none") -
framspy/evolalg/structures/individual.py
r1190 r1272 3 3 4 4 class Individual: 5 only_positive_fitness = True 5 only_positive_fitness = True # Note: when using diversification techniques (e.g. niching), setting this to False and allowing negative fitness values requires verifying/improving diversification formulas. Dividing fitness by similarity (or multiplying by diversity) may have undesired consequences when fitness can be both positive and negative (e.g. low similarity may make positive fitness values higher and negative fitness values lower, while the intention would be to improve fitness for low similarity). 6 6 7 7 def __init__(self):
Note: See TracChangeset
for help on using the changeset viewer.