keres-dl 1.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- keres_dl-1.0.0/PKG-INFO +148 -0
- keres_dl-1.0.0/README.md +133 -0
- keres_dl-1.0.0/pyproject.toml +33 -0
- keres_dl-1.0.0/setup.cfg +4 -0
- keres_dl-1.0.0/setup.py +29 -0
- keres_dl-1.0.0/src/keres/__init__.py +221 -0
- keres_dl-1.0.0/src/keres/cli.py +64 -0
- keres_dl-1.0.0/src/keres/data/__init__.py +1 -0
- keres_dl-1.0.0/src/keres/data/architecture_00.txt +220 -0
- keres_dl-1.0.0/src/keres/data/architecture_01.txt +204 -0
- keres_dl-1.0.0/src/keres/data/architecture_02.txt +293 -0
- keres_dl-1.0.0/src/keres/data/architecture_03.txt +196 -0
- keres_dl-1.0.0/src/keres/data/architecture_04.txt +205 -0
- keres_dl-1.0.0/src/keres/data/architecture_05.txt +229 -0
- keres_dl-1.0.0/src/keres/data/architecture_06.txt +181 -0
- keres_dl-1.0.0/src/keres/data/architecture_07.txt +133 -0
- keres_dl-1.0.0/src/keres/data/architecture_08.txt +156 -0
- keres_dl-1.0.0/src/keres/data/architecture_09.txt +195 -0
- keres_dl-1.0.0/src/keres/data/architectures_data.json +447 -0
- keres_dl-1.0.0/src/keres/data/imdb.csv +10001 -0
- keres_dl-1.0.0/src/keres/data/mnist.csv +4 -0
- keres_dl-1.0.0/src/keres/data/practicals_data.json +447 -0
- keres_dl-1.0.0/src/keres/data/pytoch_practicals.json +242 -0
- keres_dl-1.0.0/src/keres/datasets.py +160 -0
- keres_dl-1.0.0/src/keres/guide.py +357 -0
- keres_dl-1.0.0/src/keres/pytoch_suite.py +147 -0
- keres_dl-1.0.0/src/keres/recipes.py +699 -0
- keres_dl-1.0.0/src/keres/theory.py +549 -0
- keres_dl-1.0.0/src/keres_dl.egg-info/PKG-INFO +148 -0
- keres_dl-1.0.0/src/keres_dl.egg-info/SOURCES.txt +33 -0
- keres_dl-1.0.0/src/keres_dl.egg-info/dependency_links.txt +1 -0
- keres_dl-1.0.0/src/keres_dl.egg-info/entry_points.txt +2 -0
- keres_dl-1.0.0/src/keres_dl.egg-info/requires.txt +1 -0
- keres_dl-1.0.0/src/keres_dl.egg-info/top_level.txt +2 -0
- keres_dl-1.0.0/src/pykeres/__init__.py +94 -0
keres_dl-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: keres-dl
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: keres-dl: Unified Deep Learning Architecture Reference, Code Recipes & Practicals Cookbook
|
|
5
|
+
Author: Keres Contributors
|
|
6
|
+
License: MIT
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
|
|
11
|
+
Requires-Python: >=3.6
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
Requires-Dist: pandas
|
|
14
|
+
Dynamic: requires-python
|
|
15
|
+
|
|
16
|
+
# keres-dl (keres)
|
|
17
|
+
|
|
18
|
+
A unified, self-contained Python reference library and cookbook containing structured implementations of fundamental Deep Learning model architectures, offline practicals, pinpoint swap recipes, and bundled datasets across PyTorch and TensorFlow/Keras.
|
|
19
|
+
|
|
20
|
+
---
|
|
21
|
+
|
|
22
|
+
## Installation
|
|
23
|
+
|
|
24
|
+
Install from PyPI:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
pip install keres-dl
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Or install in development/editable mode:
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
cd keres
|
|
34
|
+
pip install -e .
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
---
|
|
38
|
+
|
|
39
|
+
## Quickstart & Usage
|
|
40
|
+
|
|
41
|
+
Both `import keres` and `from pykeres import keres` are supported:
|
|
42
|
+
|
|
43
|
+
### 1. Built-in Interactive Guide
|
|
44
|
+
```python
|
|
45
|
+
import keres
|
|
46
|
+
|
|
47
|
+
# Open built-in interactive guide & cheat sheet
|
|
48
|
+
keres.guide() # or keres.help()
|
|
49
|
+
|
|
50
|
+
# View customization recipes (Pandas CSV adapters, optimizers, loss functions):
|
|
51
|
+
keres.recipes(2) # Swapping FashionMNIST with Pandas local CSV, Adam to SGD, Dropout
|
|
52
|
+
keres.recipes(7) # MobileNetV2 -> ResNet/EfficientNet, fine-tuning rules
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
### 2. Exploring Architectures & Code
|
|
56
|
+
```python
|
|
57
|
+
import keres
|
|
58
|
+
|
|
59
|
+
# List all available architectures in the catalog
|
|
60
|
+
keres.list_architectures()
|
|
61
|
+
|
|
62
|
+
# Print architecture implementations cell-by-cell
|
|
63
|
+
keres.architecture(1) # Single-Layer Perceptron (Decision Boundaries)
|
|
64
|
+
keres.architecture(2, recipes=True) # Full MLP code + customization recipes
|
|
65
|
+
|
|
66
|
+
# Inspect a single code cell (1-based index)
|
|
67
|
+
keres.architecture(1, cell=1)
|
|
68
|
+
|
|
69
|
+
# Named model shortcuts:
|
|
70
|
+
keres.perceptron()
|
|
71
|
+
keres.mlp()
|
|
72
|
+
keres.regularization()
|
|
73
|
+
keres.activations()
|
|
74
|
+
keres.cnn()
|
|
75
|
+
keres.lstm()
|
|
76
|
+
keres.transfer_learning()
|
|
77
|
+
keres.hparam_tuning()
|
|
78
|
+
keres.multi_loss()
|
|
79
|
+
keres.cats_dogs()
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
### 3. Programmatic Access
|
|
83
|
+
```python
|
|
84
|
+
from keres import Keres
|
|
85
|
+
|
|
86
|
+
guide = Keres()
|
|
87
|
+
|
|
88
|
+
# Programmatic code string retrieval
|
|
89
|
+
code_str = guide.get_architecture(num=3)
|
|
90
|
+
cells = guide.get_cells(num=3)
|
|
91
|
+
for c in cells:
|
|
92
|
+
print(f"Cell {c['cell_number']}: {c['title']}")
|
|
93
|
+
|
|
94
|
+
# Exporting utilities
|
|
95
|
+
guide.export_all_texts("./my_reference_notes")
|
|
96
|
+
guide.export_script(num=1, output_path="run_perceptron.py")
|
|
97
|
+
guide.export_notebook(num=1, output_path="perceptron.ipynb")
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
---
|
|
101
|
+
|
|
102
|
+
## Command-Line Interface (CLI)
|
|
103
|
+
|
|
104
|
+
`keres` provides an intuitive CLI:
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
# Display built-in guide & cheat sheet
|
|
108
|
+
keres guide # or simply run: keres
|
|
109
|
+
|
|
110
|
+
# List all architectures
|
|
111
|
+
keres list
|
|
112
|
+
|
|
113
|
+
# Display an architecture cell-by-cell
|
|
114
|
+
keres show 1
|
|
115
|
+
keres show 2 --recipes
|
|
116
|
+
|
|
117
|
+
# Display a specific cell only
|
|
118
|
+
keres show 1 --cell 2
|
|
119
|
+
|
|
120
|
+
# View only the customization recipe (Pandas CSV, Optimizers, Architecture notes)
|
|
121
|
+
keres recipes 2
|
|
122
|
+
|
|
123
|
+
# Export all architecture guides as text files
|
|
124
|
+
keres export --out-dir ./dl_guides
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
---
|
|
128
|
+
|
|
129
|
+
## Architecture Catalog
|
|
130
|
+
|
|
131
|
+
| Index | Architecture / Topic | Framework | Cells |
|
|
132
|
+
| :---: | :--- | :--- | :---: |
|
|
133
|
+
| **0** | Multi-Loss Deep Neural Network Training | PyTorch | 5 |
|
|
134
|
+
| **1** | Single-Layer Perceptron (Decision Boundaries) | NumPy / Matplotlib | 2 |
|
|
135
|
+
| **2** | Multi-Layer Perceptron (MLP) Depth vs Width | PyTorch / Torchvision | 8 |
|
|
136
|
+
| **3** | Regularization Methods (L2 Weight Decay vs Dropout) | TensorFlow / Keras | 6 |
|
|
137
|
+
| **4** | Empirical Analysis of Non-Linear Activation Functions | PyTorch | 5 |
|
|
138
|
+
| **5** | Convolutional Neural Networks (CNN) vs MLP for Vision | PyTorch / Torchvision | 10 |
|
|
139
|
+
| **6** | Recurrent Neural Networks (LSTM) for Sequence Modeling | TensorFlow / Keras | 6 |
|
|
140
|
+
| **7** | Transfer Learning & Feature Fine-Tuning with MobileNetV2 | TensorFlow / Keras | 6 |
|
|
141
|
+
| **8** | Hyperparameter Optimization & TensorBoard Metric Tracking | PyTorch / TensorBoard | 5 |
|
|
142
|
+
| **9** | Transfer Learning for Cats vs Dogs with Pretrained ResNet50 | TensorFlow / Keras | 8 |
|
|
143
|
+
|
|
144
|
+
---
|
|
145
|
+
|
|
146
|
+
## License
|
|
147
|
+
|
|
148
|
+
MIT License.
|
keres_dl-1.0.0/README.md
ADDED
|
@@ -0,0 +1,133 @@
|
|
|
1
|
+
# keres-dl (keres)
|
|
2
|
+
|
|
3
|
+
A unified, self-contained Python reference library and cookbook containing structured implementations of fundamental Deep Learning model architectures, offline practicals, pinpoint swap recipes, and bundled datasets across PyTorch and TensorFlow/Keras.
|
|
4
|
+
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Install from PyPI:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
pip install keres-dl
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Or install in development/editable mode:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
cd keres
|
|
19
|
+
pip install -e .
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
## Quickstart & Usage
|
|
25
|
+
|
|
26
|
+
Both `import keres` and `from pykeres import keres` are supported:
|
|
27
|
+
|
|
28
|
+
### 1. Built-in Interactive Guide
|
|
29
|
+
```python
|
|
30
|
+
import keres
|
|
31
|
+
|
|
32
|
+
# Open built-in interactive guide & cheat sheet
|
|
33
|
+
keres.guide() # or keres.help()
|
|
34
|
+
|
|
35
|
+
# View customization recipes (Pandas CSV adapters, optimizers, loss functions):
|
|
36
|
+
keres.recipes(2) # Swapping FashionMNIST with Pandas local CSV, Adam to SGD, Dropout
|
|
37
|
+
keres.recipes(7) # MobileNetV2 -> ResNet/EfficientNet, fine-tuning rules
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 2. Exploring Architectures & Code
|
|
41
|
+
```python
|
|
42
|
+
import keres
|
|
43
|
+
|
|
44
|
+
# List all available architectures in the catalog
|
|
45
|
+
keres.list_architectures()
|
|
46
|
+
|
|
47
|
+
# Print architecture implementations cell-by-cell
|
|
48
|
+
keres.architecture(1) # Single-Layer Perceptron (Decision Boundaries)
|
|
49
|
+
keres.architecture(2, recipes=True) # Full MLP code + customization recipes
|
|
50
|
+
|
|
51
|
+
# Inspect a single code cell (1-based index)
|
|
52
|
+
keres.architecture(1, cell=1)
|
|
53
|
+
|
|
54
|
+
# Named model shortcuts:
|
|
55
|
+
keres.perceptron()
|
|
56
|
+
keres.mlp()
|
|
57
|
+
keres.regularization()
|
|
58
|
+
keres.activations()
|
|
59
|
+
keres.cnn()
|
|
60
|
+
keres.lstm()
|
|
61
|
+
keres.transfer_learning()
|
|
62
|
+
keres.hparam_tuning()
|
|
63
|
+
keres.multi_loss()
|
|
64
|
+
keres.cats_dogs()
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
### 3. Programmatic Access
|
|
68
|
+
```python
|
|
69
|
+
from keres import Keres
|
|
70
|
+
|
|
71
|
+
guide = Keres()
|
|
72
|
+
|
|
73
|
+
# Programmatic code string retrieval
|
|
74
|
+
code_str = guide.get_architecture(num=3)
|
|
75
|
+
cells = guide.get_cells(num=3)
|
|
76
|
+
for c in cells:
|
|
77
|
+
print(f"Cell {c['cell_number']}: {c['title']}")
|
|
78
|
+
|
|
79
|
+
# Exporting utilities
|
|
80
|
+
guide.export_all_texts("./my_reference_notes")
|
|
81
|
+
guide.export_script(num=1, output_path="run_perceptron.py")
|
|
82
|
+
guide.export_notebook(num=1, output_path="perceptron.ipynb")
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
---
|
|
86
|
+
|
|
87
|
+
## Command-Line Interface (CLI)
|
|
88
|
+
|
|
89
|
+
`keres` provides an intuitive CLI:
|
|
90
|
+
|
|
91
|
+
```bash
|
|
92
|
+
# Display built-in guide & cheat sheet
|
|
93
|
+
keres guide # or simply run: keres
|
|
94
|
+
|
|
95
|
+
# List all architectures
|
|
96
|
+
keres list
|
|
97
|
+
|
|
98
|
+
# Display an architecture cell-by-cell
|
|
99
|
+
keres show 1
|
|
100
|
+
keres show 2 --recipes
|
|
101
|
+
|
|
102
|
+
# Display a specific cell only
|
|
103
|
+
keres show 1 --cell 2
|
|
104
|
+
|
|
105
|
+
# View only the customization recipe (Pandas CSV, Optimizers, Architecture notes)
|
|
106
|
+
keres recipes 2
|
|
107
|
+
|
|
108
|
+
# Export all architecture guides as text files
|
|
109
|
+
keres export --out-dir ./dl_guides
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
---
|
|
113
|
+
|
|
114
|
+
## Architecture Catalog
|
|
115
|
+
|
|
116
|
+
| Index | Architecture / Topic | Framework | Cells |
|
|
117
|
+
| :---: | :--- | :--- | :---: |
|
|
118
|
+
| **0** | Multi-Loss Deep Neural Network Training | PyTorch | 5 |
|
|
119
|
+
| **1** | Single-Layer Perceptron (Decision Boundaries) | NumPy / Matplotlib | 2 |
|
|
120
|
+
| **2** | Multi-Layer Perceptron (MLP) Depth vs Width | PyTorch / Torchvision | 8 |
|
|
121
|
+
| **3** | Regularization Methods (L2 Weight Decay vs Dropout) | TensorFlow / Keras | 6 |
|
|
122
|
+
| **4** | Empirical Analysis of Non-Linear Activation Functions | PyTorch | 5 |
|
|
123
|
+
| **5** | Convolutional Neural Networks (CNN) vs MLP for Vision | PyTorch / Torchvision | 10 |
|
|
124
|
+
| **6** | Recurrent Neural Networks (LSTM) for Sequence Modeling | TensorFlow / Keras | 6 |
|
|
125
|
+
| **7** | Transfer Learning & Feature Fine-Tuning with MobileNetV2 | TensorFlow / Keras | 6 |
|
|
126
|
+
| **8** | Hyperparameter Optimization & TensorBoard Metric Tracking | PyTorch / TensorBoard | 5 |
|
|
127
|
+
| **9** | Transfer Learning for Cats vs Dogs with Pretrained ResNet50 | TensorFlow / Keras | 8 |
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## License
|
|
132
|
+
|
|
133
|
+
MIT License.
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=61.0", "wheel"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "keres-dl"
|
|
7
|
+
version = "1.0.0"
|
|
8
|
+
authors = [
|
|
9
|
+
{ name="Keres Contributors" },
|
|
10
|
+
]
|
|
11
|
+
description = "keres-dl: Unified Deep Learning Architecture Reference, Code Recipes & Practicals Cookbook"
|
|
12
|
+
readme = "README.md"
|
|
13
|
+
requires-python = ">=3.6"
|
|
14
|
+
license = { text = "MIT" }
|
|
15
|
+
dependencies = [
|
|
16
|
+
"pandas"
|
|
17
|
+
]
|
|
18
|
+
classifiers = [
|
|
19
|
+
"Programming Language :: Python :: 3",
|
|
20
|
+
"License :: OSI Approved :: MIT License",
|
|
21
|
+
"Operating System :: OS Independent",
|
|
22
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
23
|
+
]
|
|
24
|
+
|
|
25
|
+
[project.scripts]
|
|
26
|
+
keres = "keres.cli:main"
|
|
27
|
+
|
|
28
|
+
[tool.setuptools.packages.find]
|
|
29
|
+
where = ["src"]
|
|
30
|
+
include = ["keres*", "pykeres*"]
|
|
31
|
+
|
|
32
|
+
[tool.setuptools.package-data]
|
|
33
|
+
keres = ["data/*", "data/*/*"]
|
keres_dl-1.0.0/setup.cfg
ADDED
keres_dl-1.0.0/setup.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
|
|
3
|
+
setup(
|
|
4
|
+
name="keres-dl",
|
|
5
|
+
version="1.0.0",
|
|
6
|
+
description="keres-dl: Unified Deep Learning Architecture Reference, Code Recipes & Practicals Cookbook",
|
|
7
|
+
long_description=open("README.md", encoding="utf-8").read(),
|
|
8
|
+
long_description_content_type="text/markdown",
|
|
9
|
+
author="Keres Contributors",
|
|
10
|
+
package_dir={"": "src"},
|
|
11
|
+
packages=find_packages(where="src"),
|
|
12
|
+
package_data={"keres": ["data/*", "data/*/*"]},
|
|
13
|
+
include_package_data=True,
|
|
14
|
+
python_requires=">=3.6",
|
|
15
|
+
install_requires=[
|
|
16
|
+
"pandas",
|
|
17
|
+
],
|
|
18
|
+
entry_points={
|
|
19
|
+
"console_scripts": [
|
|
20
|
+
"keres=keres.cli:main",
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
classifiers=[
|
|
24
|
+
"Programming Language :: Python :: 3",
|
|
25
|
+
"License :: OSI Approved :: MIT License",
|
|
26
|
+
"Operating System :: OS Independent",
|
|
27
|
+
"Topic :: Scientific/Engineering :: Artificial Intelligence",
|
|
28
|
+
],
|
|
29
|
+
)
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
"""
|
|
2
|
+
keres: Deep Learning Architecture Reference & Code Recipe Library.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
from .guide import Keres, DLArchitectures, DLPracticals
|
|
6
|
+
from .pytoch_suite import PytochSuite, pytoch_suite, pytoch, local_suite
|
|
7
|
+
|
|
8
|
+
# Default instance for convenient top-level access
|
|
9
|
+
_default_instance = Keres()
|
|
10
|
+
|
|
11
|
+
# Catalog & Guide
|
|
12
|
+
def guide():
|
|
13
|
+
"""Display the built-in quickstart guide and cheat sheet."""
|
|
14
|
+
_default_instance.guide()
|
|
15
|
+
|
|
16
|
+
help = guide
|
|
17
|
+
quickstart = guide
|
|
18
|
+
|
|
19
|
+
def list_architectures():
|
|
20
|
+
"""List all available deep learning architectures."""
|
|
21
|
+
_default_instance.list_architectures()
|
|
22
|
+
|
|
23
|
+
list_practicals = list_architectures
|
|
24
|
+
entries = list_architectures
|
|
25
|
+
list_entries = list_architectures
|
|
26
|
+
|
|
27
|
+
# Core Architecture & Recipe accessors
|
|
28
|
+
def architecture(num, cell=None, recipes=False):
|
|
29
|
+
"""View architecture implementation cell-by-cell or with recipes."""
|
|
30
|
+
_default_instance.architecture(num, cell=cell, recipes=recipes)
|
|
31
|
+
|
|
32
|
+
def recipes(num):
|
|
33
|
+
"""View customization recipes (Pandas CSV, optimizers, loss, architecture notes)."""
|
|
34
|
+
_default_instance.recipes(num)
|
|
35
|
+
|
|
36
|
+
# Intuitive aliases so both keres.recipe(n) and keres.recipes(n) show recipes!
|
|
37
|
+
recipe = recipes
|
|
38
|
+
tweaks = recipes
|
|
39
|
+
|
|
40
|
+
def get_architecture(num, cell=None, recipes=False):
|
|
41
|
+
"""Retrieve architecture code string."""
|
|
42
|
+
return _default_instance.get_architecture(num, cell=cell, recipes=recipes)
|
|
43
|
+
|
|
44
|
+
get_practical = get_architecture
|
|
45
|
+
|
|
46
|
+
def get_recipes(num):
|
|
47
|
+
"""Retrieve customization recipes string."""
|
|
48
|
+
return _default_instance.get_recipes(num)
|
|
49
|
+
|
|
50
|
+
get_recipe = get_recipes
|
|
51
|
+
get_tweaks = get_recipes
|
|
52
|
+
|
|
53
|
+
def get_cells(num):
|
|
54
|
+
"""Retrieve list of cell dicts for an architecture."""
|
|
55
|
+
return _default_instance.get_cells(num)
|
|
56
|
+
|
|
57
|
+
def export_all_texts(output_dir):
|
|
58
|
+
"""Export all architecture reference guides to output_dir."""
|
|
59
|
+
_default_instance.export_all_texts(output_dir)
|
|
60
|
+
|
|
61
|
+
# Clean Model-specific Shortcuts
|
|
62
|
+
def perceptron(cell=None, recipes=False):
|
|
63
|
+
"""Architecture 1: Single-Layer Perceptron (Decision Boundaries)."""
|
|
64
|
+
_default_instance.perceptron(cell=cell, recipes=recipes)
|
|
65
|
+
|
|
66
|
+
def mlp(cell=None, recipes=False):
|
|
67
|
+
"""Architecture 2: Multi-Layer Perceptron on Fashion-MNIST."""
|
|
68
|
+
_default_instance.mlp(cell=cell, recipes=recipes)
|
|
69
|
+
|
|
70
|
+
def regularization(cell=None, recipes=False):
|
|
71
|
+
"""Architecture 3: Regularization Methods (L2 Decay vs Dropout)."""
|
|
72
|
+
_default_instance.regularization(cell=cell, recipes=recipes)
|
|
73
|
+
|
|
74
|
+
def activations(cell=None, recipes=False):
|
|
75
|
+
"""Architecture 4: Non-Linear Activation Functions Analysis."""
|
|
76
|
+
_default_instance.activations(cell=cell, recipes=recipes)
|
|
77
|
+
|
|
78
|
+
def cnn(cell=None, recipes=False):
|
|
79
|
+
"""Architecture 5: Convolutional Neural Networks (CNN) vs MLP for Vision."""
|
|
80
|
+
_default_instance.cnn(cell=cell, recipes=recipes)
|
|
81
|
+
|
|
82
|
+
def lstm(cell=None, recipes=False):
|
|
83
|
+
"""Architecture 6: Recurrent Neural Networks (LSTM) for Sequence Modeling."""
|
|
84
|
+
_default_instance.lstm(cell=cell, recipes=recipes)
|
|
85
|
+
|
|
86
|
+
def transfer_learning(cell=None, recipes=False):
|
|
87
|
+
"""Architecture 7: Transfer Learning & Fine-Tuning with MobileNetV2."""
|
|
88
|
+
_default_instance.transfer_learning(cell=cell, recipes=recipes)
|
|
89
|
+
|
|
90
|
+
def hparam_tuning(cell=None, recipes=False):
|
|
91
|
+
"""Architecture 8: Hyperparameter Optimization & TensorBoard Tracking."""
|
|
92
|
+
_default_instance.hparam_tuning(cell=cell, recipes=recipes)
|
|
93
|
+
|
|
94
|
+
def multi_loss(cell=None, recipes=False):
|
|
95
|
+
"""Architecture 0: Multi-Loss Deep Neural Network Training."""
|
|
96
|
+
_default_instance.multi_loss(cell=cell, recipes=recipes)
|
|
97
|
+
|
|
98
|
+
def cats_dogs(cell=None, recipes=False):
|
|
99
|
+
"""Architecture 9: Transfer Learning for Cats vs Dogs with Pretrained ResNet50."""
|
|
100
|
+
_default_instance.cats_dogs(cell=cell, recipes=recipes)
|
|
101
|
+
|
|
102
|
+
cats_vs_dogs = cats_dogs
|
|
103
|
+
pet_classifier = cats_dogs
|
|
104
|
+
|
|
105
|
+
# Theory & Viva Explainer
|
|
106
|
+
def theory(num):
|
|
107
|
+
"""View theoretical foundation, equations, and viva explainer."""
|
|
108
|
+
from .theory import get_theory
|
|
109
|
+
print(get_theory(num))
|
|
110
|
+
|
|
111
|
+
explain = theory
|
|
112
|
+
|
|
113
|
+
def viva(num=None):
|
|
114
|
+
"""View Viva Examination questions and answers."""
|
|
115
|
+
from .theory import get_viva
|
|
116
|
+
print(get_viva(num))
|
|
117
|
+
|
|
118
|
+
# Dataset utilities
|
|
119
|
+
def pull_datasets(target_dir="./data", overwrite=False):
|
|
120
|
+
"""Extract bundled datasets (mnist.csv & imdb.csv) locally."""
|
|
121
|
+
from .datasets import pull_datasets as _pull
|
|
122
|
+
return _pull(target_dir=target_dir, overwrite=overwrite)
|
|
123
|
+
|
|
124
|
+
def list_datasets():
|
|
125
|
+
"""List bundled datasets."""
|
|
126
|
+
from .datasets import list_datasets as _list
|
|
127
|
+
_list()
|
|
128
|
+
|
|
129
|
+
def load_mnist(normalize=True):
|
|
130
|
+
"""Load normalized MNIST directly into memory."""
|
|
131
|
+
from .datasets import load_mnist as _load
|
|
132
|
+
return _load(normalize=normalize)
|
|
133
|
+
|
|
134
|
+
def load_imdb():
|
|
135
|
+
"""Load IMDB sentiment dataset into memory."""
|
|
136
|
+
from .datasets import load_imdb as _load
|
|
137
|
+
return _load()
|
|
138
|
+
|
|
139
|
+
# Backwards compatibility
|
|
140
|
+
def mock_practical(cell=None, tweaks=False):
|
|
141
|
+
_default_instance.mock_practical(cell=cell, tweaks=tweaks)
|
|
142
|
+
|
|
143
|
+
def practical_1(cell=None, tweaks=False):
|
|
144
|
+
_default_instance.practical_1(cell=cell, tweaks=tweaks)
|
|
145
|
+
|
|
146
|
+
def practical_2(cell=None, tweaks=False):
|
|
147
|
+
_default_instance.practical_2(cell=cell, tweaks=tweaks)
|
|
148
|
+
|
|
149
|
+
def practical_3(cell=None, tweaks=False):
|
|
150
|
+
_default_instance.practical_3(cell=cell, tweaks=tweaks)
|
|
151
|
+
|
|
152
|
+
def practical_4(cell=None, tweaks=False):
|
|
153
|
+
_default_instance.practical_4(cell=cell, tweaks=tweaks)
|
|
154
|
+
|
|
155
|
+
def practical_5(cell=None, tweaks=False):
|
|
156
|
+
_default_instance.practical_5(cell=cell, tweaks=tweaks)
|
|
157
|
+
|
|
158
|
+
def practical_6(cell=None, tweaks=False):
|
|
159
|
+
_default_instance.practical_6(cell=cell, tweaks=tweaks)
|
|
160
|
+
|
|
161
|
+
def practical_7(cell=None, tweaks=False):
|
|
162
|
+
_default_instance.practical_7(cell=cell, tweaks=tweaks)
|
|
163
|
+
|
|
164
|
+
def practical_8(cell=None, tweaks=False):
|
|
165
|
+
_default_instance.practical_8(cell=cell, tweaks=tweaks)
|
|
166
|
+
|
|
167
|
+
__all__ = [
|
|
168
|
+
"Keres",
|
|
169
|
+
"DLArchitectures",
|
|
170
|
+
"DLPracticals",
|
|
171
|
+
"list_architectures",
|
|
172
|
+
"list_practicals",
|
|
173
|
+
"guide",
|
|
174
|
+
"help",
|
|
175
|
+
"quickstart",
|
|
176
|
+
"architecture",
|
|
177
|
+
"recipe",
|
|
178
|
+
"recipes",
|
|
179
|
+
"tweaks",
|
|
180
|
+
"get_architecture",
|
|
181
|
+
"get_practical",
|
|
182
|
+
"get_recipe",
|
|
183
|
+
"get_recipes",
|
|
184
|
+
"get_tweaks",
|
|
185
|
+
"get_cells",
|
|
186
|
+
"export_all_texts",
|
|
187
|
+
"perceptron",
|
|
188
|
+
"mlp",
|
|
189
|
+
"regularization",
|
|
190
|
+
"activations",
|
|
191
|
+
"cnn",
|
|
192
|
+
"lstm",
|
|
193
|
+
"transfer_learning",
|
|
194
|
+
"hparam_tuning",
|
|
195
|
+
"multi_loss",
|
|
196
|
+
"cats_dogs",
|
|
197
|
+
"cats_vs_dogs",
|
|
198
|
+
"pet_classifier",
|
|
199
|
+
"mock_practical",
|
|
200
|
+
"practical_1",
|
|
201
|
+
"practical_2",
|
|
202
|
+
"practical_3",
|
|
203
|
+
"practical_4",
|
|
204
|
+
"practical_5",
|
|
205
|
+
"practical_6",
|
|
206
|
+
"practical_7",
|
|
207
|
+
"practical_8",
|
|
208
|
+
"PytochSuite",
|
|
209
|
+
"pytoch_suite",
|
|
210
|
+
"pytoch",
|
|
211
|
+
"local_suite",
|
|
212
|
+
"theory",
|
|
213
|
+
"explain",
|
|
214
|
+
"viva",
|
|
215
|
+
"pull_datasets",
|
|
216
|
+
"list_datasets",
|
|
217
|
+
"load_mnist",
|
|
218
|
+
"load_imdb",
|
|
219
|
+
]
|
|
220
|
+
|
|
221
|
+
__version__ = "1.0.0"
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"""
|
|
2
|
+
Command-line interface for keres.
|
|
3
|
+
"""
|
|
4
|
+
|
|
5
|
+
import argparse
|
|
6
|
+
import sys
|
|
7
|
+
from keres.guide import Keres
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def main():
|
|
11
|
+
parser = argparse.ArgumentParser(
|
|
12
|
+
prog="keres",
|
|
13
|
+
description="keres: Deep Learning Architecture Reference & Code Recipe Library"
|
|
14
|
+
)
|
|
15
|
+
subparsers = parser.add_subparsers(dest="command", help="Command to run")
|
|
16
|
+
|
|
17
|
+
# guide / help
|
|
18
|
+
subparsers.add_parser("guide", help="Show built-in quickstart guide and cheat sheet")
|
|
19
|
+
subparsers.add_parser("help", help="Show built-in quickstart guide and cheat sheet")
|
|
20
|
+
|
|
21
|
+
# list
|
|
22
|
+
subparsers.add_parser("list", help="List all available architectures")
|
|
23
|
+
|
|
24
|
+
# show
|
|
25
|
+
show_parser = subparsers.add_parser("show", help="Display architecture code cell-by-cell")
|
|
26
|
+
show_parser.add_argument("number", help="Architecture number (0..8)")
|
|
27
|
+
show_parser.add_argument("--cell", type=int, default=None, help="Specific cell number (1-based)")
|
|
28
|
+
show_parser.add_argument("--recipes", "--tweaks", "-r", "-t", dest="recipes", action="store_true", help="Include customization recipes at the end")
|
|
29
|
+
|
|
30
|
+
# recipes / tweaks
|
|
31
|
+
subparsers.add_parser("recipes", help="Display customization recipes (dataset, optimizer, architecture notes)").add_argument("number", help="Architecture number (0..8)")
|
|
32
|
+
subparsers.add_parser("tweaks", help="Alias for recipes").add_argument("number", help="Architecture number (0..8)")
|
|
33
|
+
|
|
34
|
+
# export
|
|
35
|
+
export_parser = subparsers.add_parser("export", help="Export architecture reference guides to a directory")
|
|
36
|
+
export_parser.add_argument("--out", "--out-dir", "-o", dest="out", default="./keres_guides_txt", help="Output directory")
|
|
37
|
+
|
|
38
|
+
args = parser.parse_args()
|
|
39
|
+
guide = Keres()
|
|
40
|
+
|
|
41
|
+
if args.command in ("guide", "help") or args.command is None:
|
|
42
|
+
guide.guide()
|
|
43
|
+
elif args.command == "list":
|
|
44
|
+
guide.list_architectures()
|
|
45
|
+
elif args.command == "show":
|
|
46
|
+
try:
|
|
47
|
+
guide._display_or_return(args.number, cell=args.cell, recipes=args.recipes)
|
|
48
|
+
except Exception as e:
|
|
49
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
50
|
+
sys.exit(1)
|
|
51
|
+
elif args.command in ("recipes", "tweaks"):
|
|
52
|
+
try:
|
|
53
|
+
guide.recipes(args.number)
|
|
54
|
+
except Exception as e:
|
|
55
|
+
print(f"Error: {e}", file=sys.stderr)
|
|
56
|
+
sys.exit(1)
|
|
57
|
+
elif args.command == "export":
|
|
58
|
+
guide.export_all_texts(args.out)
|
|
59
|
+
else:
|
|
60
|
+
parser.print_help()
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
if __name__ == "__main__":
|
|
64
|
+
main()
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# keres data package
|