Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

argument error? in PSO attack->perform_search->_turn #753

Open
nohuma opened this issue Oct 11, 2023 · 0 comments
Open

argument error? in PSO attack->perform_search->_turn #753

nohuma opened this issue Oct 11, 2023 · 0 comments

Comments

@nohuma
Copy link

nohuma commented Oct 11, 2023

            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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant