pyerualjetwork 5.0.1__py3-none-any.whl → 5.0.2b1__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.
- pyerualjetwork/__init__.py +5 -5
- pyerualjetwork/{data_operations.py → data_operations_cpu.py} +3 -3
- pyerualjetwork/data_operations_cuda.py +1 -1
- pyerualjetwork/{ene.py → ene_cpu.py} +6 -6
- pyerualjetwork/ene_cuda.py +1 -1
- pyerualjetwork/fitness_functions.py +2 -1
- pyerualjetwork/help.py +1 -1
- pyerualjetwork/issue_solver.py +77 -0
- pyerualjetwork/{metrics.py → metrics_cpu.py} +1 -1
- pyerualjetwork/metrics_cuda.py +1 -1
- pyerualjetwork/{model_operations.py → model_operations_cpu.py} +54 -10
- pyerualjetwork/model_operations_cuda.py +47 -3
- pyerualjetwork/{neu.py → neu_cpu.py} +11 -11
- pyerualjetwork/neu_cuda.py +1 -1
- pyerualjetwork/{visualizations.py → visualizations_cpu.py} +10 -10
- {pyerualjetwork-5.0.1.dist-info → pyerualjetwork-5.0.2b1.dist-info}/METADATA +12 -6
- pyerualjetwork-5.0.2b1.dist-info/RECORD +26 -0
- pyerualjetwork-5.0.1.dist-info/RECORD +0 -25
- /pyerualjetwork/{activation_functions.py → activation_functions_cpu.py} +0 -0
- /pyerualjetwork/{loss_functions.py → loss_functions_cpu.py} +0 -0
- {pyerualjetwork-5.0.1.dist-info → pyerualjetwork-5.0.2b1.dist-info}/WHEEL +0 -0
- {pyerualjetwork-5.0.1.dist-info → pyerualjetwork-5.0.2b1.dist-info}/top_level.txt +0 -0
pyerualjetwork/__init__.py
CHANGED
@@ -11,10 +11,10 @@ training, and both detailed and simplified memory management.
|
|
11
11
|
|
12
12
|
Library (CPU) Main Modules:
|
13
13
|
---------------------------
|
14
|
-
-
|
15
|
-
-
|
16
|
-
-
|
17
|
-
-
|
14
|
+
- neu_cpu
|
15
|
+
- ene_cpu
|
16
|
+
- data_operations_cpu
|
17
|
+
- model_operations_cpu
|
18
18
|
|
19
19
|
Library (GPU) Main Modules:
|
20
20
|
---------------------------
|
@@ -38,7 +38,7 @@ PyerualJetwork document: https://github.com/HCB06/PyerualJetwork/blob/main/Welco
|
|
38
38
|
- Contact: tchasancan@gmail.com
|
39
39
|
"""
|
40
40
|
|
41
|
-
__version__ = "5.0.
|
41
|
+
__version__ = "5.0.2b1"
|
42
42
|
__update__ = """* Changes: https://github.com/HCB06/PyerualJetwork/blob/main/CHANGES
|
43
43
|
* PyerualJetwork Homepage: https://github.com/HCB06/PyerualJetwork/tree/main
|
44
44
|
* PyerualJetwork document: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PyerualJetwork/PYERUALJETWORK_USER_MANUEL_AND_LEGAL_INFORMATION(EN).pdf
|
@@ -1,9 +1,9 @@
|
|
1
1
|
"""
|
2
2
|
|
3
3
|
|
4
|
-
Data Operations
|
5
|
-
|
6
|
-
This module contains functions for handling all operational processes related to data and datasets.
|
4
|
+
Data Operations on CPU
|
5
|
+
======================
|
6
|
+
This module contains functions for handling all operational processes related to data and datasets on CPU memory(RAM).
|
7
7
|
|
8
8
|
Module functions:
|
9
9
|
-----------------
|
@@ -3,7 +3,7 @@
|
|
3
3
|
|
4
4
|
Data Operations on GPU (CUDA)
|
5
5
|
=============================
|
6
|
-
This module contains functions for handling all operational processes related to data and datasets on GPU memory.
|
6
|
+
This module contains functions for handling all operational processes related to data and datasets on CUDA GPU memory(VRAM).
|
7
7
|
|
8
8
|
Module functions:
|
9
9
|
---------------
|
@@ -1,10 +1,10 @@
|
|
1
1
|
"""
|
2
2
|
|
3
3
|
|
4
|
-
ENE (Eugenic NeuroEvolution)
|
5
|
-
|
4
|
+
ENE (Eugenic NeuroEvolution) on CPU
|
5
|
+
===================================
|
6
6
|
|
7
|
-
This module contains all the functions necessary for implementing and testing the ENE (Eugenic NeuroEvolution) algorithm.
|
7
|
+
This module contains all the functions necessary for implementing and testing the ENE (Eugenic NeuroEvolution) algorithm on CPU.
|
8
8
|
For more information about the ENE algorithm: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PLAN/PLAN.pdf
|
9
9
|
|
10
10
|
Module functions:
|
@@ -34,9 +34,9 @@ import math
|
|
34
34
|
import copy
|
35
35
|
|
36
36
|
### LIBRARY IMPORTS ###
|
37
|
-
from .
|
37
|
+
from .data_operations_cpu import normalization, non_neg_normalization
|
38
38
|
from .ui import loading_bars, initialize_loading_bar
|
39
|
-
from .
|
39
|
+
from .activation_functions_cpu import apply_activation, all_activations
|
40
40
|
|
41
41
|
def define_genomes(input_shape, output_shape, population_size, neurons=[], activation_functions=[], dtype=np.float32):
|
42
42
|
"""
|
@@ -280,7 +280,7 @@ def evolver(weights,
|
|
280
280
|
|
281
281
|
Example:
|
282
282
|
```python
|
283
|
-
weights, activations =
|
283
|
+
weights, activations = ene_cpu.evolver(weights, activations, 1, fitness, show_info=True, strategy='normal_selective', policy='aggressive')
|
284
284
|
```
|
285
285
|
|
286
286
|
- The function returns the updated weights and activations after processing based on the chosen strategy, policy, and mutation parameters.
|
pyerualjetwork/ene_cuda.py
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
|
4
4
|
ENE (Eugenic NeuroEvolution) on CUDA
|
5
|
-
|
5
|
+
====================================
|
6
6
|
|
7
7
|
This module contains all the functions necessary for implementing and testing the ENE (Eugenic NeuroEvolution) algorithm on CUDA GPU.
|
8
8
|
For more information about the ENE algorithm: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PLAN/PLAN.pdf
|
@@ -13,4 +13,5 @@ def wals(acc, loss, acc_impact, loss_impact):
|
|
13
13
|
loss += np.finfo(float).eps
|
14
14
|
loss_impact += np.finfo(float).eps
|
15
15
|
|
16
|
-
return (acc * acc_impact) + ((loss_impact / loss) * loss_impact)
|
16
|
+
return (acc * acc_impact) + ((loss_impact / loss) * loss_impact)
|
17
|
+
import __init__
|
pyerualjetwork/help.py
CHANGED
@@ -0,0 +1,77 @@
|
|
1
|
+
"""
|
2
|
+
|
3
|
+
|
4
|
+
Issue Solver
|
5
|
+
============
|
6
|
+
This module provides ready-to-use functions to identify potential issues caused by version incompatibilities in major updates,
|
7
|
+
ensuring users are not affected by such problems. PyereualJetwork aims to offer a seamless experience for its users.
|
8
|
+
|
9
|
+
|
10
|
+
Module functions:
|
11
|
+
-----------------
|
12
|
+
- update_model_to_v5()
|
13
|
+
|
14
|
+
Examples: https://github.com/HCB06/PyerualJetwork/tree/main/Welcome_to_PyerualJetwork/ExampleCodes
|
15
|
+
|
16
|
+
PyerualJetwork document: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PyerualJetwork/PYERUALJETWORK_USER_MANUEL_AND_LEGAL_INFORMATION(EN).pdf
|
17
|
+
|
18
|
+
- Author: Hasan Can Beydili
|
19
|
+
- YouTube: https://www.youtube.com/@HasanCanBeydili
|
20
|
+
- Linkedin: https://www.linkedin.com/in/hasan-can-beydili-77a1b9270/
|
21
|
+
- Instagram: https://www.instagram.com/canbeydilj
|
22
|
+
- Contact: tchasancan@gmail.com
|
23
|
+
"""
|
24
|
+
|
25
|
+
def update_model_to_v5(model_name, model_path, is_cuda):
|
26
|
+
|
27
|
+
"""
|
28
|
+
update_model_to_v5 function helps users for update models from older versions to newer versions.
|
29
|
+
|
30
|
+
:param str model_name: Name of saved model.
|
31
|
+
|
32
|
+
:param str model_path: Path of saved model.
|
33
|
+
|
34
|
+
:param bool is_cuda: If model saved with cuda modules.
|
35
|
+
|
36
|
+
:return: prints terminal if succes.
|
37
|
+
"""
|
38
|
+
|
39
|
+
if is_cuda:
|
40
|
+
|
41
|
+
from .model_operations_cuda import (get_act,
|
42
|
+
get_weights,
|
43
|
+
get_scaler,
|
44
|
+
get_acc,
|
45
|
+
get_model_type,
|
46
|
+
get_weights_type,
|
47
|
+
get_weights_format,
|
48
|
+
load_model,
|
49
|
+
save_model)
|
50
|
+
else:
|
51
|
+
|
52
|
+
from .model_operations_cpu import (get_act,
|
53
|
+
get_weights,
|
54
|
+
get_scaler,
|
55
|
+
get_acc,
|
56
|
+
get_model_type,
|
57
|
+
get_weights_type,
|
58
|
+
get_weights_format,
|
59
|
+
load_model,
|
60
|
+
save_model)
|
61
|
+
|
62
|
+
model = load_model(model_name, model_path)
|
63
|
+
|
64
|
+
activations = model[get_act()]
|
65
|
+
weights = model[get_weights()]
|
66
|
+
scaler_params = model[get_scaler()]
|
67
|
+
test_acc = model[get_acc()]
|
68
|
+
model_type = model[get_model_type()]
|
69
|
+
weights_type = model[get_weights_type()]
|
70
|
+
weights_format = model[get_weights_format()]
|
71
|
+
|
72
|
+
from .__init__ import __version__
|
73
|
+
device_version = __version__
|
74
|
+
|
75
|
+
save_model("updated_" + model_name, weights, model_type, scaler_params, test_acc, model_path, activations, weights_type, weights_format)
|
76
|
+
|
77
|
+
print(f"\nModel succesfully updated to {device_version}. NOTE: This operation just for compatibility. You may still have perfomance issuesi in this situation please install model's version of pyerualjetwork.")
|
@@ -13,7 +13,7 @@ def metrics(y_ts, test_preds, average='weighted'):
|
|
13
13
|
tuple: Precision, recall, F1 score.
|
14
14
|
"""
|
15
15
|
|
16
|
-
from .
|
16
|
+
from .data_operations_cpu import decode_one_hot
|
17
17
|
|
18
18
|
y_test_d = decode_one_hot(y_ts)
|
19
19
|
y_test_d = np.array(y_test_d)
|
pyerualjetwork/metrics_cuda.py
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
"""
|
2
2
|
|
3
3
|
|
4
|
-
Model Operations
|
5
|
-
|
6
|
-
This module hosts functions for handling all operational processes related to models, including:
|
4
|
+
Model Operations on CPU
|
5
|
+
=======================
|
6
|
+
This module hosts functions for handling all operational processes related to models on CPU, including:
|
7
7
|
|
8
8
|
- Saving and loading models
|
9
9
|
- Making predictions from memory
|
@@ -92,7 +92,7 @@ def save_model(model_name,
|
|
92
92
|
No return.
|
93
93
|
"""
|
94
94
|
|
95
|
-
from .
|
95
|
+
from .visualizations_cpu import draw_model_architecture
|
96
96
|
|
97
97
|
if model_type != 'PLAN' and model_type != 'MLP':
|
98
98
|
raise ValueError("model_type parameter must be 'PLAN' or 'MLP'.")
|
@@ -176,11 +176,14 @@ def save_model(model_name,
|
|
176
176
|
|
177
177
|
scaler_params.append(' ')
|
178
178
|
|
179
|
+
from .__init__ import __version__
|
180
|
+
|
179
181
|
data = {'MODEL NAME': model_name,
|
180
182
|
'MODEL TYPE': model_type,
|
181
183
|
'CLASS COUNT': class_count,
|
182
184
|
'NEURON COUNT': NeuronCount,
|
183
185
|
'SYNAPSE COUNT': SynapseCount,
|
186
|
+
'VERSION': __version__,
|
184
187
|
'TEST ACCURACY': test_acc,
|
185
188
|
'SAVE DATE': datetime.now(),
|
186
189
|
'WEIGHTS TYPE': weights_type,
|
@@ -305,6 +308,24 @@ def load_model(model_name,
|
|
305
308
|
model_name = str(df['MODEL NAME'].iloc[0])
|
306
309
|
model_type = str(df['MODEL TYPE'].iloc[0])
|
307
310
|
WeightType = str(df['WEIGHTS TYPE'].iloc[0])
|
311
|
+
WeightFormat = str(df['WEIGHTS FORMAT'].iloc[0])
|
312
|
+
test_acc = str(df['TEST ACCURACY'].iloc[0])
|
313
|
+
|
314
|
+
from .__init__ import __version__
|
315
|
+
|
316
|
+
device_version = __version__
|
317
|
+
|
318
|
+
try:
|
319
|
+
model_version = str(df['VERSION'].iloc[0])
|
320
|
+
if model_version != device_version:
|
321
|
+
message = (
|
322
|
+
Fore.MAGENTA + f"WARNING: Your PyerualJetwork version({device_version}) is different from this model's version({model_version}).\nIf you have a performance issue, please install this model version. Use this: pip install pyerualjetwork=={model_version} or look issue_solver module." +
|
323
|
+
Style.RESET_ALL
|
324
|
+
)
|
325
|
+
print(message)
|
326
|
+
|
327
|
+
except:
|
328
|
+
pass # Version check only in >= 5.0.2
|
308
329
|
|
309
330
|
if model_type == 'MLP': allow_pickle = True
|
310
331
|
else: allow_pickle = False
|
@@ -326,7 +347,7 @@ def load_model(model_name,
|
|
326
347
|
if WeightType == 'mat':
|
327
348
|
W = W['w']
|
328
349
|
|
329
|
-
return W, None,
|
350
|
+
return W, None, test_acc, activations, scaler_params, None, model_type, WeightType, WeightFormat, device_version, df
|
330
351
|
|
331
352
|
|
332
353
|
|
@@ -347,8 +368,8 @@ def predict_from_storage(Input, model_name, model_path=''):
|
|
347
368
|
ndarray: Output from the model.
|
348
369
|
"""
|
349
370
|
|
350
|
-
from .
|
351
|
-
from .
|
371
|
+
from .activation_functions_cpu import apply_activation
|
372
|
+
from .data_operations_cpu import standard_scaler
|
352
373
|
|
353
374
|
try:
|
354
375
|
|
@@ -436,8 +457,8 @@ def predict_from_memory(Input, W, scaler_params=None, activations=['linear'], is
|
|
436
457
|
ndarray: Output from the model.
|
437
458
|
"""
|
438
459
|
|
439
|
-
from .
|
440
|
-
from .
|
460
|
+
from .data_operations_cpu import standard_scaler
|
461
|
+
from .activation_functions_cpu import apply_activation
|
441
462
|
|
442
463
|
try:
|
443
464
|
|
@@ -516,9 +537,32 @@ def get_scaler():
|
|
516
537
|
|
517
538
|
return 4
|
518
539
|
|
540
|
+
|
519
541
|
def get_preds_softmax():
|
520
542
|
|
521
543
|
return 5
|
522
544
|
|
545
|
+
|
523
546
|
def get_model_type():
|
524
|
-
|
547
|
+
|
548
|
+
return 6
|
549
|
+
|
550
|
+
|
551
|
+
def get_weights_type():
|
552
|
+
|
553
|
+
return 7
|
554
|
+
|
555
|
+
|
556
|
+
def get_weights_format():
|
557
|
+
|
558
|
+
return 8
|
559
|
+
|
560
|
+
|
561
|
+
def get_model_version():
|
562
|
+
|
563
|
+
return 9
|
564
|
+
|
565
|
+
|
566
|
+
def get_model_df():
|
567
|
+
|
568
|
+
return 10
|
@@ -60,7 +60,7 @@ def save_model(model_name,
|
|
60
60
|
activations=['linear'],
|
61
61
|
weights_type='npy',
|
62
62
|
weights_format='raw',
|
63
|
-
show_architecture=
|
63
|
+
show_architecture=False,
|
64
64
|
show_info=True
|
65
65
|
):
|
66
66
|
|
@@ -192,12 +192,15 @@ def save_model(model_name,
|
|
192
192
|
scaler_params[0] = scaler_params[0].get()
|
193
193
|
scaler_params[1] = scaler_params[1].get()
|
194
194
|
|
195
|
+
from .__init__ import __version__
|
196
|
+
|
195
197
|
data = {'MODEL NAME': model_name,
|
196
198
|
'MODEL TYPE': model_type,
|
197
199
|
'CLASS COUNT': class_count,
|
198
200
|
'NEURON COUNT': NeuronCount,
|
199
201
|
'SYNAPSE COUNT': SynapseCount,
|
200
202
|
'TEST ACCURACY': test_acc,
|
203
|
+
'VERSION': __version__,
|
201
204
|
'SAVE DATE': datetime.now(),
|
202
205
|
'WEIGHTS TYPE': weights_type,
|
203
206
|
'WEIGHTS FORMAT': weights_format,
|
@@ -318,6 +321,24 @@ def load_model(model_name,
|
|
318
321
|
model_name = str(df['MODEL NAME'].iloc[0])
|
319
322
|
model_type = str(df['MODEL TYPE'].iloc[0])
|
320
323
|
WeightType = str(df['WEIGHTS TYPE'].iloc[0])
|
324
|
+
WeightFormat = str(df['WEIGHTS FORMAT'].iloc[0])
|
325
|
+
test_acc = str(df['TEST ACCURACY'].iloc[0])
|
326
|
+
|
327
|
+
from .__init__ import __version__
|
328
|
+
|
329
|
+
device_version = __version__
|
330
|
+
|
331
|
+
try:
|
332
|
+
model_version = str(df['VERSION'].iloc[0])
|
333
|
+
if model_version != device_version:
|
334
|
+
message = (
|
335
|
+
Fore.MAGENTA + f"WARNING: Your PyerualJetwork version({device_version}) is different from this model's version({model_version}).\nIf you have a performance issue, please install this model version. Use this: pip install pyerualjetwork=={model_version}" +
|
336
|
+
Style.RESET_ALL
|
337
|
+
)
|
338
|
+
print(message)
|
339
|
+
|
340
|
+
except:
|
341
|
+
pass # Version check only in >= 5.0.2
|
321
342
|
|
322
343
|
if model_type == 'MLP': allow_pickle = True
|
323
344
|
else: allow_pickle = False
|
@@ -343,7 +364,7 @@ def load_model(model_name,
|
|
343
364
|
W = W.tolist()
|
344
365
|
W = [cp.array(item) for item in W]
|
345
366
|
|
346
|
-
return W, None,
|
367
|
+
return W, None, test_acc, activations, scaler_params, None, model_type, WeightType, WeightFormat, device_version, df
|
347
368
|
|
348
369
|
|
349
370
|
|
@@ -545,9 +566,32 @@ def get_scaler():
|
|
545
566
|
|
546
567
|
return 4
|
547
568
|
|
569
|
+
|
548
570
|
def get_preds_softmax():
|
549
571
|
|
550
572
|
return 5
|
551
573
|
|
574
|
+
|
552
575
|
def get_model_type():
|
553
|
-
|
576
|
+
|
577
|
+
return 6
|
578
|
+
|
579
|
+
|
580
|
+
def get_weights_type():
|
581
|
+
|
582
|
+
return 7
|
583
|
+
|
584
|
+
|
585
|
+
def get_weights_format():
|
586
|
+
|
587
|
+
return 8
|
588
|
+
|
589
|
+
|
590
|
+
def get_model_version():
|
591
|
+
|
592
|
+
return 9
|
593
|
+
|
594
|
+
|
595
|
+
def get_model_df():
|
596
|
+
|
597
|
+
return 10
|
@@ -2,9 +2,9 @@
|
|
2
2
|
"""
|
3
3
|
|
4
4
|
|
5
|
-
NEU (Neural Networks)
|
6
|
-
|
7
|
-
This module hosts functions for training and evaluating artificial neural networks for labeled classification tasks (for now).
|
5
|
+
NEU (Neural Networks) on CPU
|
6
|
+
============================
|
7
|
+
This module hosts functions for training and evaluating artificial neural networks on CPU for labeled classification tasks (for now).
|
8
8
|
|
9
9
|
Currently, two types of models can be trained:
|
10
10
|
|
@@ -35,13 +35,13 @@ import copy
|
|
35
35
|
|
36
36
|
### LIBRARY IMPORTS ###
|
37
37
|
from .ui import loading_bars, initialize_loading_bar
|
38
|
-
from .
|
39
|
-
from .
|
40
|
-
from .
|
38
|
+
from .data_operations_cpu import normalization, batcher
|
39
|
+
from .activation_functions_cpu import apply_activation, all_activations
|
40
|
+
from .model_operations_cpu import get_acc, get_preds_softmax
|
41
41
|
from .memory_operations import optimize_labels
|
42
|
-
from .
|
42
|
+
from .loss_functions_cpu import categorical_crossentropy, binary_crossentropy
|
43
43
|
from .fitness_functions import wals
|
44
|
-
from .
|
44
|
+
from .visualizations_cpu import (
|
45
45
|
draw_neural_web,
|
46
46
|
display_visualizations_for_learner,
|
47
47
|
update_history_plots_for_learner,
|
@@ -116,13 +116,13 @@ def learn(x_train, y_train, optimizer, fit_start=True, gen=None, batch_size=1, p
|
|
116
116
|
:param y_train: (array-like): Labels for training data. one-hot encoded.
|
117
117
|
:param optimizer: (function): Optimization technique with hyperparameters. (PLAN and MLP (both) using ENE for optimization.) Please use this: from pyerualjetwork.ene import evolver (and) optimizer = lambda *args, **kwargs: evolver(*args, 'here give your neat hyperparameters for example: activation_add_prob=0.85', **kwargs) Example:
|
118
118
|
```python
|
119
|
-
optimizer = lambda *args, **kwargs:
|
119
|
+
optimizer = lambda *args, **kwargs: ene_cpu.evolver(*args,
|
120
120
|
activation_add_prob=0.05,
|
121
121
|
strategy='aggressive',
|
122
122
|
policy='more_selective',
|
123
123
|
**kwargs)
|
124
124
|
|
125
|
-
model =
|
125
|
+
model = neu_cpu.learn(x_train,
|
126
126
|
y_train,
|
127
127
|
optimizer,
|
128
128
|
fit_start=True,
|
@@ -158,7 +158,7 @@ def learn(x_train, y_train, optimizer, fit_start=True, gen=None, batch_size=1, p
|
|
158
158
|
tuple: A list for model parameters: [Weight matrix, Train Preds, Train Accuracy, [Activations functions]].
|
159
159
|
"""
|
160
160
|
|
161
|
-
from .
|
161
|
+
from .ene_cpu import define_genomes
|
162
162
|
|
163
163
|
data = 'Train'
|
164
164
|
|
pyerualjetwork/neu_cuda.py
CHANGED
@@ -179,7 +179,7 @@ def learn(x_train, y_train, optimizer, fit_start=True, gen=None, batch_size=1, p
|
|
179
179
|
x_train = transfer_to_cpu(x_train, dtype=x_train.dtype)
|
180
180
|
y_train = transfer_to_cpu(y_train, dtype=y_train.dtype)
|
181
181
|
|
182
|
-
from .
|
182
|
+
from .data_operations_cpu import batcher
|
183
183
|
|
184
184
|
else:
|
185
185
|
raise ValueError("memory parameter must be 'cpu' or 'gpu'.")
|
@@ -86,7 +86,7 @@ def draw_model_architecture(model_name, model_path=''):
|
|
86
86
|
Visualizes the architecture of a neural network model with multiple inputs based on activation functions.
|
87
87
|
"""
|
88
88
|
|
89
|
-
from .
|
89
|
+
from .model_operations_cpu import load_model, get_scaler, get_act, get_weights
|
90
90
|
|
91
91
|
model = load_model(model_name=model_name, model_path=model_path)
|
92
92
|
|
@@ -182,7 +182,7 @@ def draw_model_architecture(model_name, model_path=''):
|
|
182
182
|
|
183
183
|
def draw_activations(x_train, activation):
|
184
184
|
|
185
|
-
from . import
|
185
|
+
from . import activation_functions_cpu as af
|
186
186
|
|
187
187
|
if activation == 'sigmoid':
|
188
188
|
result = af.Sigmoid(x_train)
|
@@ -327,10 +327,10 @@ def draw_activations(x_train, activation):
|
|
327
327
|
|
328
328
|
def plot_evaluate(x_test, y_test, y_preds, acc_list, W, activations):
|
329
329
|
|
330
|
-
from .
|
330
|
+
from .metrics_cpu import metrics, confusion_matrix, roc_curve
|
331
331
|
from .ui import loading_bars, initialize_loading_bar
|
332
|
-
from .
|
333
|
-
from .
|
332
|
+
from .data_operations_cpu import decode_one_hot
|
333
|
+
from .model_operations_cpu import predict_model_ram
|
334
334
|
|
335
335
|
bar_format_normal = loading_bars()[0]
|
336
336
|
|
@@ -455,8 +455,8 @@ def plot_evaluate(x_test, y_test, y_preds, acc_list, W, activations):
|
|
455
455
|
|
456
456
|
def plot_decision_boundary(x, y, activations, W, artist=None, ax=None):
|
457
457
|
|
458
|
-
from .
|
459
|
-
from .
|
458
|
+
from .model_operations_cpu import predict_model_ram
|
459
|
+
from .data_operations_cpu import decode_one_hot
|
460
460
|
|
461
461
|
feature_indices = [0, 1]
|
462
462
|
|
@@ -513,8 +513,8 @@ def plot_decision_boundary(x, y, activations, W, artist=None, ax=None):
|
|
513
513
|
|
514
514
|
def plot_decision_space(x, y, y_preds=None, s=100, color='tab20'):
|
515
515
|
|
516
|
-
from .
|
517
|
-
from .
|
516
|
+
from .metrics_cpu import pca
|
517
|
+
from .data_operations_cpu import decode_one_hot
|
518
518
|
|
519
519
|
if x.shape[1] > 2:
|
520
520
|
|
@@ -707,7 +707,7 @@ def show():
|
|
707
707
|
|
708
708
|
def initialize_visualization_for_learner(show_history, neurons_history, neural_web_history, x_train, y_train):
|
709
709
|
|
710
|
-
from .
|
710
|
+
from .data_operations_cpu import find_closest_factors
|
711
711
|
viz_objects = {}
|
712
712
|
|
713
713
|
if show_history:
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyerualjetwork
|
3
|
-
Version: 5.0.
|
3
|
+
Version: 5.0.2b1
|
4
4
|
Summary: PyereualJetwork is a GPU-accelerated machine learning library in Python for professionals and researchers. It features PLAN, MLP, Deep Learning training, and ENE (Eugenic NeuroEvolution) for genetic optimization, applicable to genetic algorithms or Reinforcement Learning (RL). The library includes data pre-processing, visualizations, model saving/loading, prediction, evaluation, training, and detailed or simplified memory management.
|
5
5
|
Author: Hasan Can Beydili
|
6
6
|
Author-email: tchasancan@gmail.com
|
@@ -26,16 +26,22 @@ YouTube Tutorials: https://www.youtube.com/watch?v=6wMQstZ00is&list=PLNgNWpM7Hbs
|
|
26
26
|
|
27
27
|
pip install pyerualjetwork
|
28
28
|
|
29
|
-
from pyerualjetwork import
|
30
|
-
from pyerualjetwork import
|
31
|
-
from pyerualjetwork import
|
32
|
-
from pyerualjetwork import
|
29
|
+
from pyerualjetwork import neu_cpu
|
30
|
+
from pyerualjetwork import ene_cpu
|
31
|
+
from pyerualjetwork import data_operations_cpu
|
32
|
+
from pyerualjetwork import model_operations_cpu
|
33
33
|
|
34
34
|
from pyerualjetwork import neu_cuda
|
35
35
|
from pyerualjetwork import ene_cuda
|
36
36
|
from pyerualjetwork import data_operations_cuda
|
37
37
|
from pyerualjetwork import model_operations_cuda
|
38
38
|
|
39
|
+
PyerualJetwork has Issue Solver. This operation provides users ready-to-use functions to identify potential issues
|
40
|
+
caused by version incompatibilities in major updates, ensuring users are not affected by such problems.
|
41
|
+
PyereualJetwork aims to offer a seamless experience for its users.
|
42
|
+
|
43
|
+
from pyerualjetwork import issue_solver
|
44
|
+
|
39
45
|
Optimized for Visual Studio Code
|
40
46
|
|
41
47
|
requires=[
|
@@ -116,6 +122,6 @@ HOW DO I IMPORT IT TO MY PROJECT?
|
|
116
122
|
|
117
123
|
Anaconda users can access the 'Anaconda Prompt' terminal from the Start menu and add the necessary library modules to the Python module search queue by typing "pip install pyerualjetwork" and pressing enter. If you are not using Anaconda, you can simply open the 'cmd' Windows command terminal from the Start menu and type "pip install PyerualJetwork". (Visual Studio Code reccomended) After installation, it's important to periodically open the terminal of the environment you are using and stay up to date by using the command "pip install PyerualJetwork --upgrade".
|
118
124
|
|
119
|
-
After installing the module using "pip" you can now call the library module in your project environment. Use: “from pyerualjetwork import
|
125
|
+
After installing the module using "pip" you can now call the library module in your project environment. Use: “from pyerualjetwork import neu_cpu”. Now, you can call the necessary functions from the neu module.
|
120
126
|
|
121
127
|
The PLAN algorithm & ENE algorithm will not be explained in this document. This document focuses on how professionals can integrate and use PyerualJetwork in their systems. However, briefly, the PLAN algorithm can be described as a classification algorithm. PLAN algorithm achieves this task with an incredibly energy-efficient, fast, and hyperparameter-free user-friendly approach. For more detailed information, you can check out .pdf) file.
|
@@ -0,0 +1,26 @@
|
|
1
|
+
pyerualjetwork/__init__.py,sha256=aoCNbl9z-1Ef506udIAw1B-oRxYyRyH8XA_NP-WFHY0,2672
|
2
|
+
pyerualjetwork/activation_functions_cpu.py,sha256=X7Kv8qv8oZq8hvTdUiV-GkFjKHRlKIQypRPXh6gdkm4,7614
|
3
|
+
pyerualjetwork/activation_functions_cuda.py,sha256=pefklsl9QuSVbKwiUUHeF_ExN0bICH7QIF1MfoMU40Q,7665
|
4
|
+
pyerualjetwork/data_operations_cpu.py,sha256=dLczgxNx8W_GIgBLageegVhv-aczjNYfohB-PPpOU4Y,16401
|
5
|
+
pyerualjetwork/data_operations_cuda.py,sha256=5zgyJGPjQuHyx6IHNkRwMguYhm-GcI6Hal49WNvw-bM,18536
|
6
|
+
pyerualjetwork/ene_cpu.py,sha256=2y5__d-vx7t5Ajs4IPuNnQe8ULR39Km_KQFNIUnalGA,45167
|
7
|
+
pyerualjetwork/ene_cuda.py,sha256=0tOIONUEDmvGZiCihzIHBrGVtRMPR1g23ZNfoI0i39s,45663
|
8
|
+
pyerualjetwork/fitness_functions.py,sha256=pUmAbUy5ex1Vpu6n_RRac_df-FR52gYIV8uxYS5H3tw,1252
|
9
|
+
pyerualjetwork/help.py,sha256=FcX8mxo1_mvoqONVXY0Kn7S09CDkhi0jwNmn8g9mYZc,804
|
10
|
+
pyerualjetwork/issue_solver.py,sha256=_sMlNu6bS1sXZsJkD_eynLULApM8eWmPZJ0Jk1EKttg,3119
|
11
|
+
pyerualjetwork/loss_functions_cpu.py,sha256=6PyBI232SQRGuFnG3LDGvnv_PUdWzT2_2mUODJiejGI,618
|
12
|
+
pyerualjetwork/loss_functions_cuda.py,sha256=C93IZJcrOpT6HMK9x1O4AHJWXYTkN5WZiqdssPbvAPk,617
|
13
|
+
pyerualjetwork/memory_operations.py,sha256=g24d-cDuUFc0fOEtk3AJe-z_EBctYV5S4cY1rQ6VGiE,14279
|
14
|
+
pyerualjetwork/metrics_cpu.py,sha256=vbfMwS0ay2heMSa0GNo-ydLjQ8cfexbLwaREp4FKAtY,6081
|
15
|
+
pyerualjetwork/metrics_cuda.py,sha256=PWyJyexeqlPKb09LAcF55JvhZVeXLCu3P_siYq5m2gg,5065
|
16
|
+
pyerualjetwork/model_operations_cpu.py,sha256=BeUu_NW5YYWPKRmpm-BgdJZIKuX_KTCI_pVIJBtiuXQ,17115
|
17
|
+
pyerualjetwork/model_operations_cuda.py,sha256=dLxN6ITHDaLR--Mau-xzAXJ8bO_7Jh2sST-NVD9hWtE,18282
|
18
|
+
pyerualjetwork/neu_cpu.py,sha256=5K9oDNiTH6rVyOYo-2esw8ZLJ6M7-YLfiOyq_a9LBQU,25017
|
19
|
+
pyerualjetwork/neu_cuda.py,sha256=VS9YVsYe0DLaqGDCrKyVnYXehu8eE7qZycdaUHCyyM0,26030
|
20
|
+
pyerualjetwork/ui.py,sha256=JBTFYz5R24XwNKhA3GSW-oYAoiIBxAE3kFGXkvm5gqw,656
|
21
|
+
pyerualjetwork/visualizations_cpu.py,sha256=StyD1Hl1Gt55EMqR6tO3yVJZdPyGkOgCnQ75Zn8K6J8,28252
|
22
|
+
pyerualjetwork/visualizations_cuda.py,sha256=7lYrkOdrjwQGB3T4k_vI8UDxsm_TRjzaSSg9GhlNczs,28667
|
23
|
+
pyerualjetwork-5.0.2b1.dist-info/METADATA,sha256=T0SlZ2k6mIO1XgIz9w5RwNdxrvIioVZnVsVYEcuHZyQ,8128
|
24
|
+
pyerualjetwork-5.0.2b1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
25
|
+
pyerualjetwork-5.0.2b1.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
|
26
|
+
pyerualjetwork-5.0.2b1.dist-info/RECORD,,
|
@@ -1,25 +0,0 @@
|
|
1
|
-
pyerualjetwork/__init__.py,sha256=87_g-q7oZp-mgXR0fs3ysjwb1mkCALYL74DgP2xCeSc,2654
|
2
|
-
pyerualjetwork/activation_functions.py,sha256=X7Kv8qv8oZq8hvTdUiV-GkFjKHRlKIQypRPXh6gdkm4,7614
|
3
|
-
pyerualjetwork/activation_functions_cuda.py,sha256=pefklsl9QuSVbKwiUUHeF_ExN0bICH7QIF1MfoMU40Q,7665
|
4
|
-
pyerualjetwork/data_operations.py,sha256=m0Z42_czpou460XQB83E76z9bCjM78ewxS-jelezZ_M,16368
|
5
|
-
pyerualjetwork/data_operations_cuda.py,sha256=7p_v0yabHwq5Ft0jxWGEq1ZKyBFxOxvZvtPQjkcligk,18525
|
6
|
-
pyerualjetwork/ene.py,sha256=2HVHLlvkKH2xQlZ_apN8hHP4Gulj8uLxjTw2kgGu6IM,45134
|
7
|
-
pyerualjetwork/ene_cuda.py,sha256=n1rGQnvR0rY-fXnXOfY1o4cfc4mianzUUmwEaxl9j2o,45665
|
8
|
-
pyerualjetwork/fitness_functions.py,sha256=urRdeMvUhNgWxD4ZGHCRdQlIf9cTWYMvF3_aVBojRqY,1235
|
9
|
-
pyerualjetwork/help.py,sha256=F1xDDKqHGeUIXM-mo5c0Eav5XidCVNc62LvXqwS2Zbs,785
|
10
|
-
pyerualjetwork/loss_functions.py,sha256=6PyBI232SQRGuFnG3LDGvnv_PUdWzT2_2mUODJiejGI,618
|
11
|
-
pyerualjetwork/loss_functions_cuda.py,sha256=C93IZJcrOpT6HMK9x1O4AHJWXYTkN5WZiqdssPbvAPk,617
|
12
|
-
pyerualjetwork/memory_operations.py,sha256=g24d-cDuUFc0fOEtk3AJe-z_EBctYV5S4cY1rQ6VGiE,14279
|
13
|
-
pyerualjetwork/metrics.py,sha256=q7MkhnZDRbCjFBDDfUgrl8lBYnUT_1ro1LxeBq105pI,6077
|
14
|
-
pyerualjetwork/metrics_cuda.py,sha256=73h9GC7XwmnFCVzFEEiPQfF8CwHIz2wsCbxpZrJtYgw,5061
|
15
|
-
pyerualjetwork/model_operations.py,sha256=XYhyeDKLOD-j2E1R5Bm57Xx0XC0FBoHsxQVlbnB0rj4,15992
|
16
|
-
pyerualjetwork/model_operations_cuda.py,sha256=aGHET1sYBJLYYhY6rdE-8jgCSKcsDh0G7W0W0bZcGfU,17227
|
17
|
-
pyerualjetwork/neu.py,sha256=LtuEaLl-c97zex508P7NQr9vYNKsT2X6hDTYegcbKLg,24964
|
18
|
-
pyerualjetwork/neu_cuda.py,sha256=aIiCxlbKfvCJHuTcoucKn0KmkEJi6MvWNy6_9SIj4Ms,26026
|
19
|
-
pyerualjetwork/ui.py,sha256=JBTFYz5R24XwNKhA3GSW-oYAoiIBxAE3kFGXkvm5gqw,656
|
20
|
-
pyerualjetwork/visualizations.py,sha256=4DpboCi1GnJjKRVQ0RdGyQyHagZQTLUbCgSI7UHzd6o,28212
|
21
|
-
pyerualjetwork/visualizations_cuda.py,sha256=7lYrkOdrjwQGB3T4k_vI8UDxsm_TRjzaSSg9GhlNczs,28667
|
22
|
-
pyerualjetwork-5.0.1.dist-info/METADATA,sha256=ueF_wlZUAgYQx76slwpnZviz4y5-WkdyhPOIDTYA8F0,7764
|
23
|
-
pyerualjetwork-5.0.1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
24
|
-
pyerualjetwork-5.0.1.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
|
25
|
-
pyerualjetwork-5.0.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|