lmur 1.0.4__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.
- lmur-1.0.4/LICENSE +22 -0
- lmur-1.0.4/MANIFEST.in +6 -0
- lmur-1.0.4/PKG-INFO +171 -0
- lmur-1.0.4/README.md +144 -0
- lmur-1.0.4/lmur.egg-info/PKG-INFO +171 -0
- lmur-1.0.4/lmur.egg-info/SOURCES.txt +11 -0
- lmur-1.0.4/lmur.egg-info/dependency_links.txt +1 -0
- lmur-1.0.4/lmur.egg-info/requires.txt +4 -0
- lmur-1.0.4/lmur.egg-info/top_level.txt +1 -0
- lmur-1.0.4/requirements.txt +1 -0
- lmur-1.0.4/setup.cfg +4 -0
- lmur-1.0.4/setup.py +43 -0
- lmur-1.0.4/version +1 -0
lmur-1.0.4/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024- ABrain One and contributors
|
|
4
|
+
All rights reserved.
|
|
5
|
+
|
|
6
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
7
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
8
|
+
in the Software without restriction, including without limitation the rights
|
|
9
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
10
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
11
|
+
furnished to do so, subject to the following conditions:
|
|
12
|
+
|
|
13
|
+
The above copyright notice and this permission notice shall be included in all
|
|
14
|
+
copies or substantial portions of the Software.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
17
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
19
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
20
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
21
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
22
|
+
SOFTWARE.
|
lmur-1.0.4/MANIFEST.in
ADDED
lmur-1.0.4/PKG-INFO
ADDED
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: lmur
|
|
3
|
+
Version: 1.0.4
|
|
4
|
+
Summary: Neural Network Dataset
|
|
5
|
+
Home-page: https://ABrain.one
|
|
6
|
+
Author: ABrain One and contributors
|
|
7
|
+
Author-email: AI@ABrain.one
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: nn-dataset==1.0.4
|
|
15
|
+
Provides-Extra: stat
|
|
16
|
+
Requires-Dist: nn-stat; extra == "stat"
|
|
17
|
+
Dynamic: author
|
|
18
|
+
Dynamic: author-email
|
|
19
|
+
Dynamic: classifier
|
|
20
|
+
Dynamic: description
|
|
21
|
+
Dynamic: description-content-type
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: provides-extra
|
|
24
|
+
Dynamic: requires-dist
|
|
25
|
+
Dynamic: requires-python
|
|
26
|
+
Dynamic: summary
|
|
27
|
+
|
|
28
|
+
## <img src='https://abrain.one/img/lemur-nn-icon-64x64.png' width='32px'/> Neural Network Dataset
|
|
29
|
+
nn-dataset <a href='https://pypi.python.org/pypi/nn-dataset'><img src='https://img.shields.io/pypi/v/nn-dataset.svg'/></a> or lmur <a href='https://pypi.python.org/pypi/lmur'><img src='https://img.shields.io/pypi/v/lmur.svg'/></a>
|
|
30
|
+
|
|
31
|
+
LEMUR - Learning, Evaluation, and Modeling for Unified Research
|
|
32
|
+
|
|
33
|
+
<img src='https://abrain.one/img/lemur-nn-whit.jpg' width='25%'/>
|
|
34
|
+
|
|
35
|
+
The original version of the <a href='https://github.com/ABrain-One/nn-dataset'>LEMUR dataset</a> was created by <strong>Arash Torabi Goodarzi, Roman Kochnev</strong> and <strong>Zofia Antonina Bentyn</strong> at the Computer Vision Laboratory, University of Würzburg, Germany.
|
|
36
|
+
|
|
37
|
+
<h3>Overview 📖</h3>
|
|
38
|
+
The primary goal of NN Dataset project is to provide flexibility for dynamically combining various deep learing tasks, datasets, metrics, and neural network models. It is designed to facilitate the verification of neural network performance under various combinations of training hyperparameters and data transformation algorithms, by automatically generating performance statistics. It is primarily developed to support the <a href="https://github.com/ABrain-One/nn-gen">NN Gen</a> project.
|
|
39
|
+
|
|
40
|
+
## Installation or Update of the NN Dataset
|
|
41
|
+
Remove old version of the LEMUR Dataset and its database:
|
|
42
|
+
```bash
|
|
43
|
+
source .venv/bin/activate
|
|
44
|
+
pip uninstall nn-dataset -y
|
|
45
|
+
rm -rf db
|
|
46
|
+
```
|
|
47
|
+
Installing the stable version:
|
|
48
|
+
```bash
|
|
49
|
+
source .venv/bin/activate
|
|
50
|
+
pip install nn-dataset --upgrade --extra-index-url https://download.pytorch.org/whl/cu124
|
|
51
|
+
```
|
|
52
|
+
Installing from GitHub to get the most recent code and statistics updates:
|
|
53
|
+
```bash
|
|
54
|
+
source .venv/bin/activate
|
|
55
|
+
pip install git+https://github.com/ABrain-One/nn-dataset --upgrade --force --extra-index-url https://download.pytorch.org/whl/cu124
|
|
56
|
+
```
|
|
57
|
+
Adding functionality to export data to Excel files and generate plots for <a href='https://github.com/ABrain-One/nn-stat'>analyzing neural network performance</a>:
|
|
58
|
+
```bash
|
|
59
|
+
source .venv/bin/activate
|
|
60
|
+
pip install nn-stat --upgrade --extra-index-url https://download.pytorch.org/whl/cu124
|
|
61
|
+
```
|
|
62
|
+
and export/generate:
|
|
63
|
+
```bash
|
|
64
|
+
source .venv/bin/activate
|
|
65
|
+
python -m ab.stat.export
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Usage
|
|
69
|
+
|
|
70
|
+
Standard use cases:
|
|
71
|
+
1. Add a new neural network model into the `ab/nn/nn` directory.
|
|
72
|
+
2. Run the automated training process for this model (e.g., a new ComplexNet training pipeline configuration):
|
|
73
|
+
```bash
|
|
74
|
+
source .venv/bin/activate
|
|
75
|
+
python -m ab.nn.train -c img-classification_cifar-10_acc_ComplexNet
|
|
76
|
+
```
|
|
77
|
+
or for all image segmentation models using a fixed range of training parameters and transformer:
|
|
78
|
+
```bash
|
|
79
|
+
source .venv/bin/activate
|
|
80
|
+
python run.py -c img-segmentation -f echo --min_learning_rate 1e-4 -l 1e-2 --min_momentum 0.8 -m 0.99 --min_batch_binary_power 2 -b 6
|
|
81
|
+
```
|
|
82
|
+
To reproduce the previous result, set the minimum and maximum to the same desired values:
|
|
83
|
+
```bash
|
|
84
|
+
source .venv/bin/activate
|
|
85
|
+
python run.py -c img-classification_cifar-10_acc_AlexNet --min_learning_rate 0.0061 -l 0.0061 --min_momentum 0.7549 -m 0.7549 --min_batch_binary_power 2 -b 2 -f norm_299
|
|
86
|
+
```
|
|
87
|
+
To view supported flags:
|
|
88
|
+
```bash
|
|
89
|
+
python run.py -h
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Docker
|
|
93
|
+
All versions of this project are compatible with <a href='https://hub.docker.com/r/abrainone/ai-linux' target='_blank'>AI Linux</a> and can be run inside a Docker image:
|
|
94
|
+
```bash
|
|
95
|
+
docker run -v /a/mm:. abrainone/ai-linux bash -c "PYTHONPATH=/a/mm python -m ab.nn.train"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Environment for NN Dataset Contributors
|
|
99
|
+
### Pip package manager
|
|
100
|
+
Create a virtual environment, activate it, and run the following command to install all the project dependencies:
|
|
101
|
+
```bash
|
|
102
|
+
source .venv/bin/activate
|
|
103
|
+
python -m pip install --upgrade pip
|
|
104
|
+
pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu124
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Contribution
|
|
108
|
+
|
|
109
|
+
To contribute a new neural network (NN) model to the NN Dataset, please ensure the following criteria are met:
|
|
110
|
+
|
|
111
|
+
1. The code for each model is provided in a respective ".py" file within the <strong>/ab/nn/nn</strong> directory, and the file is named after the name of the model's structure.
|
|
112
|
+
2. The main class for each model is named <strong>Net</strong>.
|
|
113
|
+
3. The constructor of the <strong>Net</strong> class takes the following parameters:
|
|
114
|
+
- <strong>in_shape</strong> (tuple): The shape of the first tensor from the dataset iterator. For images it is structured as `(batch, channel, height, width)`.
|
|
115
|
+
- <strong>out_shape</strong> (tuple): Provided by the dataset loader, it describes the shape of the output tensor. For a classification task, this could be `(number of classes,)`.
|
|
116
|
+
- <strong>prm</strong> (dict): A dictionary of hyperparameters, e.g., `{'lr': 0.24, 'momentum': 0.93, 'dropout': 0.51}`.
|
|
117
|
+
- <strong>device</strong> (torch.device): PyTorch device used for the model training
|
|
118
|
+
4. All external information required for the correct building and training of the NN model for a specific dataset/transformer, as well as the list of hyperparameters, is extracted from <strong>in_shape</strong>, <strong>out_shape</strong> or <strong>prm</strong>, e.g.: </br>`batch = in_shape[0]` </br>`channel_number = in_shape[1]` </br>`image_size = in_shape[2]` </br>`class_number = out_shape[0]` </br>`learning_rate = prm['lr']` </br>`momentum = prm['momentum']` </br>`dropout = prm['dropout']`.
|
|
119
|
+
5. Every model script has function returning set of supported hyperparameters, e.g.: </br>`def supported_hyperparameters(): return {'lr', 'momentum', 'dropout'}`</br> The value of each hyperparameter lies within the range of 0.0 to 1.0.
|
|
120
|
+
6. Every class <strong>Net</strong> implements two functions: </br>`train_setup(self, prm)`</br> and </br>`learn(self, train_data)`</br> The first function initializes the `criteria` and `optimizer`, while the second implements the training pipeline. See a simple implementation in the <a href="https://github.com/ABrain-One/nn-dataset/blob/main/ab/nn/nn/AlexNet.py">AlexNet model</a>.
|
|
121
|
+
7. For each pull request involving a new NN model, please generate and submit training statistics for 100 Optuna trials (or at least 3 trials for very large models) in the <strong>ab/nn/stat</strong> directory. The trials should cover 5 epochs of training. Ensure that this statistics is included along with the model in your pull request. For example, the statistics for the ComplexNet model are stored in files <strong><epoch number>.json</strong> inside folder <strong>img-classification_cifar-10_acc_ComplexNet</strong>, and can be generated by:<br/>
|
|
122
|
+
```bash
|
|
123
|
+
python run.py -c img-classification_cifar-10_acc_ComplexNet -t 100 -e 5
|
|
124
|
+
```
|
|
125
|
+
<p>See more examples of models in <code>/ab/nn/nn</code> and generated statistics in <code>/ab/nn/stat</code>.</p>
|
|
126
|
+
|
|
127
|
+
### Available Modules
|
|
128
|
+
|
|
129
|
+
The `nn-dataset` package includes the following key modules:
|
|
130
|
+
|
|
131
|
+
1. **Dataset**:
|
|
132
|
+
- Predefined neural network architectures such as `AlexNet`, `ResNet`, `VGG`, and more.
|
|
133
|
+
- Located in `ab.nn.nn`.
|
|
134
|
+
|
|
135
|
+
2. **Loaders**:
|
|
136
|
+
- Data loaders for datasets such as CIFAR-10 and COCO.
|
|
137
|
+
- Located in `ab.nn.loader`.
|
|
138
|
+
|
|
139
|
+
3. **Metrics**:
|
|
140
|
+
- Common evaluation metrics like accuracy and IoU.
|
|
141
|
+
- Located in `ab.nn.metric`.
|
|
142
|
+
|
|
143
|
+
4. **Utilities**:
|
|
144
|
+
- Helper functions for training and statistical analysis.
|
|
145
|
+
- Located in `ab.nn.util`.
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
## Citation
|
|
149
|
+
|
|
150
|
+
If you find the LEMUR Neural Network Dataset to be useful for your research, please consider citing:
|
|
151
|
+
```bibtex
|
|
152
|
+
@misc{ABrain-One.NN-Dataset,
|
|
153
|
+
author = {Goodarzi, Arash Torabi and Kochnev, Roman and Khalid, Waleed and Qin, Furui and Kathiriya, Yash Kanubhai and Dhameliya, Yashkumar Sanjaybhai and Ignatov, Dmitry and Timofte, Radu},
|
|
154
|
+
title = {Neural Network Dataset: Towards Seamless AutoML},
|
|
155
|
+
howpublished = {\url{https://github.com/ABrain-One/nn-dataset}},
|
|
156
|
+
year = {2024},
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Licenses
|
|
161
|
+
|
|
162
|
+
This project is distributed under the following licensing terms:
|
|
163
|
+
<ul><li>for neural network models adopted from other projects
|
|
164
|
+
<ul>
|
|
165
|
+
<li> Python code under the legacy <a href="https://github.com/ABrain-One/nn-dataset/blob/main/Doc/Licenses/LICENSE-MIT-NNs">MIT</a> or <a href="https://github.com/ABrain-One/nn-dataset/blob/main/Doc/Licenses/LICENSE-BSD-NNs">BSD 3-Clause</a> license</li>
|
|
166
|
+
<li> models with pretrained weights under the legacy <a href="https://github.com/ABrain-One/nn-dataset/blob/main/Doc/Licenses/LICENSE-DEEPSEEK-LLM-V2">DeepSeek LLM V2</a> license</li>
|
|
167
|
+
</ul></li>
|
|
168
|
+
<li> all neural network models and their weights not covered by the above licenses, as well as all other files and assets in this project, are subject to the <a href="https://github.com/ABrain-One/nn-dataset/blob/main/LICENSE">MIT license</a></li>
|
|
169
|
+
</ul>
|
|
170
|
+
|
|
171
|
+
#### The idea of Dr. Dmitry Ignatov
|
lmur-1.0.4/README.md
ADDED
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
## <img src='https://abrain.one/img/lemur-nn-icon-64x64.png' width='32px'/> Neural Network Dataset
|
|
2
|
+
nn-dataset <a href='https://pypi.python.org/pypi/nn-dataset'><img src='https://img.shields.io/pypi/v/nn-dataset.svg'/></a> or lmur <a href='https://pypi.python.org/pypi/lmur'><img src='https://img.shields.io/pypi/v/lmur.svg'/></a>
|
|
3
|
+
|
|
4
|
+
LEMUR - Learning, Evaluation, and Modeling for Unified Research
|
|
5
|
+
|
|
6
|
+
<img src='https://abrain.one/img/lemur-nn-whit.jpg' width='25%'/>
|
|
7
|
+
|
|
8
|
+
The original version of the <a href='https://github.com/ABrain-One/nn-dataset'>LEMUR dataset</a> was created by <strong>Arash Torabi Goodarzi, Roman Kochnev</strong> and <strong>Zofia Antonina Bentyn</strong> at the Computer Vision Laboratory, University of Würzburg, Germany.
|
|
9
|
+
|
|
10
|
+
<h3>Overview 📖</h3>
|
|
11
|
+
The primary goal of NN Dataset project is to provide flexibility for dynamically combining various deep learing tasks, datasets, metrics, and neural network models. It is designed to facilitate the verification of neural network performance under various combinations of training hyperparameters and data transformation algorithms, by automatically generating performance statistics. It is primarily developed to support the <a href="https://github.com/ABrain-One/nn-gen">NN Gen</a> project.
|
|
12
|
+
|
|
13
|
+
## Installation or Update of the NN Dataset
|
|
14
|
+
Remove old version of the LEMUR Dataset and its database:
|
|
15
|
+
```bash
|
|
16
|
+
source .venv/bin/activate
|
|
17
|
+
pip uninstall nn-dataset -y
|
|
18
|
+
rm -rf db
|
|
19
|
+
```
|
|
20
|
+
Installing the stable version:
|
|
21
|
+
```bash
|
|
22
|
+
source .venv/bin/activate
|
|
23
|
+
pip install nn-dataset --upgrade --extra-index-url https://download.pytorch.org/whl/cu124
|
|
24
|
+
```
|
|
25
|
+
Installing from GitHub to get the most recent code and statistics updates:
|
|
26
|
+
```bash
|
|
27
|
+
source .venv/bin/activate
|
|
28
|
+
pip install git+https://github.com/ABrain-One/nn-dataset --upgrade --force --extra-index-url https://download.pytorch.org/whl/cu124
|
|
29
|
+
```
|
|
30
|
+
Adding functionality to export data to Excel files and generate plots for <a href='https://github.com/ABrain-One/nn-stat'>analyzing neural network performance</a>:
|
|
31
|
+
```bash
|
|
32
|
+
source .venv/bin/activate
|
|
33
|
+
pip install nn-stat --upgrade --extra-index-url https://download.pytorch.org/whl/cu124
|
|
34
|
+
```
|
|
35
|
+
and export/generate:
|
|
36
|
+
```bash
|
|
37
|
+
source .venv/bin/activate
|
|
38
|
+
python -m ab.stat.export
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
## Usage
|
|
42
|
+
|
|
43
|
+
Standard use cases:
|
|
44
|
+
1. Add a new neural network model into the `ab/nn/nn` directory.
|
|
45
|
+
2. Run the automated training process for this model (e.g., a new ComplexNet training pipeline configuration):
|
|
46
|
+
```bash
|
|
47
|
+
source .venv/bin/activate
|
|
48
|
+
python -m ab.nn.train -c img-classification_cifar-10_acc_ComplexNet
|
|
49
|
+
```
|
|
50
|
+
or for all image segmentation models using a fixed range of training parameters and transformer:
|
|
51
|
+
```bash
|
|
52
|
+
source .venv/bin/activate
|
|
53
|
+
python run.py -c img-segmentation -f echo --min_learning_rate 1e-4 -l 1e-2 --min_momentum 0.8 -m 0.99 --min_batch_binary_power 2 -b 6
|
|
54
|
+
```
|
|
55
|
+
To reproduce the previous result, set the minimum and maximum to the same desired values:
|
|
56
|
+
```bash
|
|
57
|
+
source .venv/bin/activate
|
|
58
|
+
python run.py -c img-classification_cifar-10_acc_AlexNet --min_learning_rate 0.0061 -l 0.0061 --min_momentum 0.7549 -m 0.7549 --min_batch_binary_power 2 -b 2 -f norm_299
|
|
59
|
+
```
|
|
60
|
+
To view supported flags:
|
|
61
|
+
```bash
|
|
62
|
+
python run.py -h
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### Docker
|
|
66
|
+
All versions of this project are compatible with <a href='https://hub.docker.com/r/abrainone/ai-linux' target='_blank'>AI Linux</a> and can be run inside a Docker image:
|
|
67
|
+
```bash
|
|
68
|
+
docker run -v /a/mm:. abrainone/ai-linux bash -c "PYTHONPATH=/a/mm python -m ab.nn.train"
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## Environment for NN Dataset Contributors
|
|
72
|
+
### Pip package manager
|
|
73
|
+
Create a virtual environment, activate it, and run the following command to install all the project dependencies:
|
|
74
|
+
```bash
|
|
75
|
+
source .venv/bin/activate
|
|
76
|
+
python -m pip install --upgrade pip
|
|
77
|
+
pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu124
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
## Contribution
|
|
81
|
+
|
|
82
|
+
To contribute a new neural network (NN) model to the NN Dataset, please ensure the following criteria are met:
|
|
83
|
+
|
|
84
|
+
1. The code for each model is provided in a respective ".py" file within the <strong>/ab/nn/nn</strong> directory, and the file is named after the name of the model's structure.
|
|
85
|
+
2. The main class for each model is named <strong>Net</strong>.
|
|
86
|
+
3. The constructor of the <strong>Net</strong> class takes the following parameters:
|
|
87
|
+
- <strong>in_shape</strong> (tuple): The shape of the first tensor from the dataset iterator. For images it is structured as `(batch, channel, height, width)`.
|
|
88
|
+
- <strong>out_shape</strong> (tuple): Provided by the dataset loader, it describes the shape of the output tensor. For a classification task, this could be `(number of classes,)`.
|
|
89
|
+
- <strong>prm</strong> (dict): A dictionary of hyperparameters, e.g., `{'lr': 0.24, 'momentum': 0.93, 'dropout': 0.51}`.
|
|
90
|
+
- <strong>device</strong> (torch.device): PyTorch device used for the model training
|
|
91
|
+
4. All external information required for the correct building and training of the NN model for a specific dataset/transformer, as well as the list of hyperparameters, is extracted from <strong>in_shape</strong>, <strong>out_shape</strong> or <strong>prm</strong>, e.g.: </br>`batch = in_shape[0]` </br>`channel_number = in_shape[1]` </br>`image_size = in_shape[2]` </br>`class_number = out_shape[0]` </br>`learning_rate = prm['lr']` </br>`momentum = prm['momentum']` </br>`dropout = prm['dropout']`.
|
|
92
|
+
5. Every model script has function returning set of supported hyperparameters, e.g.: </br>`def supported_hyperparameters(): return {'lr', 'momentum', 'dropout'}`</br> The value of each hyperparameter lies within the range of 0.0 to 1.0.
|
|
93
|
+
6. Every class <strong>Net</strong> implements two functions: </br>`train_setup(self, prm)`</br> and </br>`learn(self, train_data)`</br> The first function initializes the `criteria` and `optimizer`, while the second implements the training pipeline. See a simple implementation in the <a href="https://github.com/ABrain-One/nn-dataset/blob/main/ab/nn/nn/AlexNet.py">AlexNet model</a>.
|
|
94
|
+
7. For each pull request involving a new NN model, please generate and submit training statistics for 100 Optuna trials (or at least 3 trials for very large models) in the <strong>ab/nn/stat</strong> directory. The trials should cover 5 epochs of training. Ensure that this statistics is included along with the model in your pull request. For example, the statistics for the ComplexNet model are stored in files <strong><epoch number>.json</strong> inside folder <strong>img-classification_cifar-10_acc_ComplexNet</strong>, and can be generated by:<br/>
|
|
95
|
+
```bash
|
|
96
|
+
python run.py -c img-classification_cifar-10_acc_ComplexNet -t 100 -e 5
|
|
97
|
+
```
|
|
98
|
+
<p>See more examples of models in <code>/ab/nn/nn</code> and generated statistics in <code>/ab/nn/stat</code>.</p>
|
|
99
|
+
|
|
100
|
+
### Available Modules
|
|
101
|
+
|
|
102
|
+
The `nn-dataset` package includes the following key modules:
|
|
103
|
+
|
|
104
|
+
1. **Dataset**:
|
|
105
|
+
- Predefined neural network architectures such as `AlexNet`, `ResNet`, `VGG`, and more.
|
|
106
|
+
- Located in `ab.nn.nn`.
|
|
107
|
+
|
|
108
|
+
2. **Loaders**:
|
|
109
|
+
- Data loaders for datasets such as CIFAR-10 and COCO.
|
|
110
|
+
- Located in `ab.nn.loader`.
|
|
111
|
+
|
|
112
|
+
3. **Metrics**:
|
|
113
|
+
- Common evaluation metrics like accuracy and IoU.
|
|
114
|
+
- Located in `ab.nn.metric`.
|
|
115
|
+
|
|
116
|
+
4. **Utilities**:
|
|
117
|
+
- Helper functions for training and statistical analysis.
|
|
118
|
+
- Located in `ab.nn.util`.
|
|
119
|
+
|
|
120
|
+
|
|
121
|
+
## Citation
|
|
122
|
+
|
|
123
|
+
If you find the LEMUR Neural Network Dataset to be useful for your research, please consider citing:
|
|
124
|
+
```bibtex
|
|
125
|
+
@misc{ABrain-One.NN-Dataset,
|
|
126
|
+
author = {Goodarzi, Arash Torabi and Kochnev, Roman and Khalid, Waleed and Qin, Furui and Kathiriya, Yash Kanubhai and Dhameliya, Yashkumar Sanjaybhai and Ignatov, Dmitry and Timofte, Radu},
|
|
127
|
+
title = {Neural Network Dataset: Towards Seamless AutoML},
|
|
128
|
+
howpublished = {\url{https://github.com/ABrain-One/nn-dataset}},
|
|
129
|
+
year = {2024},
|
|
130
|
+
}
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
## Licenses
|
|
134
|
+
|
|
135
|
+
This project is distributed under the following licensing terms:
|
|
136
|
+
<ul><li>for neural network models adopted from other projects
|
|
137
|
+
<ul>
|
|
138
|
+
<li> Python code under the legacy <a href="https://github.com/ABrain-One/nn-dataset/blob/main/Doc/Licenses/LICENSE-MIT-NNs">MIT</a> or <a href="https://github.com/ABrain-One/nn-dataset/blob/main/Doc/Licenses/LICENSE-BSD-NNs">BSD 3-Clause</a> license</li>
|
|
139
|
+
<li> models with pretrained weights under the legacy <a href="https://github.com/ABrain-One/nn-dataset/blob/main/Doc/Licenses/LICENSE-DEEPSEEK-LLM-V2">DeepSeek LLM V2</a> license</li>
|
|
140
|
+
</ul></li>
|
|
141
|
+
<li> all neural network models and their weights not covered by the above licenses, as well as all other files and assets in this project, are subject to the <a href="https://github.com/ABrain-One/nn-dataset/blob/main/LICENSE">MIT license</a></li>
|
|
142
|
+
</ul>
|
|
143
|
+
|
|
144
|
+
#### The idea of Dr. Dmitry Ignatov
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
Metadata-Version: 2.2
|
|
2
|
+
Name: lmur
|
|
3
|
+
Version: 1.0.4
|
|
4
|
+
Summary: Neural Network Dataset
|
|
5
|
+
Home-page: https://ABrain.one
|
|
6
|
+
Author: ABrain One and contributors
|
|
7
|
+
Author-email: AI@ABrain.one
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
Requires-Dist: nn-dataset==1.0.4
|
|
15
|
+
Provides-Extra: stat
|
|
16
|
+
Requires-Dist: nn-stat; extra == "stat"
|
|
17
|
+
Dynamic: author
|
|
18
|
+
Dynamic: author-email
|
|
19
|
+
Dynamic: classifier
|
|
20
|
+
Dynamic: description
|
|
21
|
+
Dynamic: description-content-type
|
|
22
|
+
Dynamic: home-page
|
|
23
|
+
Dynamic: provides-extra
|
|
24
|
+
Dynamic: requires-dist
|
|
25
|
+
Dynamic: requires-python
|
|
26
|
+
Dynamic: summary
|
|
27
|
+
|
|
28
|
+
## <img src='https://abrain.one/img/lemur-nn-icon-64x64.png' width='32px'/> Neural Network Dataset
|
|
29
|
+
nn-dataset <a href='https://pypi.python.org/pypi/nn-dataset'><img src='https://img.shields.io/pypi/v/nn-dataset.svg'/></a> or lmur <a href='https://pypi.python.org/pypi/lmur'><img src='https://img.shields.io/pypi/v/lmur.svg'/></a>
|
|
30
|
+
|
|
31
|
+
LEMUR - Learning, Evaluation, and Modeling for Unified Research
|
|
32
|
+
|
|
33
|
+
<img src='https://abrain.one/img/lemur-nn-whit.jpg' width='25%'/>
|
|
34
|
+
|
|
35
|
+
The original version of the <a href='https://github.com/ABrain-One/nn-dataset'>LEMUR dataset</a> was created by <strong>Arash Torabi Goodarzi, Roman Kochnev</strong> and <strong>Zofia Antonina Bentyn</strong> at the Computer Vision Laboratory, University of Würzburg, Germany.
|
|
36
|
+
|
|
37
|
+
<h3>Overview 📖</h3>
|
|
38
|
+
The primary goal of NN Dataset project is to provide flexibility for dynamically combining various deep learing tasks, datasets, metrics, and neural network models. It is designed to facilitate the verification of neural network performance under various combinations of training hyperparameters and data transformation algorithms, by automatically generating performance statistics. It is primarily developed to support the <a href="https://github.com/ABrain-One/nn-gen">NN Gen</a> project.
|
|
39
|
+
|
|
40
|
+
## Installation or Update of the NN Dataset
|
|
41
|
+
Remove old version of the LEMUR Dataset and its database:
|
|
42
|
+
```bash
|
|
43
|
+
source .venv/bin/activate
|
|
44
|
+
pip uninstall nn-dataset -y
|
|
45
|
+
rm -rf db
|
|
46
|
+
```
|
|
47
|
+
Installing the stable version:
|
|
48
|
+
```bash
|
|
49
|
+
source .venv/bin/activate
|
|
50
|
+
pip install nn-dataset --upgrade --extra-index-url https://download.pytorch.org/whl/cu124
|
|
51
|
+
```
|
|
52
|
+
Installing from GitHub to get the most recent code and statistics updates:
|
|
53
|
+
```bash
|
|
54
|
+
source .venv/bin/activate
|
|
55
|
+
pip install git+https://github.com/ABrain-One/nn-dataset --upgrade --force --extra-index-url https://download.pytorch.org/whl/cu124
|
|
56
|
+
```
|
|
57
|
+
Adding functionality to export data to Excel files and generate plots for <a href='https://github.com/ABrain-One/nn-stat'>analyzing neural network performance</a>:
|
|
58
|
+
```bash
|
|
59
|
+
source .venv/bin/activate
|
|
60
|
+
pip install nn-stat --upgrade --extra-index-url https://download.pytorch.org/whl/cu124
|
|
61
|
+
```
|
|
62
|
+
and export/generate:
|
|
63
|
+
```bash
|
|
64
|
+
source .venv/bin/activate
|
|
65
|
+
python -m ab.stat.export
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
## Usage
|
|
69
|
+
|
|
70
|
+
Standard use cases:
|
|
71
|
+
1. Add a new neural network model into the `ab/nn/nn` directory.
|
|
72
|
+
2. Run the automated training process for this model (e.g., a new ComplexNet training pipeline configuration):
|
|
73
|
+
```bash
|
|
74
|
+
source .venv/bin/activate
|
|
75
|
+
python -m ab.nn.train -c img-classification_cifar-10_acc_ComplexNet
|
|
76
|
+
```
|
|
77
|
+
or for all image segmentation models using a fixed range of training parameters and transformer:
|
|
78
|
+
```bash
|
|
79
|
+
source .venv/bin/activate
|
|
80
|
+
python run.py -c img-segmentation -f echo --min_learning_rate 1e-4 -l 1e-2 --min_momentum 0.8 -m 0.99 --min_batch_binary_power 2 -b 6
|
|
81
|
+
```
|
|
82
|
+
To reproduce the previous result, set the minimum and maximum to the same desired values:
|
|
83
|
+
```bash
|
|
84
|
+
source .venv/bin/activate
|
|
85
|
+
python run.py -c img-classification_cifar-10_acc_AlexNet --min_learning_rate 0.0061 -l 0.0061 --min_momentum 0.7549 -m 0.7549 --min_batch_binary_power 2 -b 2 -f norm_299
|
|
86
|
+
```
|
|
87
|
+
To view supported flags:
|
|
88
|
+
```bash
|
|
89
|
+
python run.py -h
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
### Docker
|
|
93
|
+
All versions of this project are compatible with <a href='https://hub.docker.com/r/abrainone/ai-linux' target='_blank'>AI Linux</a> and can be run inside a Docker image:
|
|
94
|
+
```bash
|
|
95
|
+
docker run -v /a/mm:. abrainone/ai-linux bash -c "PYTHONPATH=/a/mm python -m ab.nn.train"
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Environment for NN Dataset Contributors
|
|
99
|
+
### Pip package manager
|
|
100
|
+
Create a virtual environment, activate it, and run the following command to install all the project dependencies:
|
|
101
|
+
```bash
|
|
102
|
+
source .venv/bin/activate
|
|
103
|
+
python -m pip install --upgrade pip
|
|
104
|
+
pip install -r requirements.txt --extra-index-url https://download.pytorch.org/whl/cu124
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
## Contribution
|
|
108
|
+
|
|
109
|
+
To contribute a new neural network (NN) model to the NN Dataset, please ensure the following criteria are met:
|
|
110
|
+
|
|
111
|
+
1. The code for each model is provided in a respective ".py" file within the <strong>/ab/nn/nn</strong> directory, and the file is named after the name of the model's structure.
|
|
112
|
+
2. The main class for each model is named <strong>Net</strong>.
|
|
113
|
+
3. The constructor of the <strong>Net</strong> class takes the following parameters:
|
|
114
|
+
- <strong>in_shape</strong> (tuple): The shape of the first tensor from the dataset iterator. For images it is structured as `(batch, channel, height, width)`.
|
|
115
|
+
- <strong>out_shape</strong> (tuple): Provided by the dataset loader, it describes the shape of the output tensor. For a classification task, this could be `(number of classes,)`.
|
|
116
|
+
- <strong>prm</strong> (dict): A dictionary of hyperparameters, e.g., `{'lr': 0.24, 'momentum': 0.93, 'dropout': 0.51}`.
|
|
117
|
+
- <strong>device</strong> (torch.device): PyTorch device used for the model training
|
|
118
|
+
4. All external information required for the correct building and training of the NN model for a specific dataset/transformer, as well as the list of hyperparameters, is extracted from <strong>in_shape</strong>, <strong>out_shape</strong> or <strong>prm</strong>, e.g.: </br>`batch = in_shape[0]` </br>`channel_number = in_shape[1]` </br>`image_size = in_shape[2]` </br>`class_number = out_shape[0]` </br>`learning_rate = prm['lr']` </br>`momentum = prm['momentum']` </br>`dropout = prm['dropout']`.
|
|
119
|
+
5. Every model script has function returning set of supported hyperparameters, e.g.: </br>`def supported_hyperparameters(): return {'lr', 'momentum', 'dropout'}`</br> The value of each hyperparameter lies within the range of 0.0 to 1.0.
|
|
120
|
+
6. Every class <strong>Net</strong> implements two functions: </br>`train_setup(self, prm)`</br> and </br>`learn(self, train_data)`</br> The first function initializes the `criteria` and `optimizer`, while the second implements the training pipeline. See a simple implementation in the <a href="https://github.com/ABrain-One/nn-dataset/blob/main/ab/nn/nn/AlexNet.py">AlexNet model</a>.
|
|
121
|
+
7. For each pull request involving a new NN model, please generate and submit training statistics for 100 Optuna trials (or at least 3 trials for very large models) in the <strong>ab/nn/stat</strong> directory. The trials should cover 5 epochs of training. Ensure that this statistics is included along with the model in your pull request. For example, the statistics for the ComplexNet model are stored in files <strong><epoch number>.json</strong> inside folder <strong>img-classification_cifar-10_acc_ComplexNet</strong>, and can be generated by:<br/>
|
|
122
|
+
```bash
|
|
123
|
+
python run.py -c img-classification_cifar-10_acc_ComplexNet -t 100 -e 5
|
|
124
|
+
```
|
|
125
|
+
<p>See more examples of models in <code>/ab/nn/nn</code> and generated statistics in <code>/ab/nn/stat</code>.</p>
|
|
126
|
+
|
|
127
|
+
### Available Modules
|
|
128
|
+
|
|
129
|
+
The `nn-dataset` package includes the following key modules:
|
|
130
|
+
|
|
131
|
+
1. **Dataset**:
|
|
132
|
+
- Predefined neural network architectures such as `AlexNet`, `ResNet`, `VGG`, and more.
|
|
133
|
+
- Located in `ab.nn.nn`.
|
|
134
|
+
|
|
135
|
+
2. **Loaders**:
|
|
136
|
+
- Data loaders for datasets such as CIFAR-10 and COCO.
|
|
137
|
+
- Located in `ab.nn.loader`.
|
|
138
|
+
|
|
139
|
+
3. **Metrics**:
|
|
140
|
+
- Common evaluation metrics like accuracy and IoU.
|
|
141
|
+
- Located in `ab.nn.metric`.
|
|
142
|
+
|
|
143
|
+
4. **Utilities**:
|
|
144
|
+
- Helper functions for training and statistical analysis.
|
|
145
|
+
- Located in `ab.nn.util`.
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
## Citation
|
|
149
|
+
|
|
150
|
+
If you find the LEMUR Neural Network Dataset to be useful for your research, please consider citing:
|
|
151
|
+
```bibtex
|
|
152
|
+
@misc{ABrain-One.NN-Dataset,
|
|
153
|
+
author = {Goodarzi, Arash Torabi and Kochnev, Roman and Khalid, Waleed and Qin, Furui and Kathiriya, Yash Kanubhai and Dhameliya, Yashkumar Sanjaybhai and Ignatov, Dmitry and Timofte, Radu},
|
|
154
|
+
title = {Neural Network Dataset: Towards Seamless AutoML},
|
|
155
|
+
howpublished = {\url{https://github.com/ABrain-One/nn-dataset}},
|
|
156
|
+
year = {2024},
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
## Licenses
|
|
161
|
+
|
|
162
|
+
This project is distributed under the following licensing terms:
|
|
163
|
+
<ul><li>for neural network models adopted from other projects
|
|
164
|
+
<ul>
|
|
165
|
+
<li> Python code under the legacy <a href="https://github.com/ABrain-One/nn-dataset/blob/main/Doc/Licenses/LICENSE-MIT-NNs">MIT</a> or <a href="https://github.com/ABrain-One/nn-dataset/blob/main/Doc/Licenses/LICENSE-BSD-NNs">BSD 3-Clause</a> license</li>
|
|
166
|
+
<li> models with pretrained weights under the legacy <a href="https://github.com/ABrain-One/nn-dataset/blob/main/Doc/Licenses/LICENSE-DEEPSEEK-LLM-V2">DeepSeek LLM V2</a> license</li>
|
|
167
|
+
</ul></li>
|
|
168
|
+
<li> all neural network models and their weights not covered by the above licenses, as well as all other files and assets in this project, are subject to the <a href="https://github.com/ABrain-One/nn-dataset/blob/main/LICENSE">MIT license</a></li>
|
|
169
|
+
</ul>
|
|
170
|
+
|
|
171
|
+
#### The idea of Dr. Dmitry Ignatov
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
nn-dataset==1.0.4
|
lmur-1.0.4/setup.cfg
ADDED
lmur-1.0.4/setup.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
from setuptools import setup, find_packages
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
import subprocess
|
|
4
|
+
import sys
|
|
5
|
+
|
|
6
|
+
# Function to read the requirements.txt file
|
|
7
|
+
def read_requirements():
|
|
8
|
+
with open("requirements.txt", "r") as f:
|
|
9
|
+
return [line.strip() for line in f if line.strip() and not line.startswith("#")]
|
|
10
|
+
|
|
11
|
+
# Safely read the README.md file
|
|
12
|
+
def read_readme():
|
|
13
|
+
readme_path = Path(__file__).parent / "README.md"
|
|
14
|
+
if readme_path.exists():
|
|
15
|
+
return readme_path.read_text(encoding="utf-8")
|
|
16
|
+
return ""
|
|
17
|
+
|
|
18
|
+
def version():
|
|
19
|
+
with open(Path(__file__).parent / 'version', 'r') as file:
|
|
20
|
+
v = file.readline()
|
|
21
|
+
return v
|
|
22
|
+
|
|
23
|
+
setup(
|
|
24
|
+
name="lmur",
|
|
25
|
+
version=version(),
|
|
26
|
+
description="Neural Network Dataset",
|
|
27
|
+
long_description=read_readme(),
|
|
28
|
+
long_description_content_type="text/markdown",
|
|
29
|
+
author="ABrain One and contributors",
|
|
30
|
+
author_email="AI@ABrain.one",
|
|
31
|
+
url="https://ABrain.one",
|
|
32
|
+
packages=find_packages(include=["ab.*"]),
|
|
33
|
+
install_requires=read_requirements(),
|
|
34
|
+
extras_require = {'stat': ['nn-stat']},
|
|
35
|
+
classifiers=[
|
|
36
|
+
"Programming Language :: Python :: 3",
|
|
37
|
+
"License :: OSI Approved :: MIT License",
|
|
38
|
+
"Operating System :: OS Independent",
|
|
39
|
+
],
|
|
40
|
+
python_requires=">=3.10",
|
|
41
|
+
include_package_data=True,
|
|
42
|
+
)
|
|
43
|
+
|
lmur-1.0.4/version
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1.0.4
|