Skip to content

Commit 7960ad5

Browse files
authored
The issues with the notebooks have been resolved. (#9)
1 parent 7a808ae commit 7960ad5

File tree

4 files changed

+51
-32
lines changed

4 files changed

+51
-32
lines changed

Notebooks/AROS.ipynb

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
},
4747
"outputs": [],
4848
"source": [
49-
"!git clone https://github.com/MMathisLab/AROS.git"
49+
"!git clone https://github.com/AdaptiveMotorControlLab/AROS"
5050
]
5151
},
5252
{
@@ -57,9 +57,8 @@
5757
},
5858
"outputs": [],
5959
"source": [
60-
"%cd /content/AROS\n",
61-
"%ls\n",
62-
"!pip install -r requirements.txt"
60+
"!pip install -r ./AROS/requirements.txt\n",
61+
"cd ./AROS/AROS"
6362
]
6463
},
6564
{

Notebooks/Ablation_Study.ipynb

Lines changed: 44 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,52 @@
33
{
44
"cell_type": "markdown",
55
"metadata": {
6-
"id": "view-in-github",
7-
"colab_type": "text"
6+
"colab_type": "text",
7+
"id": "view-in-github"
88
},
99
"source": [
1010
"<a href=\"https://colab.research.google.com/github/AdaptiveMotorControlLab/AROS/blob/main/Notebooks/Ablation_Study.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
1111
]
1212
},
1313
{
1414
"cell_type": "markdown",
15-
"source": [
16-
"## AROS, Ablation Study"
17-
],
1815
"metadata": {
1916
"id": "G1Ues10_fww5"
20-
}
17+
},
18+
"source": [
19+
"## AROS, Ablation Study"
20+
]
21+
},
22+
{
23+
"cell_type": "code",
24+
"execution_count": null,
25+
"metadata": {},
26+
"outputs": [],
27+
"source": [
28+
"!git clone https://github.com/AdaptiveMotorControlLab/AROS"
29+
]
30+
},
31+
{
32+
"cell_type": "code",
33+
"execution_count": null,
34+
"metadata": {},
35+
"outputs": [],
36+
"source": [
37+
"!pip install -r ./AROS/requirements.txt\n",
38+
"cd ./AROS/AROS"
39+
]
40+
},
41+
{
42+
"cell_type": "code",
43+
"execution_count": null,
44+
"metadata": {},
45+
"outputs": [],
46+
"source": [
47+
"import argparse\n",
48+
"import torch\n",
49+
"import torch.nn as nn\n",
50+
"from tqdm.notebook import tqdm"
51+
]
2152
},
2253
{
2354
"cell_type": "code",
@@ -91,10 +122,6 @@
91122
}
92123
],
93124
"source": [
94-
"!pip install -r requirements.txt\n",
95-
"import argparse\n",
96-
"import torch\n",
97-
"import torch.nn as nn\n",
98125
"from evaluate import *\n",
99126
"from utils import *\n",
100127
"from tqdm.notebook import tqdm\n",
@@ -112,8 +139,7 @@
112139
"source": [
113140
"parser = argparse.ArgumentParser(description=\"Hyperparameters for the script\")\n",
114141
"\n",
115-
"# Define the hyperparameters controlled via CLI 'Ding2020MMA'\n",
116-
"\n",
142+
" \n",
117143
"parser.add_argument('--in_dataset', type=str, default='cifar100', choices=['cifar10', 'cifar100'], help='The in-distribution dataset to be used')\n",
118144
"parser.add_argument('--threat_model', type=str, default='Linf', help='Adversarial threat model for robust training')\n",
119145
"parser.add_argument('--noise_std', type=float, default=1, help='Standard deviation of noise for generating noisy fake embeddings')\n",
@@ -144,14 +170,14 @@
144170
"cell_type": "code",
145171
"execution_count": null,
146172
"metadata": {
147-
"id": "g2TltXvg7MfF",
148-
"outputId": "4df864e7-e14b-4db4-e1ae-06e33c9b11be",
149173
"colab": {
150174
"referenced_widgets": [
151175
"59296a90b8c84b1c94648a4c5d68a43b",
152176
"ad54c341af6e400280d000b3725f08ee"
153177
]
154-
}
178+
},
179+
"id": "g2TltXvg7MfF",
180+
"outputId": "4df864e7-e14b-4db4-e1ae-06e33c9b11be"
155181
},
156182
"outputs": [
157183
{
@@ -217,14 +243,14 @@
217243
"cell_type": "code",
218244
"execution_count": null,
219245
"metadata": {
220-
"id": "QeC-30C5ImKg",
221-
"outputId": "793be5f3-3307-4a3d-8e5f-177ac212d30a",
222246
"colab": {
223247
"referenced_widgets": [
224248
"c9c97585bef049ca9974797d1d5964ab",
225249
"97f0832ab970458f947318195735214b"
226250
]
227-
}
251+
},
252+
"id": "QeC-30C5ImKg",
253+
"outputId": "793be5f3-3307-4a3d-8e5f-177ac212d30a"
228254
},
229255
"outputs": [
230256
{

README.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,9 @@
33
## Overview
44

55
This repository contains the code for the paper **"Adversarially Robust Out-of-Distribution Detection Using Lyapunov-Stabilized Embeddings"**. The method, termed **AROS**, employs Neural Ordinary Differential Equations (NODEs) with Lyapunov stability to create robust embeddings for OOD detection, significantly improving performance against adversarial attacks.
6-
This repository contains the code for the paper **"Adversarially Robust Out-of-Distribution Detection Using Lyapunov-Stabilized Embeddings"**. The method, termed **AROS**, employs Neural Ordinary Differential Equations (NODEs) with Lyapunov stability to create robust embeddings for OOD detection, significantly improving performance against adversarial attacks. An example of training and evaluation of the model on the CIFAR-10 and CIFAR-100 of both benchmark is available in this
7-
[notebook](https://colab.research.google.com/drive/1-VrfWbnlW_2x_lybVfyCD70OOEelrSYB?usp=sharing), along with a notebook detailing the ablation study provided [here](https://colab.research.google.com/drive/1SdSQpXeEoZnlQww-gvec9aJxK1CiPFjl?usp=sharing
8-
).
9-
10-
11-
12-
13-
14-
![AROS](https://github.com/user-attachments/assets/dd5d5dd9-2650-4746-9983-5abf6d7eedfc)
6+
This repository contains the code for the paper **"Adversarially Robust Out-of-Distribution Detection Using Lyapunov-Stabilized Embeddings"**. The method, termed **AROS**, employs Neural Ordinary Differential Equations (NODEs) with Lyapunov stability to create robust embeddings for OOD detection, significantly improving performance against adversarial attacks. Additionally, the repository includes two notebooks: one demonstrates the training and evaluation process on the CIFAR-10 and CIFAR-100 datasets, while the other focuses on the ablation study.
157

8+
169
## Key Features
1710

1811
- **Lyapunov Stability for OOD Detection**: Ensures that perturbed inputs converge back to stable equilibrium points, improving robustness against adversarial attacks.

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
geotorch
22
torchdiffeq
3-
git+https://github.com/RobustBench/robustbench.git
3+
git+https://github.com/RobustBench/robustbench.git
4+
timm==1.0.9

0 commit comments

Comments
 (0)