-
Notifications
You must be signed in to change notification settings - Fork 3
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
Q attack #21
Q attack #21
Conversation
src/attacks/QAttack/qattack.py
Outdated
labeled_nodes = {n: labels.tolist()[n-1] for n in adj_list.keys()} # FIXME check order for labels and node id consistency | ||
|
||
# Calculate modularity | ||
Q = QAttacker.modularity(adj_list, labeled_nodes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему обращение к статик методу не через self?
src/attacks/QAttack/qattack.py
Outdated
labeled_nodes = {n: labels.tolist()[n-1] for n in adj_list.keys()} # FIXME check order for labels and node id consistency | ||
|
||
# Calculate modularity | ||
Q = QAttacker.modularity(adj_list, labeled_nodes) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Почему обращение к статик методу не через self?
src/attacks/QAttack/utils.py
Outdated
for node, neighs in adj_list.items(): | ||
if node not in non_oriented_adj_list.keys(): | ||
non_oriented_adj_list[node] = copy.deepcopy(adj_list[node]) | ||
for in_node in adj_list[node]: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Тут один и тот же for выполняется 2 раза. Поставь if перед циклом, чтобы не происходило дублирования кода.
Add Q-Attack: evasion non-targeted attack, based on Genetic Algorithm.
Notes: