pyerualjetwork 5.1__py3-none-any.whl → 5.21__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 +1 -1
- pyerualjetwork/activation_functions_cuda.py +2 -1
- pyerualjetwork/fitness_functions.py +0 -1
- pyerualjetwork/model_operations_cuda.py +27 -32
- pyerualjetwork/neu_cpu.py +1 -1
- {pyerualjetwork-5.1.dist-info → pyerualjetwork-5.21.dist-info}/METADATA +1 -1
- {pyerualjetwork-5.1.dist-info → pyerualjetwork-5.21.dist-info}/RECORD +9 -9
- {pyerualjetwork-5.1.dist-info → pyerualjetwork-5.21.dist-info}/WHEEL +0 -0
- {pyerualjetwork-5.1.dist-info → pyerualjetwork-5.21.dist-info}/top_level.txt +0 -0
pyerualjetwork/__init__.py
CHANGED
@@ -42,7 +42,7 @@ PyerualJetwork document: https://github.com/HCB06/PyerualJetwork/blob/main/Welco
|
|
42
42
|
- Contact: tchasancan@gmail.com
|
43
43
|
"""
|
44
44
|
|
45
|
-
__version__ = "5.
|
45
|
+
__version__ = "5.21"
|
46
46
|
__update__ = """* Changes: https://github.com/HCB06/PyerualJetwork/blob/main/CHANGES
|
47
47
|
* PyerualJetwork Homepage: https://github.com/HCB06/PyerualJetwork/tree/main
|
48
48
|
* PyerualJetwork document: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PyerualJetwork/PYERUALJETWORK_USER_MANUEL_AND_LEGAL_INFORMATION(EN).pdf
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import cupy as cp
|
2
|
+
import numpy as np
|
2
3
|
from scipy.special import expit, softmax
|
3
4
|
import warnings
|
4
5
|
|
@@ -202,7 +203,7 @@ def apply_activation(Input, activation_list):
|
|
202
203
|
try:
|
203
204
|
|
204
205
|
valid_mask = cp.array([act in activation_functions for act in activation_list])
|
205
|
-
valid_activations =
|
206
|
+
valid_activations = np.array(activation_list)[valid_mask.get()]
|
206
207
|
|
207
208
|
activation_outputs = cp.array([activation_functions[act](origin_input) for act in valid_activations])
|
208
209
|
|
@@ -536,51 +536,46 @@ def predict_from_memory(Input, W, scaler_params=None, activations=['linear'], ac
|
|
536
536
|
from .data_operations_cuda import standard_scaler
|
537
537
|
from .activation_functions_cuda import apply_activation
|
538
538
|
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
elif isinstance(activations, list):
|
544
|
-
activations = [item if isinstance(item, list) or isinstance(item, str) else [item] for item in activations]
|
539
|
+
if isinstance(activations, str):
|
540
|
+
activations = [activations]
|
541
|
+
elif isinstance(activations, list):
|
542
|
+
activations = [item if isinstance(item, list) or isinstance(item, str) else [item] for item in activations]
|
545
543
|
|
546
|
-
|
544
|
+
Input = standard_scaler(None, Input, scaler_params)
|
547
545
|
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
546
|
+
if model_type == 'MLP':
|
547
|
+
layer = Input
|
548
|
+
for i in range(len(W)):
|
549
|
+
if i != len(W) - 1 and i != 0: layer = apply_activation(layer, activations[i])
|
552
550
|
|
553
|
-
|
551
|
+
layer = layer @ W[i].T
|
554
552
|
|
555
|
-
|
553
|
+
result = layer
|
556
554
|
|
557
|
-
|
555
|
+
if model_type == 'PLAN':
|
558
556
|
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
557
|
+
Input = apply_activation(Input, activations)
|
558
|
+
result = Input @ W.T
|
559
|
+
|
560
|
+
if model_type == 'PTNN':
|
563
561
|
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
562
|
+
if isinstance(activation_potentiation, str):
|
563
|
+
activation_potentiation = [activation_potentiation]
|
564
|
+
elif isinstance(activation_potentiation, list):
|
565
|
+
activation_potentiation = [item if isinstance(item, list) or isinstance(item, str) else [item] for item in activation_potentiation]
|
568
566
|
|
569
|
-
|
570
|
-
|
567
|
+
Input = apply_activation(Input, activation_potentiation)
|
568
|
+
layer = Input @ W[0].T
|
571
569
|
|
572
|
-
|
573
|
-
|
570
|
+
for i in range(1, len(W)):
|
571
|
+
if i != len(W) - 1: layer = apply_activation(layer, activations[i])
|
574
572
|
|
575
|
-
|
573
|
+
layer = layer @ W[i].T
|
576
574
|
|
577
|
-
|
575
|
+
result = layer
|
578
576
|
|
579
|
-
|
577
|
+
return result
|
580
578
|
|
581
|
-
except:
|
582
|
-
print(Fore.RED + "ERROR: Unexpected input or wrong model parameters from: predict_model_ram." + Style.RESET_ALL)
|
583
|
-
sys.exit()
|
584
579
|
|
585
580
|
|
586
581
|
def reverse_predict_from_memory(output, W, dtype=cp.float32):
|
pyerualjetwork/neu_cpu.py
CHANGED
@@ -135,7 +135,7 @@ def learn(x_train, y_train, optimizer, gen, pop_size, fit_start=True, batch_size
|
|
135
135
|
:Args:
|
136
136
|
:param x_train: (array-like): Training input data.
|
137
137
|
:param y_train: (array-like): Labels for training data. one-hot encoded.
|
138
|
-
:param optimizer: (function): Optimization technique with hyperparameters. (PLAN, MLP & PTNN (all) using ENE for optimization. Gradient based technique's will added in the future.) Please use this: from pyerualjetwork.ene_cpu import evolver (and) optimizer = lambda *args, **kwargs: evolver(*args, 'here give your
|
138
|
+
:param optimizer: (function): Optimization technique with hyperparameters. (PLAN, MLP & PTNN (all) using ENE for optimization. Gradient based technique's will added in the future.) Please use this: from pyerualjetwork.ene_cpu import evolver (and) optimizer = lambda *args, **kwargs: evolver(*args, 'here give your hyperparameters for example: activation_add_prob=0.85', **kwargs) Example:
|
139
139
|
```python
|
140
140
|
optimizer = lambda *args, **kwargs: ene_cpu.evolver(*args,
|
141
141
|
activation_add_prob=0.05,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyerualjetwork
|
3
|
-
Version: 5.
|
3
|
+
Version: 5.21
|
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
|
@@ -1,11 +1,11 @@
|
|
1
|
-
pyerualjetwork/__init__.py,sha256=
|
1
|
+
pyerualjetwork/__init__.py,sha256=OolhIDrjmWskLnJsciEgQ_KSOHxkk_Y0vUk_wYuA-jE,2733
|
2
2
|
pyerualjetwork/activation_functions_cpu.py,sha256=qP_Ipi2-c5tyJ7Jb9gWJZCj2AgeOIzLBdoEqQOUXD-s,5885
|
3
|
-
pyerualjetwork/activation_functions_cuda.py,sha256=
|
3
|
+
pyerualjetwork/activation_functions_cuda.py,sha256=7ZN54w4VP0MtFh0LjAUHsuPNgVOxrKeqEwa_zNbRp4g,5699
|
4
4
|
pyerualjetwork/data_operations_cpu.py,sha256=HemqiYfSdlQKTTYNzpCh_9lTtS3AimMI4DvqJBAGjGw,16186
|
5
5
|
pyerualjetwork/data_operations_cuda.py,sha256=5zgyJGPjQuHyx6IHNkRwMguYhm-GcI6Hal49WNvw-bM,18536
|
6
6
|
pyerualjetwork/ene_cpu.py,sha256=2y5__d-vx7t5Ajs4IPuNnQe8ULR39Km_KQFNIUnalGA,45167
|
7
7
|
pyerualjetwork/ene_cuda.py,sha256=dWavZydKL9b5BAGL430SuWs1TenMelbFtltoEAXKkJY,45673
|
8
|
-
pyerualjetwork/fitness_functions.py,sha256=
|
8
|
+
pyerualjetwork/fitness_functions.py,sha256=D9JVCr9DFid_xXgBD4uCKxdW2k10MVDE5HZRSOK4Igg,1237
|
9
9
|
pyerualjetwork/help.py,sha256=FcX8mxo1_mvoqONVXY0Kn7S09CDkhi0jwNmn8g9mYZc,804
|
10
10
|
pyerualjetwork/issue_solver.py,sha256=iY6hSsBxYI5l82RwnXQp2DrRUJyksk_7U9GUSnt2YfU,3117
|
11
11
|
pyerualjetwork/loss_functions_cpu.py,sha256=6PyBI232SQRGuFnG3LDGvnv_PUdWzT2_2mUODJiejGI,618
|
@@ -14,13 +14,13 @@ pyerualjetwork/memory_operations.py,sha256=g24d-cDuUFc0fOEtk3AJe-z_EBctYV5S4cY1r
|
|
14
14
|
pyerualjetwork/metrics_cpu.py,sha256=vbfMwS0ay2heMSa0GNo-ydLjQ8cfexbLwaREp4FKAtY,6081
|
15
15
|
pyerualjetwork/metrics_cuda.py,sha256=PWyJyexeqlPKb09LAcF55JvhZVeXLCu3P_siYq5m2gg,5065
|
16
16
|
pyerualjetwork/model_operations_cpu.py,sha256=Y0uPkLVbdodP7lC-fOPdja3RWi2J9z2rwWIS2pxzotU,20523
|
17
|
-
pyerualjetwork/model_operations_cuda.py,sha256=
|
18
|
-
pyerualjetwork/neu_cpu.py,sha256=
|
17
|
+
pyerualjetwork/model_operations_cuda.py,sha256=B6vNYmqvrEJ3ZMGE1RWeJYn3V-JCsXhCHvS-aX4bWuU,21254
|
18
|
+
pyerualjetwork/neu_cpu.py,sha256=4jjW9xIuB5WKJRMAR0BgkUra3OYERfUhehbqeYFgiIA,31197
|
19
19
|
pyerualjetwork/neu_cuda.py,sha256=nK74JgfyJDbaPmSR1CmtZc_PaSKk0FeFmNcWHe5-8U0,32354
|
20
20
|
pyerualjetwork/ui.py,sha256=JBTFYz5R24XwNKhA3GSW-oYAoiIBxAE3kFGXkvm5gqw,656
|
21
21
|
pyerualjetwork/visualizations_cpu.py,sha256=StyD1Hl1Gt55EMqR6tO3yVJZdPyGkOgCnQ75Zn8K6J8,28252
|
22
22
|
pyerualjetwork/visualizations_cuda.py,sha256=7lYrkOdrjwQGB3T4k_vI8UDxsm_TRjzaSSg9GhlNczs,28667
|
23
|
-
pyerualjetwork-5.
|
24
|
-
pyerualjetwork-5.
|
25
|
-
pyerualjetwork-5.
|
26
|
-
pyerualjetwork-5.
|
23
|
+
pyerualjetwork-5.21.dist-info/METADATA,sha256=mqDRsgybJuNDivw4CkyF7wV2utp_JZX-ISvbwNkI15Y,8133
|
24
|
+
pyerualjetwork-5.21.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
25
|
+
pyerualjetwork-5.21.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
|
26
|
+
pyerualjetwork-5.21.dist-info/RECORD,,
|
File without changes
|
File without changes
|