Last updated: 2023-03-16.
tf_quant_finance.math.optimizer.differential_evolution_one_step#
Performs one step of the differential evolution algorithm.
tf_quant_finance.math.optimizer.differential_evolution_one_step(
objective_function, population, population_values=None, differential_weight=0.5,
crossover_prob=0.9, seed=None, name=None
)
Args:#
objective_function: A Python callable that accepts a batch of possible solutions and returns the values of the objective function at those arguments as a rank 1 realTensor. This specifies the function to be minimized. The input to this callable may be either a singleTensoror a PythonlistofTensors. The signature must match the format of the argumentpopulation. (i.e., objective_function(*population) must return the value of the function to be minimized).population:Tensoror PythonlistofTensors representing the current population vectors. EachTensormust be of the same real dtype. The first dimension indexes individual population members while the rest of the dimensions are consumed by the value function. For example, if the population is a singleTensorof shape [n, m1, m2], thennis the population size and the output ofobjective_functionapplied to the population is aTensorof shape [n]. If the population is a python list ofTensors then eachTensorin the list should have the first axis of a common size, saynandobjective_function(*population)should return aTensorof shape [n]. The population must have at least 4 members for the algorithm to work correctly.population_values: ATensorof rank 1 and real dtype. The result of applyingobjective_functionto thepopulation. If not supplied it is computed using theobjective_function. Default value: None.differential_weight: Real scalarTensor. Must be positive and less than 2.0. The parameter controlling the strength of mutation. Default value: 0.5crossover_prob: Real scalarTensor. Must be between 0 and 1. The probability of recombination per site. Default value: 0.9seed:intor None. The random seed for thisOp. IfNone, no seed is applied. Default value: None.name: (Optional) Python str. The name prefixed to the ops created by this function. If not supplied, the default name ‘one_step’ is used. Default value: None
Returns:#
A sequence containing the following elements (in order):
next_population: ATensoror PythonlistofTensors of the same structure as the input population. The population at the next generation.next_population_values: ATensorof same shape and dtype as inputpopulation_values. The function values for thenext_population.