1
0
mirror of https://github.com/QData/TextAttack.git synced 2021-10-13 00:05:06 +03:00

fix search behavior and update test

This commit is contained in:
Jin Yong Yoo
2020-11-21 23:28:57 -05:00
parent fe5aa5cf41
commit 545687dfa5
2 changed files with 17 additions and 16 deletions

View File

@@ -101,9 +101,6 @@ class GeneticAlgorithm(PopulationBasedSearch, ABC):
new_results, self._search_over = self.get_goal_results(transformed_texts)
if self._search_over:
break
diff_scores = (
torch.Tensor([r.score for r in new_results]) - pop_member.result.score
)
@@ -119,6 +116,10 @@ class GeneticAlgorithm(PopulationBasedSearch, ABC):
word_select_prob_weights[idx] = 0
iterations += 1
if self._search_over:
break
return pop_member
@abstractmethod