Skip to content

Commit 132e32c

Browse files
authored
Experiments (#3)
* 1st version of generation & refactor * working version * update .gitignore * wip experiments with svd * update 01-05 * fix lint
1 parent 72f9e12 commit 132e32c

33 files changed

+2211
-545
lines changed

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
*.npy
22
*.png
3+
*.pt
4+
*.ods
35

46
__pycache__
57

@@ -9,3 +11,6 @@ __pycache__
911
.python-version
1012

1113
/tensors/**
14+
/data/**
15+
16+
uv.lock

Makefile

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,27 @@ check_format:
66
uv run ruff check src
77

88
mypy:
9-
uv run mypy src/
9+
uv run mypy src/
10+
11+
synthetic_pipe:
12+
uv run python -m src.research.synthetic_pipe \
13+
$(if $(all_models), --all_models=$(all_models)) \
14+
$(if $(all_optimizers), --all_optimizers=$(all_optimizers)) \
15+
$(if $(datasets), --datasets=$(datasets)) \
16+
$(if $(models), --models=$(models)) \
17+
$(if $(train_loops), --train_loops=$(train_loops))
18+
19+
nn_analysis:
20+
uv run python -m src.research.nn_analysis
21+
22+
clean:
23+
rm -rf data/*
24+
rm -rf img/*
25+
rm -rf data/.gitkeep
26+
rm -rf img/.gitkeep
27+
28+
full_pipe:
29+
make clean
30+
make synthetic_pipe
31+
make nn_analysis
32+

notebooks/full_pipe.ipynb

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{
2+
"cells": [
3+
{
4+
"cell_type": "code",
5+
"execution_count": null,
6+
"id": "45a3f8e7",
7+
"metadata": {},
8+
"outputs": [],
9+
"source": [
10+
"import torch\n",
11+
"import sys\n",
12+
"\n",
13+
"sys.path.append(\"..\")\n",
14+
"\n",
15+
"from src.config import DTYPE\n",
16+
"from src.experiments.utils import *\n",
17+
"from src.experiments.run import end_to_end_experiment\n",
18+
"\n",
19+
"torch.set_default_dtype(DTYPE)\n",
20+
"\n",
21+
"if DTYPE == torch.float64:\n",
22+
" dtype = \"fp64\"\n",
23+
"elif DTYPE == torch.float32:\n",
24+
" dtype = \"fp32\"\n",
25+
"\n",
26+
"drivers = [None, \"gesvd\"]\n",
27+
"pretrain_options = [False, True]\n",
28+
"real_data_options = [False, True]\n",
29+
"maxtr_options = [False, True]\n",
30+
"\n",
31+
"for DRIVER in drivers:\n",
32+
" for PRETRAIN in pretrain_options:\n",
33+
" for REAL_DATA in real_data_options:\n",
34+
" for MAXTR in maxtr_options:\n",
35+
" end_to_end_experiment(\n",
36+
" svd_driver=DRIVER,\n",
37+
" is_pretrained=PRETRAIN,\n",
38+
" is_real_data_pretrained=REAL_DATA,\n",
39+
" max_frobenius_norm=MAXTR,\n",
40+
" )"
41+
]
42+
}
43+
],
44+
"metadata": {
45+
"kernelspec": {
46+
"display_name": ".venv",
47+
"language": "python",
48+
"name": "python3"
49+
},
50+
"language_info": {
51+
"codemirror_mode": {
52+
"name": "ipython",
53+
"version": 3
54+
},
55+
"file_extension": ".py",
56+
"mimetype": "text/x-python",
57+
"name": "python",
58+
"nbconvert_exporter": "python",
59+
"pygments_lexer": "ipython3",
60+
"version": "3.12.7"
61+
}
62+
},
63+
"nbformat": 4,
64+
"nbformat_minor": 5
65+
}

0 commit comments

Comments
 (0)