if np.random.uniform() < P1:
# Move towards local elite
population[k] = self._turn(
local_elites[k],
population[k],
turn_prob,
initial_result.attacked_text,
)
if np.random.uniform() < P2:
# Move towards global elite
population[k] = self._turn(
global_elite,
population[k],
turn_prob,
initial_result.attacked_text,
)
In this code block: textattack.search_method class ParticleSwarmOptimization(PopulationBasedSearch).perform_search()
But it doesn’t match the input of another function: ParticleSwarmOptimization._turn
its input param = source_text, target_text, prob, original_text, above code the input param are in the order of local_elites[k] and population[k], is this right?
In this code block: textattack.search_method class ParticleSwarmOptimization(PopulationBasedSearch).perform_search() But it doesn’t match the input of another function: ParticleSwarmOptimization._turn its input param = source_text, target_text, prob, original_text, above code the input param are in the order of local_elites[k] and population[k], is this right?