Skip to content

Commit 2073070

Browse files
committed
Add paper files. Add notebooks.
1 parent d3713d9 commit 2073070

File tree

105 files changed

+49120
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+49120
-0
lines changed

drawio/adapters.drawio

+1,099
Large diffs are not rendered by default.

figs/conv-lora-arch.png

212 KB
Loading

figs/lora-arch.png

30.8 KB
Loading

figs/pnn-arch.png

39.4 KB
Loading

figs/sample-non-dynamic-a.png

331 KB
Loading

figs/sample-non-dynamic-b.png

327 KB
Loading

figs/sena-cnn-arch.png

45.5 KB
Loading

figs/solutions.png

286 KB
Loading

figs/solutions_intersection.png

274 KB
Loading

figs/survey_figs/castro.png

43.5 KB
Loading

figs/survey_figs/distance-based_b.png

9.77 KB
Loading

figs/survey_figs/distance_based.png

42.3 KB
Loading

figs/survey_figs/dynamic-networks.png

134 KB
Loading

figs/survey_figs/entm.png

101 KB
Loading

figs/survey_figs/hard-sub_network.png

73.4 KB
Loading

figs/survey_figs/hu_etal2.png

92.4 KB
Loading

figs/survey_figs/hu_etal_1.png

94.5 KB
Loading

figs/survey_figs/hybrids.png

120 KB
Loading

figs/survey_figs/loss_landscapeI.png

99.3 KB
Loading

figs/survey_figs/loss_landscapeII.png

95.8 KB
Loading
125 KB
Loading

figs/survey_figs/mini-rehearsal.png

107 KB
Loading

figs/survey_figs/neuromodulation.png

66.7 KB
Loading

figs/survey_figs/pseudo-rehearsal.png

77.3 KB
Loading

figs/survey_figs/soft-sub_network.png

81.8 KB
Loading

figs/survey_figs/subnetworks_b.png

41.6 KB
Loading

figs/survey_figs/taxonomy.png

90.4 KB
Loading

notebooks/Train-LoraVGG19-CUBs200.ipynb

+4,438
Large diffs are not rendered by default.

notebooks/Train-VGG19-CUBs200.ipynb

+18,878
Large diffs are not rendered by default.

notebooks/experiments_cifar-100.ipynb

+17,028
Large diffs are not rendered by default.
140 KB
Loading
143 KB
Loading

notebooks/growth-comparsion-vgg19.png

144 KB
Loading

notebooks/lora-vgg19-analysis.ipynb

+150
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": 2,
6+
"id": "ef3ea784-8148-4b92-98ae-bd4a41422cba",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"import sys\n",
11+
"import os\n",
12+
"\n",
13+
"# Adiciona o diretório pai ao caminho de pesquisa de módulos\n",
14+
"sys.path.append(os.path.abspath(os.path.join('..')))"
15+
]
16+
},
17+
{
18+
"cell_type": "code",
19+
"execution_count": 3,
20+
"id": "59152fa1-060b-407c-b960-681046bd7a60",
21+
"metadata": {},
22+
"outputs": [],
23+
"source": [
24+
"from torchvision.models import vgg19\n",
25+
"from continuous_lora.models.lora_vgg19 import LoraVGG19"
26+
]
27+
},
28+
{
29+
"cell_type": "code",
30+
"execution_count": 15,
31+
"id": "277ba4d8-bd72-4abc-9e50-e81fb7693aa7",
32+
"metadata": {},
33+
"outputs": [],
34+
"source": [
35+
"base_model = vgg19()\n",
36+
"model = LoraVGG19(\n",
37+
" model=base_model,\n",
38+
" masks=[[0,1,2,3,4], [5,6,7,8,9]],\n",
39+
" adapt_last_n_conv=2,\n",
40+
" adapt_last_n_linear=1,\n",
41+
")"
42+
]
43+
},
44+
{
45+
"cell_type": "code",
46+
"execution_count": 16,
47+
"id": "6799c67f-fe0d-471d-91e6-17571aba243c",
48+
"metadata": {},
49+
"outputs": [
50+
{
51+
"data": {
52+
"text/plain": [
53+
"LoraVGG19(\n",
54+
" (features): Sequential(\n",
55+
" (0): Conv2d(3, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
56+
" (1): ReLU(inplace=True)\n",
57+
" (2): Conv2d(64, 64, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
58+
" (3): ReLU(inplace=True)\n",
59+
" (4): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)\n",
60+
" (5): Conv2d(64, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
61+
" (6): ReLU(inplace=True)\n",
62+
" (7): Conv2d(128, 128, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
63+
" (8): ReLU(inplace=True)\n",
64+
" (9): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)\n",
65+
" (10): Conv2d(128, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
66+
" (11): ReLU(inplace=True)\n",
67+
" (12): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
68+
" (13): ReLU(inplace=True)\n",
69+
" (14): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
70+
" (15): ReLU(inplace=True)\n",
71+
" (16): Conv2d(256, 256, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
72+
" (17): ReLU(inplace=True)\n",
73+
" (18): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)\n",
74+
" (19): Conv2d(256, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
75+
" (20): ReLU(inplace=True)\n",
76+
" (21): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
77+
" (22): ReLU(inplace=True)\n",
78+
" (23): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
79+
" (24): ReLU(inplace=True)\n",
80+
" (25): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
81+
" (26): ReLU(inplace=True)\n",
82+
" (27): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)\n",
83+
" (28): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
84+
" (29): ReLU(inplace=True)\n",
85+
" (30): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
86+
" (31): ReLU(inplace=True)\n",
87+
" (32): ContinuousConvLoRALayer(\n",
88+
" (conv): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
89+
" )\n",
90+
" (33): ReLU(inplace=True)\n",
91+
" (34): ContinuousConvLoRALayer(\n",
92+
" (conv): Conv2d(512, 512, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1))\n",
93+
" )\n",
94+
" (35): ReLU(inplace=True)\n",
95+
" (36): MaxPool2d(kernel_size=2, stride=2, padding=0, dilation=1, ceil_mode=False)\n",
96+
" )\n",
97+
" (avgpool): AdaptiveAvgPool2d(output_size=(7, 7))\n",
98+
" (classifier): Sequential(\n",
99+
" (0): Linear(in_features=25088, out_features=4096, bias=True)\n",
100+
" (1): ReLU(inplace=True)\n",
101+
" (2): Dropout(p=0.5, inplace=False)\n",
102+
" (3): Linear(in_features=4096, out_features=4096, bias=True)\n",
103+
" (4): ReLU(inplace=True)\n",
104+
" (5): Dropout(p=0.5, inplace=False)\n",
105+
" (6): ContinuousLinearLoRALayer(in_features=4096, out_features=1000, bias=True)\n",
106+
" )\n",
107+
" (softmax): Softmax(dim=-1)\n",
108+
")"
109+
]
110+
},
111+
"execution_count": 16,
112+
"metadata": {},
113+
"output_type": "execute_result"
114+
}
115+
],
116+
"source": [
117+
"model"
118+
]
119+
},
120+
{
121+
"cell_type": "code",
122+
"execution_count": null,
123+
"id": "b59e6b06-a339-43a8-a2b5-900c17c884a3",
124+
"metadata": {},
125+
"outputs": [],
126+
"source": []
127+
}
128+
],
129+
"metadata": {
130+
"kernelspec": {
131+
"display_name": "Python 3 (ipykernel)",
132+
"language": "python",
133+
"name": "python3"
134+
},
135+
"language_info": {
136+
"codemirror_mode": {
137+
"name": "ipython",
138+
"version": 3
139+
},
140+
"file_extension": ".py",
141+
"mimetype": "text/x-python",
142+
"name": "python",
143+
"nbconvert_exporter": "python",
144+
"pygments_lexer": "ipython3",
145+
"version": "3.12.1"
146+
}
147+
},
148+
"nbformat": 4,
149+
"nbformat_minor": 5
150+
}

0 commit comments

Comments
 (0)