uniovi-simur-wearablepermed-ml 1.1.0__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.
Potentially problematic release.
This version of uniovi-simur-wearablepermed-ml might be problematic. Click here for more details.
- uniovi_simur_wearablepermed_ml-1.1.0.dist-info/METADATA +411 -0
- uniovi_simur_wearablepermed_ml-1.1.0.dist-info/RECORD +19 -0
- uniovi_simur_wearablepermed_ml-1.1.0.dist-info/WHEEL +5 -0
- uniovi_simur_wearablepermed_ml-1.1.0.dist-info/entry_points.txt +3 -0
- uniovi_simur_wearablepermed_ml-1.1.0.dist-info/licenses/LICENSE.txt +21 -0
- uniovi_simur_wearablepermed_ml-1.1.0.dist-info/top_level.txt +1 -0
- wearablepermed_ml/__init__.py +16 -0
- wearablepermed_ml/basic_functions/__init__.py +0 -0
- wearablepermed_ml/basic_functions/address.py +17 -0
- wearablepermed_ml/data/DataReader.py +388 -0
- wearablepermed_ml/data/__init__.py +1 -0
- wearablepermed_ml/models/SiMuR_Model.py +671 -0
- wearablepermed_ml/models/__init__.py +1 -0
- wearablepermed_ml/models/model_generator.py +63 -0
- wearablepermed_ml/run_trainer_and_tester_30_times.py +130 -0
- wearablepermed_ml/tester.py +156 -0
- wearablepermed_ml/testing/__init__.py +0 -0
- wearablepermed_ml/testing/testing.py +203 -0
- wearablepermed_ml/trainer.py +782 -0
|
@@ -0,0 +1,411 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: uniovi-simur-wearablepermed-ml
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Uniovi Simur WearablePerMed Machine Learning.
|
|
5
|
+
Home-page: https://github.com/Simur-project/uniovi-simur-wearablepermed-ml.git
|
|
6
|
+
Author: Miguel Salinas Gancedo
|
|
7
|
+
Author-email: masalinas.gancedo@gmail.com
|
|
8
|
+
License: MIT
|
|
9
|
+
Project-URL: Documentation, https://pyscaffold.org/
|
|
10
|
+
Platform: any
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Programming Language :: Python
|
|
13
|
+
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
|
|
14
|
+
License-File: LICENSE.txt
|
|
15
|
+
Requires-Dist: importlib-metadata; python_version < "3.8"
|
|
16
|
+
Requires-Dist: absl-py==2.3.0
|
|
17
|
+
Requires-Dist: alabaster==1.0.0
|
|
18
|
+
Requires-Dist: astunparse==1.6.3
|
|
19
|
+
Requires-Dist: attrs==25.3.0
|
|
20
|
+
Requires-Dist: babel==2.17.0
|
|
21
|
+
Requires-Dist: cachetools==6.0.0
|
|
22
|
+
Requires-Dist: certifi==2025.4.26
|
|
23
|
+
Requires-Dist: chardet==5.2.0
|
|
24
|
+
Requires-Dist: charset-normalizer==3.4.2
|
|
25
|
+
Requires-Dist: click==8.2.1
|
|
26
|
+
Requires-Dist: colorama==0.4.6
|
|
27
|
+
Requires-Dist: ConfigUpdater==3.2
|
|
28
|
+
Requires-Dist: contourpy==1.3.2
|
|
29
|
+
Requires-Dist: cycler==0.12.1
|
|
30
|
+
Requires-Dist: distlib==0.3.9
|
|
31
|
+
Requires-Dist: docutils==0.21.2
|
|
32
|
+
Requires-Dist: et_xmlfile==2.0.0
|
|
33
|
+
Requires-Dist: filelock==3.18.0
|
|
34
|
+
Requires-Dist: flatbuffers==25.2.10
|
|
35
|
+
Requires-Dist: fonttools==4.58.2
|
|
36
|
+
Requires-Dist: fsspec==2025.7.0
|
|
37
|
+
Requires-Dist: gast==0.6.0
|
|
38
|
+
Requires-Dist: google-pasta==0.2.0
|
|
39
|
+
Requires-Dist: grpcio==1.73.0
|
|
40
|
+
Requires-Dist: h5py==3.14.0
|
|
41
|
+
Requires-Dist: idna==3.10
|
|
42
|
+
Requires-Dist: imagesize==1.4.1
|
|
43
|
+
Requires-Dist: imbalanced-learn==0.13.0
|
|
44
|
+
Requires-Dist: imblearn==0.0
|
|
45
|
+
Requires-Dist: importlib_metadata==8.7.0
|
|
46
|
+
Requires-Dist: importlib_resources==6.5.2
|
|
47
|
+
Requires-Dist: Jinja2==3.1.6
|
|
48
|
+
Requires-Dist: joblib==1.5.1
|
|
49
|
+
Requires-Dist: jsonschema==4.25.0
|
|
50
|
+
Requires-Dist: jsonschema-specifications==2025.4.1
|
|
51
|
+
Requires-Dist: keras==3.10.0
|
|
52
|
+
Requires-Dist: keras-tuner==1.4.7
|
|
53
|
+
Requires-Dist: kiwisolver==1.4.8
|
|
54
|
+
Requires-Dist: kt-legacy==1.0.5
|
|
55
|
+
Requires-Dist: libclang==18.1.1
|
|
56
|
+
Requires-Dist: linkify-it-py==2.0.3
|
|
57
|
+
Requires-Dist: lxml==5.4.0
|
|
58
|
+
Requires-Dist: Markdown==3.8
|
|
59
|
+
Requires-Dist: markdown-it-py==3.0.0
|
|
60
|
+
Requires-Dist: MarkupSafe==3.0.2
|
|
61
|
+
Requires-Dist: matplotlib==3.10.3
|
|
62
|
+
Requires-Dist: mdit-py-plugins==0.4.2
|
|
63
|
+
Requires-Dist: mdurl==0.1.2
|
|
64
|
+
Requires-Dist: ml_dtypes==0.5.1
|
|
65
|
+
Requires-Dist: msgpack==1.1.1
|
|
66
|
+
Requires-Dist: myst-parser==4.0.1
|
|
67
|
+
Requires-Dist: namex==0.1.0
|
|
68
|
+
Requires-Dist: numpy==1.26.4
|
|
69
|
+
Requires-Dist: openpyxl==3.1.5
|
|
70
|
+
Requires-Dist: opt_einsum==3.4.0
|
|
71
|
+
Requires-Dist: optree==0.16.0
|
|
72
|
+
Requires-Dist: packaging==25.0
|
|
73
|
+
Requires-Dist: pandas==2.3.0
|
|
74
|
+
Requires-Dist: pandas-datareader==0.10.0
|
|
75
|
+
Requires-Dist: patsy==1.0.1
|
|
76
|
+
Requires-Dist: pillow==11.2.1
|
|
77
|
+
Requires-Dist: platformdirs==4.3.8
|
|
78
|
+
Requires-Dist: pluggy==1.6.0
|
|
79
|
+
Requires-Dist: protobuf==5.29.5
|
|
80
|
+
Requires-Dist: pur==7.3.3
|
|
81
|
+
Requires-Dist: pyarrow==21.0.0
|
|
82
|
+
Requires-Dist: Pygments==2.19.1
|
|
83
|
+
Requires-Dist: pyparsing==3.2.3
|
|
84
|
+
Requires-Dist: pyproject-api==1.9.1
|
|
85
|
+
Requires-Dist: PyScaffold==4.6
|
|
86
|
+
Requires-Dist: pyscaffoldext-markdown==0.5
|
|
87
|
+
Requires-Dist: python-dateutil==2.9.0.post0
|
|
88
|
+
Requires-Dist: pytz==2025.2
|
|
89
|
+
Requires-Dist: PyYAML==6.0.2
|
|
90
|
+
Requires-Dist: ray==2.48.0
|
|
91
|
+
Requires-Dist: referencing==0.36.2
|
|
92
|
+
Requires-Dist: requests==2.32.4
|
|
93
|
+
Requires-Dist: rich==14.0.0
|
|
94
|
+
Requires-Dist: roman-numerals-py==3.1.0
|
|
95
|
+
Requires-Dist: rpds-py==0.26.0
|
|
96
|
+
Requires-Dist: scikit-learn==1.6.1
|
|
97
|
+
Requires-Dist: scipy==1.16.2
|
|
98
|
+
Requires-Dist: seaborn==0.13.2
|
|
99
|
+
Requires-Dist: setuptools==80.9.0
|
|
100
|
+
Requires-Dist: setuptools-scm==8.3.1
|
|
101
|
+
Requires-Dist: six==1.17.0
|
|
102
|
+
Requires-Dist: sklearn-compat==0.1.3
|
|
103
|
+
Requires-Dist: snowballstemmer==3.0.1
|
|
104
|
+
Requires-Dist: Sphinx==8.2.3
|
|
105
|
+
Requires-Dist: sphinxcontrib-applehelp==2.0.0
|
|
106
|
+
Requires-Dist: sphinxcontrib-devhelp==2.0.0
|
|
107
|
+
Requires-Dist: sphinxcontrib-htmlhelp==2.1.0
|
|
108
|
+
Requires-Dist: sphinxcontrib-jsmath==1.0.1
|
|
109
|
+
Requires-Dist: sphinxcontrib-qthelp==2.0.0
|
|
110
|
+
Requires-Dist: sphinxcontrib-serializinghtml==2.0.0
|
|
111
|
+
Requires-Dist: statsmodels==0.14.4
|
|
112
|
+
Requires-Dist: tensorboard==2.19.0
|
|
113
|
+
Requires-Dist: tensorboard-data-server==0.7.2
|
|
114
|
+
Requires-Dist: tensorboardX==2.6.4
|
|
115
|
+
Requires-Dist: tensorflow==2.19.0
|
|
116
|
+
Requires-Dist: termcolor==3.1.0
|
|
117
|
+
Requires-Dist: tf_keras==2.19.0
|
|
118
|
+
Requires-Dist: threadpoolctl==3.6.0
|
|
119
|
+
Requires-Dist: tomli==2.2.1
|
|
120
|
+
Requires-Dist: tomlkit==0.13.3
|
|
121
|
+
Requires-Dist: tox==4.26.0
|
|
122
|
+
Requires-Dist: typing_extensions==4.14.0
|
|
123
|
+
Requires-Dist: tzdata==2025.2
|
|
124
|
+
Requires-Dist: uc-micro-py==1.0.3
|
|
125
|
+
Requires-Dist: urllib3==2.4.0
|
|
126
|
+
Requires-Dist: virtualenv==20.31.2
|
|
127
|
+
Requires-Dist: Werkzeug==3.1.3
|
|
128
|
+
Requires-Dist: wheel==0.45.1
|
|
129
|
+
Requires-Dist: wrapt==1.17.2
|
|
130
|
+
Requires-Dist: xgboost==2.0.3
|
|
131
|
+
Requires-Dist: zipp==3.23.0
|
|
132
|
+
Provides-Extra: testing
|
|
133
|
+
Requires-Dist: setuptools; extra == "testing"
|
|
134
|
+
Requires-Dist: pytest; extra == "testing"
|
|
135
|
+
Requires-Dist: pytest-cov; extra == "testing"
|
|
136
|
+
Dynamic: license-file
|
|
137
|
+
|
|
138
|
+
<!-- These are examples of badges you might want to add to your README:
|
|
139
|
+
please update the URLs accordingly
|
|
140
|
+
|
|
141
|
+
[](https://cirrus-ci.com/github/<USER>/uniovi-simur-wearablepermed-ml)
|
|
142
|
+
[](https://uniovi-simur-wearablepermed-ml.readthedocs.io/en/stable/)
|
|
143
|
+
[](https://coveralls.io/r/<USER>/uniovi-simur-wearablepermed-ml)
|
|
144
|
+
[](https://pypi.org/project/uniovi-simur-wearablepermed-ml/)
|
|
145
|
+
[](https://anaconda.org/conda-forge/uniovi-simur-wearablepermed-ml)
|
|
146
|
+
[](https://pepy.tech/project/uniovi-simur-wearablepermed-ml)
|
|
147
|
+
[](https://twitter.com/uniovi-simur-wearablepermed-ml)
|
|
148
|
+
-->
|
|
149
|
+
|
|
150
|
+
[](https://pyscaffold.org/)
|
|
151
|
+
|
|
152
|
+
# Description
|
|
153
|
+
|
|
154
|
+
> Uniovi Simur WearablePerMed Machine Learning.
|
|
155
|
+
|
|
156
|
+
*********************************************************************
|
|
157
|
+
* Pasos para lanzar el entrenamiento de un modelo de clasificación: *
|
|
158
|
+
*********************************************************************
|
|
159
|
+
|
|
160
|
+
1. Abrir el archivo "train_automatizado.py".
|
|
161
|
+
|
|
162
|
+
2. Entre las líneas 27 y 37, descomentar el modelo de clasificación que se desea entrenar. Comentamos
|
|
163
|
+
el resto de modelos. Para una misma clase de modelo tenemos 3 posibilidades, en función de si
|
|
164
|
+
empleamos datos de muslo, muñeca o muslo+muñeca durante el entrenamiento.
|
|
165
|
+
|
|
166
|
+
3. Ejecutar el archivo "train_automatizado.py". Este código ya empleará el resto de dependencias auxiliares:
|
|
167
|
+
Datareader, modelGenerator, etc.
|
|
168
|
+
|
|
169
|
+
Como resultado se guardará el modelo entrenado en formato ".h5" (para las CNNs) o ".pkl" (para RandomForest y XGBoost).
|
|
170
|
+
Estos modelos pueden cargarse para estudiar resultados en la fase de test mediante el fichero "scriptResults_v2.ipynb".
|
|
171
|
+
|
|
172
|
+
Fragmento del pipeline:
|
|
173
|
+
|
|
174
|
+
********************************** **********************************
|
|
175
|
+
* Stack de datos/características * -------> * Modelos de clasificación *
|
|
176
|
+
********************************** **********************************
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
-------------------------------------------------------
|
|
180
|
+
- Repositorio Machine Learning (desarrollosPMP_SiMuR) -
|
|
181
|
+
-------------------------------------------------------
|
|
182
|
+
|
|
183
|
+
Árbol de directorios:
|
|
184
|
+
|
|
185
|
+
/Raíz (desarrollosPMP_SiMuR)
|
|
186
|
+
|
|
|
187
|
+
…
|
|
188
|
+
|
|
|
189
|
+
|-- modelGenerator.py
|
|
190
|
+
|-- train_automatizado.py (PROGRAMA PRINCIPAL)
|
|
191
|
+
|-- Models
|
|
192
|
+
| |
|
|
193
|
+
| |-- SiMuRModel.py (Implementación de las clases, junto con sus métodos, asociada a cada modelo)
|
|
194
|
+
| |-- *.h5, *.pkl (Se generan tras entrenar cada modelo)
|
|
195
|
+
| |-- __init__.py
|
|
196
|
+
|
|
|
197
|
+
|-- scriptResults_v2.ipynb (Resultados en la etapa de test para los modelos entrenados)
|
|
198
|
+
|-- train_hyperparameter_searching_v2.py (Búsqueda de hiperparámetros óptimos de cada modelo, empleando
|
|
199
|
+
el algoritmo ASHA).
|
|
200
|
+
|
|
201
|
+
|
|
202
|
+
*******************************************
|
|
203
|
+
* Contenido de SiMuRModel.py *
|
|
204
|
+
*******************************************
|
|
205
|
+
|
|
206
|
+
1 clase para cada modelo de clasificación:
|
|
207
|
+
class SiMuRModel_ESANN (Red Neuronal Convolucional, CNN)
|
|
208
|
+
class SiMuRModel_CAPTURE24 (CNN de arquitectura más compleja)
|
|
209
|
+
class SiMuRModel_RandomForest (Balanced Random Forest)
|
|
210
|
+
class SiMuRModel_XGBoost <---- Tengo que actualizarlo en GitHub, lo tengo local en mi PC.
|
|
211
|
+
|
|
212
|
+
Cada modelo para datos de:
|
|
213
|
+
* thigh (muslo).
|
|
214
|
+
* wrist (muñeca).
|
|
215
|
+
* thigh + wrist (muslo + muñeca).
|
|
216
|
+
|
|
217
|
+
En "train_automatizado.py" se crea un objeto de cada clase y se lanza el entrenamiento del modelo
|
|
218
|
+
de clasificación.
|
|
219
|
+
|
|
220
|
+
<!-- pyscaffold-notes -->
|
|
221
|
+
|
|
222
|
+
## Scaffold your project from scratch
|
|
223
|
+
|
|
224
|
+
- **STEP01**: Install PyScaffold and pyscaffoldext-markdown extension
|
|
225
|
+
|
|
226
|
+
- You can install PyScaffold and extensions globally in your systems but ins recomendes use a virtual environment:
|
|
227
|
+
|
|
228
|
+
Craate a temp folder and use a virtual environment to install PyScaffold tool and scaffold your project. Later will copy the results under the final git folder and remove the last temporal one:
|
|
229
|
+
|
|
230
|
+
```
|
|
231
|
+
$ mkdir temp
|
|
232
|
+
$ cd temp
|
|
233
|
+
$ python3 -m venv .venv
|
|
234
|
+
$ source .venv/bin/activate
|
|
235
|
+
$ pip install pyscaffold
|
|
236
|
+
$ pip install pyscaffoldext-markdown
|
|
237
|
+
$ putup --markdown uniovi-simur-wearablepermed-ml -p wearablepermed_ml \
|
|
238
|
+
-d "Uniovi Simur WearablePerMed ML." \
|
|
239
|
+
-u https://github.com/Simur-project/uniovi-simur-wearablepermed-ml.git
|
|
240
|
+
$ deactivate
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
- Also you can install **pyscaffold** and **pyscaffoldext-markdown** packages in your system and avoid the error from Python 3.11+: ```"error-externally-managed-environment" this environemnt is externally managed``` you can execute this command to force instalation:
|
|
244
|
+
|
|
245
|
+
```
|
|
246
|
+
$ pip3 install pyscaffold --break-system-packages
|
|
247
|
+
$ pip3 install pyscaffoldext-markdown --break-system-packages
|
|
248
|
+
$ putup --markdown uniovi-simur-wearablepermed-ml -p wearablepermed_ml \
|
|
249
|
+
-d "Uniovi Simur WearablePerMed ML." \
|
|
250
|
+
-u https://github.com/Simur-project/uniovi-simur-wearablepermed-ml.git
|
|
251
|
+
```
|
|
252
|
+
|
|
253
|
+
or permanent configure pip3 with this command to avoid the previous errors from 3.11+
|
|
254
|
+
|
|
255
|
+
```
|
|
256
|
+
$ python3 -m pip config set global.break-system-packages true
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
- **STEP02**: creare your repo under SIMUR Organization with the name **uniovi-simur-wearablepermed-ml** and clone the previous scaffoled project
|
|
260
|
+
|
|
261
|
+
```
|
|
262
|
+
$ cd git
|
|
263
|
+
$ git clone https://github.com/Simur-project/uniovi-simur-wearablepermed-ml.git
|
|
264
|
+
```
|
|
265
|
+
|
|
266
|
+
- **STEP03**: copy PyScaffold project to your git folder without .venv folder
|
|
267
|
+
|
|
268
|
+
- **STEP04**: install tox project manager used by PyScaffold. Install project dependencies
|
|
269
|
+
```
|
|
270
|
+
$ python3 -m venv .venv
|
|
271
|
+
$ source .venv/bin/activate
|
|
272
|
+
$ pip install tox
|
|
273
|
+
$ pip install pandas
|
|
274
|
+
$ pip install matplotlib
|
|
275
|
+
$ pip install openpyxl
|
|
276
|
+
$ tox list
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Installation your python pipeline packages in your virtual environment in development mode:
|
|
280
|
+
|
|
281
|
+
```
|
|
282
|
+
$ pip freeze > requirements.txt
|
|
283
|
+
```
|
|
284
|
+
## Start develop your project
|
|
285
|
+
- **STEP01**: Clone your project
|
|
286
|
+
```
|
|
287
|
+
$ git clone https://github.com/Simur-project/uniovi-simur-wearablepermed-ml.git
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
- **STEP01**: Build and Debug your project
|
|
291
|
+
```
|
|
292
|
+
$ tox list
|
|
293
|
+
default environments:
|
|
294
|
+
default -> Invoke pytest to run automated tests
|
|
295
|
+
|
|
296
|
+
additional environments:
|
|
297
|
+
build -> Build the package in isolation according to PEP517, see https://github.com/pypa/build
|
|
298
|
+
clean -> Remove old distribution files and temporary build artifacts (./build and ./dist)
|
|
299
|
+
docs -> Invoke sphinx-build to build the docs
|
|
300
|
+
doctests -> Invoke sphinx-build to run doctests
|
|
301
|
+
linkcheck -> Check for broken links in the documentation
|
|
302
|
+
publish -> Publish the package you have been developing to a package index server. By default, it uses testpypi. If you really want to publish your package to be publicly accessible in PyPI, use the `-- --repository pypi` option
|
|
303
|
+
```
|
|
304
|
+
|
|
305
|
+
```
|
|
306
|
+
$ tox -e clean
|
|
307
|
+
$ tox -e build
|
|
308
|
+
$ tox -e docs
|
|
309
|
+
```
|
|
310
|
+
|
|
311
|
+
- **STEP02 Build service**
|
|
312
|
+
```
|
|
313
|
+
$ docker build -t uniovi-simur-wearablepermed-ml:1.0.0 .
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
- **STEP03: Tag service**
|
|
317
|
+
```
|
|
318
|
+
$ docker tag uniovi-simur-wearablepermed-ml:1.0.0 ofertoio/uniovi-simur-wearablepermed-ml:1.0.0
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
- **STEP04: Publish service**
|
|
322
|
+
```
|
|
323
|
+
$ docker logout
|
|
324
|
+
$ docker login
|
|
325
|
+
$ docker push ofertoio/uniovi-simur-wearablepermed-ml:1.0.0
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
## Using GPU
|
|
329
|
+
Follow these steps to use GPU from your python script:
|
|
330
|
+
|
|
331
|
+
- **STEP01: Install NVIDIA Drivers**
|
|
332
|
+
Install NVIDIA Drivers for your card, in our case: NVIDIA GeForce RTX 4060 Ti card
|
|
333
|
+
|
|
334
|
+
- **STEP02: Install CUDA Toolkit**
|
|
335
|
+
```
|
|
336
|
+
$ sudo apt-get install -y nvidia-cuda-toolkit
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
Get CUDA version installed:
|
|
340
|
+
|
|
341
|
+
```
|
|
342
|
+
$ nvcc --version
|
|
343
|
+
nvcc: NVIDIA (R) Cuda compiler driver
|
|
344
|
+
Copyright (c) 2005-2023 NVIDIA Corporation
|
|
345
|
+
Built on Fri_Jan__6_16:45:21_PST_2023
|
|
346
|
+
Cuda compilation tools, release 12.0, V12.0.140
|
|
347
|
+
Build cuda_12.0.r12.0/compiler.32267302_0
|
|
348
|
+
```
|
|
349
|
+
|
|
350
|
+
- **STEP03: Install cuDNN**
|
|
351
|
+
|
|
352
|
+
Install cuDNN for DeepLearning from python compatible with your CUDA version:
|
|
353
|
+
|
|
354
|
+
```
|
|
355
|
+
wget https://developer.download.nvidia.com/compute/cudnn/9.10.2/local_installers/cudnn-local-repo-ubuntu2404-9.10.2_1.0-1_amd64.deb
|
|
356
|
+
sudo dpkg -i cudnn-local-repo-ubuntu2404-9.10.2_1.0-1_amd64.deb
|
|
357
|
+
sudo cp /var/cudnn-local-repo-ubuntu2404-9.10.2/cudnn-*-keyring.gpg /usr/share/keyrings/
|
|
358
|
+
sudo apt-get update
|
|
359
|
+
sudo apt-get -y install cudnn
|
|
360
|
+
```
|
|
361
|
+
|
|
362
|
+
Install CUDA 12 from aptitude, perform the above configuration but install the CUDA 12 specific package:
|
|
363
|
+
|
|
364
|
+
```
|
|
365
|
+
sudo apt-get -y install cudnn-cuda-12
|
|
366
|
+
```
|
|
367
|
+
|
|
368
|
+
Check cuDNN installed:
|
|
369
|
+
```
|
|
370
|
+
$ dpkg -l | grep libcudnn
|
|
371
|
+
ii libcudnn9-cuda-12 9.10.2.21-1 amd64 cuDNN runtime libraries for CUDA 12.9
|
|
372
|
+
ii libcudnn9-dev-cuda-12 9.10.2.21-1 amd64 cuDNN development libraries for CUDA 12.9
|
|
373
|
+
ii libcudnn9-headers-cuda-12 9.10.2.21-1 amd64 cuDNN header files for CUDA 12.9
|
|
374
|
+
ii libcudnn9-static-cuda-12 9.10.2.21-1 amd64 cuDNN static libraries for CUDA 12.9
|
|
375
|
+
```
|
|
376
|
+
|
|
377
|
+
- **STEP04: Configure CUDA environment**
|
|
378
|
+
Create a file called **cuda_env.sh** with these env variables configurations:
|
|
379
|
+
|
|
380
|
+
```
|
|
381
|
+
export CUDA_HOME=/usr/lib/nvidia-cuda-toolkit
|
|
382
|
+
export PATH=$CUDA_HOME/bin:$PATH
|
|
383
|
+
export LD_LIBRARY_PATH=$CUDA_HOME/compute-sanitizer:$LD_LIBRARY_PATH
|
|
384
|
+
export XLA_FLAGS=--xla_gpu_cuda_data_dir=/usr/lib/cuda
|
|
385
|
+
```
|
|
386
|
+
|
|
387
|
+
make executable the **cuda_env.sh** file:
|
|
388
|
+
|
|
389
|
+
```
|
|
390
|
+
$ chmod +x cuda_env.sh
|
|
391
|
+
```
|
|
392
|
+
|
|
393
|
+
Move the file to profile.d folder, to have these env variables globally, for any user server sessions
|
|
394
|
+
```
|
|
395
|
+
$ sudo mv cuda_env.sh /etc/profile.d/
|
|
396
|
+
```
|
|
397
|
+
|
|
398
|
+
- **STEP05: Relogin a session**
|
|
399
|
+
You must logout and login again using your accout to have access to CUDA env variables. Check it:
|
|
400
|
+
|
|
401
|
+
```
|
|
402
|
+
echo $CUDA_HOME
|
|
403
|
+
echo $PATH
|
|
404
|
+
echo $LD_LIBRARY_PATH
|
|
405
|
+
echo $XLA_FLAGS
|
|
406
|
+
```
|
|
407
|
+
|
|
408
|
+
## Note
|
|
409
|
+
|
|
410
|
+
This project has been set up using PyScaffold 4.6. For details and usage
|
|
411
|
+
information on PyScaffold see https://pyscaffold.org/.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
uniovi_simur_wearablepermed_ml-1.1.0.dist-info/licenses/LICENSE.txt,sha256=MJSf2LY2uh50n0Y7vPzbMcIfTXiY_IvEp7dQMhSHBWo,1089
|
|
2
|
+
wearablepermed_ml/__init__.py,sha256=Jl6IIVd6LQLVAQG-uKC7nnY2204vk_YrBMz3bC4JxvU,601
|
|
3
|
+
wearablepermed_ml/run_trainer_and_tester_30_times.py,sha256=6k7Sl6FAFhdYTQgM1MigUNXo5kAtYGAtZlTvXFd7oT8,8690
|
|
4
|
+
wearablepermed_ml/tester.py,sha256=1Ac2l8MypZJTf1xl866G4dllH7r60iDWTBNMHieW40I,4346
|
|
5
|
+
wearablepermed_ml/trainer.py,sha256=zoglrCPToTyQBEDPZ39rbmglnvjQcHghH2qX1lrEFRc,43621
|
|
6
|
+
wearablepermed_ml/basic_functions/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
|
+
wearablepermed_ml/basic_functions/address.py,sha256=VYAvZLqyd4DvX2bYUJI5fnepKPMaI4CY7uiaeCsNauM,664
|
|
8
|
+
wearablepermed_ml/data/DataReader.py,sha256=Bd1AqSytx0AXx1S_C9osk9I205vXdoNYP6IZctDSOmw,18476
|
|
9
|
+
wearablepermed_ml/data/__init__.py,sha256=V0piawbJbkBykxziMrDr0W8KloG6TUyWhj_QDhlZDqw,34
|
|
10
|
+
wearablepermed_ml/models/SiMuR_Model.py,sha256=WXAkvFhOhLkzgCjiwkmT4X9693-zlolnhsBepNCXarc,30346
|
|
11
|
+
wearablepermed_ml/models/__init__.py,sha256=HkTS7w1Mpj0TP7ACtgcKv2gZEVYDNqAectiwGBI_Mmo,108
|
|
12
|
+
wearablepermed_ml/models/model_generator.py,sha256=r23ahAE-otf0OGt_keD77dIb2-x9KN2ZP_e9ZhGEukk,1852
|
|
13
|
+
wearablepermed_ml/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
|
+
wearablepermed_ml/testing/testing.py,sha256=Uiq8AolTgbR2wcV12pUygSv3T8Y38hdpVC2yKoz04Ks,9927
|
|
15
|
+
uniovi_simur_wearablepermed_ml-1.1.0.dist-info/METADATA,sha256=-g_EosjeCgXKo6h132EKu177_cDmv7q1d-cnwvNJVS0,15626
|
|
16
|
+
uniovi_simur_wearablepermed_ml-1.1.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
17
|
+
uniovi_simur_wearablepermed_ml-1.1.0.dist-info/entry_points.txt,sha256=BW3Dw-fW_hquNHbK1q7pUNgIGwRDMPHqs9znQE6SECM,96
|
|
18
|
+
uniovi_simur_wearablepermed_ml-1.1.0.dist-info/top_level.txt,sha256=PK7Cm_vvudFpRS-vGYiQDsZLkFZ6mdaocJqSPXHMP4c,18
|
|
19
|
+
uniovi_simur_wearablepermed_ml-1.1.0.dist-info/RECORD,,
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
The MIT License (MIT)
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Miguel Salinas Gancedo
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
wearablepermed_ml
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import sys
|
|
2
|
+
|
|
3
|
+
if sys.version_info[:2] >= (3, 8):
|
|
4
|
+
# TODO: Import directly (no need for conditional) when `python_requires = >= 3.8`
|
|
5
|
+
from importlib.metadata import PackageNotFoundError, version # pragma: no cover
|
|
6
|
+
else:
|
|
7
|
+
from importlib_metadata import PackageNotFoundError, version # pragma: no cover
|
|
8
|
+
|
|
9
|
+
try:
|
|
10
|
+
# Change here if project is renamed and does not equal the package name
|
|
11
|
+
dist_name = "uniovi-simur-wearablepermed-ml"
|
|
12
|
+
__version__ = version(dist_name)
|
|
13
|
+
except PackageNotFoundError: # pragma: no cover
|
|
14
|
+
__version__ = "unknown"
|
|
15
|
+
finally:
|
|
16
|
+
del version, PackageNotFoundError
|
|
File without changes
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import os
|
|
2
|
+
|
|
3
|
+
path_here = os.path.abspath('')
|
|
4
|
+
dataset_dir = str(path_here)+'/Data/'
|
|
5
|
+
results_grid_search = str(path_here)+'/Results/Params/'
|
|
6
|
+
path_results_metrics = str(path_here)+'/Results/'
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
def get_param_path(modelID):
|
|
10
|
+
return os.path.join(results_grid_search,modelID+'.csv')
|
|
11
|
+
|
|
12
|
+
def get_model_path(modelID, args):
|
|
13
|
+
path_models = os.path.join(args.case_id_folder, args.case_id)
|
|
14
|
+
if modelID == 'SiMuRModel_RandomForest_data_tot' or modelID == 'SiMuRModel_RandomForest_data_thigh' or modelID == 'SiMuRModel_RandomForest_data_wrist':
|
|
15
|
+
return os.path.join(path_models,modelID+'.pkl')
|
|
16
|
+
else:
|
|
17
|
+
return os.path.join(path_models,modelID+'.weights.h5')
|