stk.FitnessNormalizer

class stk.FitnessNormalizer[source]

Bases: Generic[T]

Abstract base class for fitness normalizers.

A fitness normalizer takes a dictionary mapping MoleculeRecord instances to their fitness values and returns a new dictionary mapping them to their normalized fitness values. The primary benefit of a normalizer vs a FitnessCalculator is that a FitnessNormalizer has access to all members in the population when it is calculating the normalized fitness value, whereas a FitnessCalculator does not.

Methods

normalize

Normalize some fitness values.

normalize(fitness_values)[source]

Normalize some fitness values.

Parameters:

fitness_values (dict[T, Any]) – The molecules which need to have their fitness values normalized.

Returns:

The new fitness value for each molecule.

Return type:

dict[T, Any]