pyerualjetwork 5.31a0__py3-none-any.whl → 5.32__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/cpu/activation_functions.py +1 -0
- pyerualjetwork/cpu/data_ops.py +2 -2
- pyerualjetwork/cpu/model_ops.py +5 -6
- pyerualjetwork/cpu/nn.py +15 -4
- pyerualjetwork/cuda/activation_functions.py +1 -0
- pyerualjetwork/cuda/model_ops.py +5 -6
- pyerualjetwork/cuda/nn.py +14 -3
- {pyerualjetwork-5.31a0.dist-info → pyerualjetwork-5.32.dist-info}/METADATA +11 -14
- {pyerualjetwork-5.31a0.dist-info → pyerualjetwork-5.32.dist-info}/RECORD +12 -12
- {pyerualjetwork-5.31a0.dist-info → pyerualjetwork-5.32.dist-info}/WHEEL +0 -0
- {pyerualjetwork-5.31a0.dist-info → pyerualjetwork-5.32.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.32"
|
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
|
pyerualjetwork/cpu/data_ops.py
CHANGED
@@ -284,9 +284,9 @@ def synthetic_augmentation(x, y, dtype=np.float32):
|
|
284
284
|
"""
|
285
285
|
Generates synthetic examples to balance classes with fewer examples using numpy.
|
286
286
|
Args:
|
287
|
-
|
287
|
+
x: numpy array format
|
288
288
|
|
289
|
-
|
289
|
+
y: numpy array format (one-hot encoded)
|
290
290
|
|
291
291
|
dtype (numpy.dtype): Data type for the arrays. cp.float32 by default. Example: cp.float64 or cp.float16.
|
292
292
|
|
pyerualjetwork/cpu/model_ops.py
CHANGED
@@ -62,7 +62,7 @@ def save_model(model_name,
|
|
62
62
|
test_acc=None,
|
63
63
|
model_path='',
|
64
64
|
activations=['linear'],
|
65
|
-
activation_potentiation=
|
65
|
+
activation_potentiation=None,
|
66
66
|
weights_type='npy',
|
67
67
|
weights_format='raw',
|
68
68
|
show_architecture=False,
|
@@ -174,7 +174,6 @@ def save_model(model_name,
|
|
174
174
|
if len(activations) == 1 and model_type == 'PLAN':
|
175
175
|
activations = [activations]
|
176
176
|
activations.append('')
|
177
|
-
activations.append('')
|
178
177
|
|
179
178
|
if model_type == 'PTNN':
|
180
179
|
if len(activations) > len(activation_potentiation):
|
@@ -386,7 +385,7 @@ def predict_from_storage(Input, model_name, model_path=''):
|
|
386
385
|
from storage
|
387
386
|
|
388
387
|
Args:
|
389
|
-
Input (list or ndarray): Input data for the model
|
388
|
+
Input (list or ndarray): Input data for the model.
|
390
389
|
|
391
390
|
model_name (str): Name of the model.
|
392
391
|
|
@@ -460,7 +459,7 @@ def reverse_predict_from_storage(output, model_name, model_path=''):
|
|
460
459
|
reverse prediction function from storage
|
461
460
|
Args:
|
462
461
|
|
463
|
-
output (list or ndarray): output layer for the model
|
462
|
+
output (list or ndarray): output layer for the model .
|
464
463
|
|
465
464
|
model_name (str): Name of the model.
|
466
465
|
|
@@ -490,7 +489,7 @@ def predict_from_memory(Input, W, scaler_params=None, activations=['linear'], ac
|
|
490
489
|
from memory.
|
491
490
|
|
492
491
|
Args:
|
493
|
-
Input (list or ndarray): Input data for the model
|
492
|
+
Input (list or ndarray): Input data for the model.
|
494
493
|
|
495
494
|
W (list of ndarrays): Weights of the model.
|
496
495
|
|
@@ -564,7 +563,7 @@ def reverse_predict_from_memory(output, W):
|
|
564
563
|
|
565
564
|
Args:
|
566
565
|
|
567
|
-
output (list or ndarray): output layer for the model
|
566
|
+
output (list or ndarray): output layer for the model.
|
568
567
|
|
569
568
|
W (list of ndarrays): Weights of the model.
|
570
569
|
|
pyerualjetwork/cpu/nn.py
CHANGED
@@ -4,7 +4,7 @@
|
|
4
4
|
|
5
5
|
NN (Neural Networks) on CPU
|
6
6
|
============================
|
7
|
-
This module hosts functions for training and evaluating artificial neural networks on CPU for labeled classification tasks
|
7
|
+
This module hosts functions for training and evaluating artificial neural networks on CPU for labeled classification tasks.
|
8
8
|
|
9
9
|
Currently, 3 types of models can be trained:
|
10
10
|
|
@@ -132,18 +132,29 @@ def learn(x_train, y_train, optimizer, gen, pop_size, fit_start=True, batch_size
|
|
132
132
|
* This function also able to train classic MLP model architectures.
|
133
133
|
* And my newest innovative architecture: PTNN (Potentiation Transfer Neural Network).
|
134
134
|
|
135
|
+
Examples:
|
136
|
+
|
137
|
+
This creates a PLAN model:
|
138
|
+
- ```learn(x_train, y_train, optimizer, pop_size=100, gen=100, fit_start=True) ```
|
139
|
+
|
140
|
+
This creates a MLP model(with 2 hidden layer):
|
141
|
+
- ```learn(x_train, y_train, optimizer, pop_size=100, gen=100, fit_start=False, neurons=[64, 64], activation_functions=['tanh', 'tanh']) ```
|
142
|
+
|
143
|
+
This creates a PTNN model(with 2 hidden layer & 1 aggregation layer(comes with PLAN)):
|
144
|
+
- ```learn(x_train, y_train, optimizer, pop_size=100, gen=[10, 100], fit_start=True, neurons=[64, 64], activation_functions=['tanh', 'tanh']) ```
|
145
|
+
|
135
146
|
:Args:
|
136
147
|
:param x_train: (array-like): Training input data.
|
137
148
|
: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.
|
149
|
+
: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.cpu.ene import evolver (and) optimizer = lambda *args, **kwargs: evolver(*args, 'here give your hyperparameters for example: activation_add_prob=0.85', **kwargs) Example:
|
139
150
|
```python
|
140
|
-
optimizer = lambda *args, **kwargs:
|
151
|
+
optimizer = lambda *args, **kwargs: ene.evolver(*args,
|
141
152
|
activation_add_prob=0.05,
|
142
153
|
strategy='aggressive',
|
143
154
|
policy='more_selective',
|
144
155
|
**kwargs)
|
145
156
|
|
146
|
-
model =
|
157
|
+
model = nn.learn(x_train,
|
147
158
|
y_train,
|
148
159
|
optimizer,
|
149
160
|
fit_start=True,
|
pyerualjetwork/cuda/model_ops.py
CHANGED
@@ -64,7 +64,7 @@ def save_model(model_name,
|
|
64
64
|
test_acc=None,
|
65
65
|
model_path='',
|
66
66
|
activations=['linear'],
|
67
|
-
activation_potentiation=
|
67
|
+
activation_potentiation=None,
|
68
68
|
weights_type='npy',
|
69
69
|
weights_format='raw',
|
70
70
|
show_architecture=False,
|
@@ -189,7 +189,6 @@ def save_model(model_name,
|
|
189
189
|
if len(activations) == 1 and model_type == 'PLAN':
|
190
190
|
activations = [activations]
|
191
191
|
activations.append('')
|
192
|
-
activations.append('')
|
193
192
|
|
194
193
|
if model_type == 'PTNN':
|
195
194
|
if len(activations) > len(activation_potentiation):
|
@@ -407,7 +406,7 @@ def predict_from_storage(Input, model_name, model_path='', dtype=cp.float32):
|
|
407
406
|
from storage
|
408
407
|
|
409
408
|
Args:
|
410
|
-
Input (list or ndarray or cupyarray): Input data for the model
|
409
|
+
Input (list or ndarray or cupyarray): Input data for the model.
|
411
410
|
|
412
411
|
model_name (str): Name of the model.
|
413
412
|
|
@@ -485,7 +484,7 @@ def reverse_predict_from_storage(output, model_name, model_path='', dtype=cp.flo
|
|
485
484
|
reverse prediction function from storage
|
486
485
|
Args:
|
487
486
|
|
488
|
-
output (list or ndarray): output layer for the model
|
487
|
+
output (list or ndarray): output layer for the model.
|
489
488
|
|
490
489
|
model_name (str): Name of the model.
|
491
490
|
|
@@ -518,7 +517,7 @@ def predict_from_memory(Input, W, scaler_params=None, activations=['linear'], ac
|
|
518
517
|
from memory.
|
519
518
|
|
520
519
|
Args:
|
521
|
-
Input (list or ndarray): Input data for the model
|
520
|
+
Input (list or ndarray): Input data for the model.
|
522
521
|
|
523
522
|
W (list of ndarrays): Weights of the model.
|
524
523
|
|
@@ -586,7 +585,7 @@ def reverse_predict_from_memory(output, W, dtype=cp.float32):
|
|
586
585
|
|
587
586
|
Args:
|
588
587
|
|
589
|
-
output (list or ndarray): output layer for the model
|
588
|
+
output (list or ndarray): output layer for the model.
|
590
589
|
|
591
590
|
W (list of ndarrays): Weights of the model.
|
592
591
|
|
pyerualjetwork/cuda/nn.py
CHANGED
@@ -127,19 +127,30 @@ def learn(x_train, y_train, optimizer, gen, pop_size, fit_start=True, batch_size
|
|
127
127
|
* This function also able to train classic MLP model architectures.
|
128
128
|
* And my newest innovative architecture: PTNN (Potentiation Transfer Neural Network).
|
129
129
|
|
130
|
+
Examples:
|
131
|
+
|
132
|
+
This creates a PLAN model:
|
133
|
+
- ```learn(x_train, y_train, optimizer, pop_size=100, gen=100, fit_start=True) ```
|
134
|
+
|
135
|
+
This creates a MLP model(with 2 hidden layer):
|
136
|
+
- ```learn(x_train, y_train, optimizer, pop_size=100, gen=100, fit_start=False, neurons=[64, 64], activation_functions=['tanh', 'tanh']) ```
|
137
|
+
|
138
|
+
This creates a PTNN model(with 2 hidden layer & 1 aggregation layer(comes with PLAN)):
|
139
|
+
- ```learn(x_train, y_train, optimizer, pop_size=100, gen=[10, 100], fit_start=True, neurons=[64, 64], activation_functions=['tanh', 'tanh']) ```
|
140
|
+
|
130
141
|
:Args:
|
131
142
|
:param x_train: (array-like): Training input data.
|
132
143
|
:param y_train: (array-like): Labels for training data.
|
133
|
-
: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.
|
144
|
+
: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.cuda.ene import evolver (and) optimizer = lambda *args, **kwargs: evolver(*args, 'here give your hyperparameters for example: activation_add_prob=0.85', **kwargs) Example:
|
134
145
|
```python
|
135
146
|
|
136
|
-
optimizer = lambda *args, **kwargs:
|
147
|
+
optimizer = lambda *args, **kwargs: ene.evolver(*args,
|
137
148
|
activation_add_prob=0.05,
|
138
149
|
strategy='aggressive',
|
139
150
|
policy='more_selective',
|
140
151
|
**kwargs)
|
141
152
|
|
142
|
-
model =
|
153
|
+
model = nn.learn(x_train,
|
143
154
|
y_train,
|
144
155
|
optimizer,
|
145
156
|
fit_start=True,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyerualjetwork
|
3
|
-
Version: 5.
|
3
|
+
Version: 5.32
|
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
|
@@ -24,17 +24,14 @@ GitHub Page: https://github.com/HCB06/PyerualJetwork
|
|
24
24
|
|
25
25
|
YouTube Tutorials: https://www.youtube.com/watch?v=6wMQstZ00is&list=PLNgNWpM7HbsBpCx2VTJ4SK9wcPyse-EHw
|
26
26
|
|
27
|
-
|
27
|
+
installation:
|
28
|
+
'pip install pyerualjetwork'
|
28
29
|
|
29
|
-
|
30
|
-
from pyerualjetwork import
|
31
|
-
from pyerualjetwork import
|
32
|
-
|
33
|
-
|
34
|
-
from pyerualjetwork import neu_cuda
|
35
|
-
from pyerualjetwork import ene_cuda
|
36
|
-
from pyerualjetwork import data_operations_cuda
|
37
|
-
from pyerualjetwork import model_operations_cuda
|
30
|
+
package modules:
|
31
|
+
'from pyerualjetwork.cpu import nn, ene, data_ops, model_ops, memory_ops'
|
32
|
+
'from pyerualjetwork.cuda import nn, ene, data_ops, model_ops, memory_ops'
|
33
|
+
|
34
|
+
please read docstrings.
|
38
35
|
|
39
36
|
PyerualJetwork has Issue Solver. This operation provides users ready-to-use functions to identify potential issues
|
40
37
|
caused by version incompatibilities in major updates, ensuring users are not affected by such problems.
|
@@ -74,10 +71,10 @@ PyerualJetwork is free to use for commercial business and individual users.
|
|
74
71
|
PyerualJetwork ready for both eager execution(like PyTorch) and static graph(like Tensorflow) concepts because PyerualJetwork using only functions.
|
75
72
|
For example:
|
76
73
|
|
77
|
-
|
74
|
+
plan_fit function only fits given training data(suitable for dynamic graph) but learn function learns and optimize entire architecture(suitable for static graph). Or more deeper eager executions PyerualJetwork have: cross_over function, mutation function, list of activation functions, loss functions. You can create your unique model architecture. Move your data to GPU or CPU or manage how much should in GPU, Its all up to you.
|
78
75
|
<br><br>
|
79
76
|
|
80
|
-
PyerualJetworket includes PLAN, MLP & ENE.<br>
|
77
|
+
PyerualJetworket includes PLAN, MLP, PTNN & ENE.<br>
|
81
78
|
|
82
79
|
PLAN VISION:<br>
|
83
80
|
|
@@ -122,6 +119,6 @@ HOW DO I IMPORT IT TO MY PROJECT?
|
|
122
119
|
|
123
120
|
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".
|
124
121
|
|
125
|
-
After installing the module using "pip" you can now call the library module in your project environment. Use: “from pyerualjetwork import
|
122
|
+
After installing the module using "pip" you can now call the library module in your project environment. Use: “from pyerualjetwork.cpu import nn. Now, you can call the necessary functions from the nn module.
|
126
123
|
|
127
124
|
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.
|
@@ -1,28 +1,28 @@
|
|
1
|
-
pyerualjetwork/__init__.py,sha256=
|
1
|
+
pyerualjetwork/__init__.py,sha256=X-alwoq6f9sVQjlVKzJMev51yAFgX4qoqSKrMGEd2b8,2704
|
2
2
|
pyerualjetwork/fitness_functions.py,sha256=D9JVCr9DFid_xXgBD4uCKxdW2k10MVDE5HZRSOK4Igg,1237
|
3
3
|
pyerualjetwork/help.py,sha256=Nyi0gHAN9ZnO4wgQLeENt0n7tSCZ3hJmjaJ853eGjCE,831
|
4
4
|
pyerualjetwork/issue_solver.py,sha256=3pZTGotS29sy3pIuGQoJFUePibtSzS-tNoU80T_Usgk,3131
|
5
5
|
pyerualjetwork/memory_ops.py,sha256=TUFh9SYWCKL6N-vNdWId_EwU313TuZomQCHOrltrD-4,14280
|
6
6
|
pyerualjetwork/ui.py,sha256=JBTFYz5R24XwNKhA3GSW-oYAoiIBxAE3kFGXkvm5gqw,656
|
7
7
|
pyerualjetwork/cpu/__init__.py,sha256=0yAYner_-v7SmT3P7JV2itU8xJUQdQpb40dhAMQiZkc,829
|
8
|
-
pyerualjetwork/cpu/activation_functions.py,sha256=
|
9
|
-
pyerualjetwork/cpu/data_ops.py,sha256
|
8
|
+
pyerualjetwork/cpu/activation_functions.py,sha256=zZSoOQ452Ykp_RsHVxklxesJmmFgufyIB4F3WQjudEQ,6689
|
9
|
+
pyerualjetwork/cpu/data_ops.py,sha256=5biKr7pqLbJOayHYgGdQV1K5GqKbcOvrbbuAyByuDC8,16154
|
10
10
|
pyerualjetwork/cpu/ene.py,sha256=ZLCaCxkpAmFLdxDS2OH-S8fT4jKq4HNVCHgpIufb8lg,44322
|
11
11
|
pyerualjetwork/cpu/loss_functions.py,sha256=6PyBI232SQRGuFnG3LDGvnv_PUdWzT2_2mUODJiejGI,618
|
12
12
|
pyerualjetwork/cpu/metrics.py,sha256=WhZ8iEqWehaygPRADUlhA5j_Qv3UwqV_eMxpyRVkeVs,6070
|
13
|
-
pyerualjetwork/cpu/model_ops.py,sha256=
|
14
|
-
pyerualjetwork/cpu/nn.py,sha256=
|
13
|
+
pyerualjetwork/cpu/model_ops.py,sha256=sWsP_7Gfa8_DJ2X7AUrOkeXnz2Eej6573grQQ3CooXM,20295
|
14
|
+
pyerualjetwork/cpu/nn.py,sha256=B8V32y0j4a85JBz11Ke_hE8hUp8kv0gQ6LDtaCiASzk,32010
|
15
15
|
pyerualjetwork/cpu/visualizations.py,sha256=rOQsc-W8b71z7ovXSoF49lx4fmpvlaHLsyj9ejWnhnI,28164
|
16
16
|
pyerualjetwork/cuda/__init__.py,sha256=NbqvAS4jlMdoFdXa5_hi5ukXQ5zAZR_5BQ4QAqtiKug,879
|
17
|
-
pyerualjetwork/cuda/activation_functions.py,sha256=
|
17
|
+
pyerualjetwork/cuda/activation_functions.py,sha256=FmoSAxDr9SGO4nkE6ZflXK4pmvZ0sL3Epe1Lz-3GOVI,6766
|
18
18
|
pyerualjetwork/cuda/data_ops.py,sha256=SiNodFNmWyTPY_KnKuAi9biPRdpTAYY3XM01bRSUPCs,18510
|
19
19
|
pyerualjetwork/cuda/ene.py,sha256=aSCPr9VFdgK2cxxfwuP7z0jbJL9gkKNM0rgu8ihLarQ,44830
|
20
20
|
pyerualjetwork/cuda/loss_functions.py,sha256=C93IZJcrOpT6HMK9x1O4AHJWXYTkN5WZiqdssPbvAPk,617
|
21
21
|
pyerualjetwork/cuda/metrics.py,sha256=PjDBoRvr6va8vRvDIJJGBO4-I4uumrk3NCM1Vz4NJTo,5054
|
22
|
-
pyerualjetwork/cuda/model_ops.py,sha256=
|
23
|
-
pyerualjetwork/cuda/nn.py,sha256=
|
22
|
+
pyerualjetwork/cuda/model_ops.py,sha256=iQPuxmthKxP2GTFLHJppxoU64C6mEpkDW-DsfwFGiuY,21020
|
23
|
+
pyerualjetwork/cuda/nn.py,sha256=7rbaIEcmssaFgcionWVRmKijlgFyftVjf-MMNaLO_28,33140
|
24
24
|
pyerualjetwork/cuda/visualizations.py,sha256=9l5BhXqXoeopdhLvVGvjH1TKYZb9JdKOsSE2IYD02zs,28569
|
25
|
-
pyerualjetwork-5.
|
26
|
-
pyerualjetwork-5.
|
27
|
-
pyerualjetwork-5.
|
28
|
-
pyerualjetwork-5.
|
25
|
+
pyerualjetwork-5.32.dist-info/METADATA,sha256=1wsSwMOifBtpBpAZE3UnFKdK8P4Bq3DUX8N_sdi-Pe4,8020
|
26
|
+
pyerualjetwork-5.32.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
27
|
+
pyerualjetwork-5.32.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
|
28
|
+
pyerualjetwork-5.32.dist-info/RECORD,,
|
File without changes
|
File without changes
|