Skip to content

Minor Refactor #83

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

Merged
merged 12 commits into from
Sep 6, 2021
1 change: 1 addition & 0 deletions AUTHORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Chefs of the Code-Soup
* [Abheesht Sharma](https://www.linkedin.com/in/abheesht-sharma-567303156/)
* [Harshit Pandey](https://www.linkedin.com/in/harshit-pandey-a77302173/)
* [Gunjan Chhablani](https://gchhablani.github.io/)
* Mehul Rastogi


Contributors
Expand Down
8 changes: 4 additions & 4 deletions REPO_STRUCTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@ Main package to be used in fencing and build attacks / defenses
| +-- rl/ #Same as above
# For every chapter ->
+-- ch{Chapter_Number}/ #Code refering to a particular chapter
| +-- utils/ #Utils Required for the chapter
| +-- models/ #Attackers or Defenders used in the chapter
| +-- algorithms/ #Attackers or Defenders used in the chapter
| | +--{Name_of_Attack/Defense}.py
# There will be exactly one file pertaining to the agents.
# This is supposed to be parallel to the pseudcode in a book.
Expand All @@ -50,10 +49,11 @@ For Unit testing of each module in the package
| | +-- test_dataset/
| +-- test_text/
| +-- test_rl/
| +-- test_utils/

# For every chapter ->
+-- test_ch{Chapter_Number}/
| +-- test_utils/
| +-- test_models/
| +-- test_algorithms/
| | +--test_{Name_of_Attack/Defense}.py
```

Expand Down
4 changes: 3 additions & 1 deletion code_soup/ch5/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
from code_soup.ch5.models import GAN
from code_soup.ch5.algorithms.gan import GAN, Discriminator, Generator
from code_soup.ch5.algorithms.one_pixel_attack import OnePixelAttack
from code_soup.ch5.algorithms.zoo_attack import ZooAttack
File renamed without changes.
File renamed without changes.
1 change: 0 additions & 1 deletion code_soup/ch5/models/__init__.py

This file was deleted.

File renamed without changes.
6 changes: 6 additions & 0 deletions code_soup/common/text/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# utils import
from code_soup.common.text.utils import perturbations

# datasets

# models
1 change: 0 additions & 1 deletion code_soup/common/text/keys_in_proximity.json

This file was deleted.

334 changes: 334 additions & 0 deletions code_soup/common/text/utils/json/keys_in_proximity.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,334 @@
{
"a": [
"q",
"w",
"s",
"x",
"z"
],
"b": [
"v",
"g",
"h",
"n"
],
"c": [
"x",
"d",
"f",
"v"
],
"d": [
"s",
"e",
"r",
"f",
"c",
"x"
],
"e": [
"w",
"s",
"d",
"r"
],
"f": [
"d",
"r",
"t",
"g",
"v",
"c"
],
"g": [
"f",
"t",
"y",
"h",
"b",
"v"
],
"h": [
"g",
"y",
"u",
"j",
"n",
"b"
],
"i": [
"u",
"j",
"k",
"o"
],
"j": [
"h",
"u",
"i",
"k",
"n",
"m"
],
"k": [
"j",
"i",
"o",
"l",
"m"
],
"l": [
"k",
"o",
"p"
],
"m": [
"n",
"j",
"k",
"l"
],
"n": [
"b",
"h",
"j",
"m"
],
"o": [
"i",
"k",
"l",
"p"
],
"p": [
"o",
"l"
],
"q": [
"w",
"a",
"s"
],
"r": [
"e",
"d",
"f",
"t"
],
"s": [
"w",
"e",
"d",
"x",
"z",
"a"
],
"t": [
"r",
"f",
"g",
"y"
],
"u": [
"y",
"h",
"j",
"i"
],
"v": [
"c",
"f",
"g",
"v",
"b"
],
"w": [
"q",
"a",
"s",
"e"
],
"x": [
"z",
"s",
"d",
"c"
],
"y": [
"t",
"g",
"h",
"u"
],
"z": [
"a",
"s",
"x"
],
"A": [
"Q",
"W",
"S",
"X",
"Z"
],
"B": [
"V",
"G",
"H",
"N"
],
"C": [
"X",
"D",
"F",
"V"
],
"D": [
"S",
"E",
"R",
"F",
"C",
"X"
],
"E": [
"W",
"S",
"D",
"R"
],
"F": [
"D",
"R",
"T",
"G",
"V",
"C"
],
"G": [
"F",
"T",
"Y",
"H",
"B",
"V"
],
"H": [
"G",
"Y",
"U",
"J",
"N",
"B"
],
"I": [
"U",
"J",
"K",
"O"
],
"J": [
"H",
"U",
"I",
"K",
"N",
"M"
],
"K": [
"J",
"I",
"O",
"L",
"M"
],
"L": [
"K",
"O",
"P"
],
"M": [
"N",
"J",
"K",
"L"
],
"N": [
"B",
"H",
"J",
"M"
],
"O": [
"I",
"K",
"L",
"P"
],
"P": [
"O",
"L"
],
"Q": [
"W",
"A",
"S"
],
"R": [
"E",
"D",
"F",
"T"
],
"S": [
"W",
"E",
"D",
"X",
"Z",
"A"
],
"T": [
"R",
"F",
"G",
"Y"
],
"U": [
"Y",
"H",
"J",
"I"
],
"V": [
"C",
"F",
"G",
"V",
"B"
],
"W": [
"Q",
"A",
"S",
"E"
],
"X": [
"Z",
"S",
"D",
"C"
],
"Y": [
"T",
"G",
"H",
"U"
],
"Z": [
"A",
"S",
"X"
]
}
Loading