lmur 1.0.4__py3-none-any.whl

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.
@@ -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.
@@ -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>&#x003C;epoch number&#x003E;.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,5 @@
1
+ lmur-1.0.4.dist-info/LICENSE,sha256=vwgbuMjj85Gfn2o4Iax-QO8tw2wm10awp4PbfG3xryI,1106
2
+ lmur-1.0.4.dist-info/METADATA,sha256=lDvyI_eL-sbPiIvHbWMKEbIZcBN_OIJxdjxFlEyVh_s,9370
3
+ lmur-1.0.4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
4
+ lmur-1.0.4.dist-info/top_level.txt,sha256=AbpHGcgLb-kRsJGnwFEktk7uzpZOCcBY74-YBdrKVGs,1
5
+ lmur-1.0.4.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (75.8.0)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+