pyerualjetwork 4.1.9b1__py3-none-any.whl → 4.2.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.
- pyerualjetwork/__init__.py +1 -1
- pyerualjetwork/data_operations.py +1 -1
- pyerualjetwork/plan.py +3 -11
- pyerualjetwork/plan_cuda.py +2 -1
- pyerualjetwork/planeat.py +417 -342
- pyerualjetwork/planeat_cuda.py +422 -341
- {pyerualjetwork-4.1.9b1.dist-info → pyerualjetwork-4.2.0.dist-info}/METADATA +1 -1
- {pyerualjetwork-4.1.9b1.dist-info → pyerualjetwork-4.2.0.dist-info}/RECORD +10 -10
- {pyerualjetwork-4.1.9b1.dist-info → pyerualjetwork-4.2.0.dist-info}/WHEEL +0 -0
- {pyerualjetwork-4.1.9b1.dist-info → pyerualjetwork-4.2.0.dist-info}/top_level.txt +0 -0
pyerualjetwork/__init__.py
CHANGED
@@ -48,7 +48,7 @@ for package_name in package_names:
|
|
48
48
|
|
49
49
|
print(f"PyerualJetwork is ready to use with {err} errors")
|
50
50
|
|
51
|
-
__version__ = "4.
|
51
|
+
__version__ = "4.2.0"
|
52
52
|
__update__ = "* Changes: https://github.com/HCB06/PyerualJetwork/blob/main/CHANGES\n* PyerualJetwork document: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PyerualJetwork/PYERUALJETWORK_USER_MANUEL_AND_LEGAL_INFORMATION(EN).pdf\n* YouTube tutorials: https://www.youtube.com/@HasanCanBeydili"
|
53
53
|
|
54
54
|
def print_version(__version__):
|
@@ -11,7 +11,7 @@ def encode_one_hot(y_train, y_test=None, summary=False):
|
|
11
11
|
Args:
|
12
12
|
y_train (numpy.ndarray): Train label data.
|
13
13
|
y_test (numpy.ndarray): Test label data one-hot encoded. (optional).
|
14
|
-
summary (bool): If True, prints the class-to-index mapping. Default: False
|
14
|
+
summary (bool, optional): If True, prints the class-to-index mapping. Default: False
|
15
15
|
|
16
16
|
Returns:
|
17
17
|
tuple: One-hot encoded y_train and (if given) y_test.
|
pyerualjetwork/plan.py
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
|
4
4
|
MAIN MODULE FOR PLAN
|
5
5
|
|
6
|
+
Examples: https://github.com/HCB06/PyerualJetwork/tree/main/Welcome_to_PyerualJetwork/ExampleCodes
|
7
|
+
|
6
8
|
PLAN document: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PLAN/PLAN.pdf
|
7
9
|
PYERUALJETWORK document: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PyerualJetwork/PYERUALJETWORK_USER_MANUEL_AND_LEGAL_INFORMATION(EN).pdf
|
8
10
|
|
@@ -16,7 +18,6 @@ PYERUALJETWORK document: https://github.com/HCB06/PyerualJetwork/blob/main/Welco
|
|
16
18
|
import numpy as np
|
17
19
|
from colorama import Fore
|
18
20
|
import math
|
19
|
-
import random
|
20
21
|
|
21
22
|
### LIBRARY IMPORTS ###
|
22
23
|
from .ui import loading_bars, initialize_loading_bar
|
@@ -177,7 +178,7 @@ def learner(x_train, y_train, optimizer, x_test=None, y_test=None, strategy='acc
|
|
177
178
|
neural_web_history=False, show_current_activations=False, auto_normalization=True,
|
178
179
|
neurons_history=False, early_stop=False, loss='categorical_crossentropy', show_history=False,
|
179
180
|
interval=33.33, target_acc=None, target_loss=None, except_this=None,
|
180
|
-
only_this=None, start_this_act=None, start_this_W=None, target_fitness='max',
|
181
|
+
only_this=None, start_this_act=None, start_this_W=None, target_fitness='max', dtype=np.float32):
|
181
182
|
"""
|
182
183
|
Optimizes the activation functions for a neural network by leveraging train data to find
|
183
184
|
the most accurate combination of activation potentiation for the given dataset using genetic algorithm NEAT (Neuroevolution of Augmenting Topologies). But modifided for PLAN version. Created by me: PLANEAT.
|
@@ -282,15 +283,6 @@ def learner(x_train, y_train, optimizer, x_test=None, y_test=None, strategy='acc
|
|
282
283
|
if gen is None:
|
283
284
|
gen = len(activation_potentiation)
|
284
285
|
|
285
|
-
default_act_list_length = len(activation_potentiation)
|
286
|
-
|
287
|
-
if pop_size is not None and pop_size > len(activation_potentiation):
|
288
|
-
for i in range(pop_size - len(activation_potentiation)):
|
289
|
-
rand_index = random.randint(0, len(default_act_list_length)-1)
|
290
|
-
activation_potentiation.append(all_activations()[rand_index])
|
291
|
-
|
292
|
-
elif pop_size is not None and pop_size < len(activation_potentiation): raise ValueError(f"'pop_size' must be greater then activation_potentiation list length. But your act pot list length: {len(activation_potentiation)}")
|
293
|
-
|
294
286
|
if strategy != 'accuracy' and strategy != 'f1' and strategy != 'recall' and strategy != 'precision': raise ValueError("Strategy parameter only be 'accuracy' or 'f1' or 'recall' or 'precision'.")
|
295
287
|
|
296
288
|
if start_this_act is None and len(activation_potentiation) % 2 != 0: raise ValueError("Activation length must be even number. Please use 'except_this' parameter and except some activation. For example: except_this=['linear']")
|
pyerualjetwork/plan_cuda.py
CHANGED
@@ -3,6 +3,8 @@
|
|
3
3
|
|
4
4
|
MAIN MODULE FOR PLAN_CUDA
|
5
5
|
|
6
|
+
Examples: https://github.com/HCB06/PyerualJetwork/tree/main/Welcome_to_PyerualJetwork/ExampleCodes
|
7
|
+
|
6
8
|
PLAN document: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PLAN/PLAN.pdf
|
7
9
|
PYERUALJETWORK document: https://github.com/HCB06/PyerualJetwork/blob/main/Welcome_to_PyerualJetwork/PYERUALJETWORK_USER_MANUEL_AND_LEGAL_INFORMATION(EN).pdf
|
8
10
|
|
@@ -14,7 +16,6 @@ PYERUALJETWORK document: https://github.com/HCB06/PyerualJetwork/blob/main/Welco
|
|
14
16
|
"""
|
15
17
|
|
16
18
|
import cupy as cp
|
17
|
-
import numpy as np
|
18
19
|
from colorama import Fore
|
19
20
|
import math
|
20
21
|
|