pyerualjetwork 4.2.7b3__py3-none-any.whl → 4.2.9__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.py +2 -0
- pyerualjetwork/activation_functions_cuda.py +2 -3
- pyerualjetwork/data_operations.py +2 -3
- pyerualjetwork/plan.py +2 -2
- pyerualjetwork/planeat.py +4 -7
- pyerualjetwork/planeat_cuda.py +4 -7
- {pyerualjetwork-4.2.7b3.dist-info → pyerualjetwork-4.2.9.dist-info}/METADATA +1 -1
- {pyerualjetwork-4.2.7b3.dist-info → pyerualjetwork-4.2.9.dist-info}/RECORD +11 -11
- {pyerualjetwork-4.2.7b3.dist-info → pyerualjetwork-4.2.9.dist-info}/WHEEL +0 -0
- {pyerualjetwork-4.2.7b3.dist-info → pyerualjetwork-4.2.9.dist-info}/top_level.txt +0 -0
pyerualjetwork/__init__.py
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
__version__ = "4.2.
|
1
|
+
__version__ = "4.2.9"
|
2
2
|
__update__ = "* Changes: https://github.com/HCB06/PyerualJetwork/blob/main/CHANGES\n* PyerualJetwork Homepage: https://github.com/HCB06/PyerualJetwork/tree/main\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"
|
3
3
|
|
4
4
|
def print_version(__version__):
|
@@ -218,12 +218,14 @@ def scaled_cubic(x, alpha=1.0):
|
|
218
218
|
def sine_offset(x, beta=0.0):
|
219
219
|
return np.sin(x + beta)
|
220
220
|
|
221
|
+
|
221
222
|
def safe_add(current_sum, new_value):
|
222
223
|
try:
|
223
224
|
return current_sum + new_value
|
224
225
|
except OverflowError:
|
225
226
|
return np.array(current_sum) + np.array(new_value)
|
226
227
|
|
228
|
+
|
227
229
|
def apply_activation(Input, activation_list):
|
228
230
|
"""
|
229
231
|
Applies a sequence of activation functions to the input.
|
@@ -218,7 +218,6 @@ def sine_offset(x, beta=0.0):
|
|
218
218
|
return cp.sin(x + beta)
|
219
219
|
|
220
220
|
|
221
|
-
|
222
221
|
def safe_add(current_sum, new_value):
|
223
222
|
try:
|
224
223
|
return current_sum + new_value
|
@@ -230,11 +229,11 @@ def apply_activation(Input, activation_list):
|
|
230
229
|
Applies a sequence of activation functions to the input.
|
231
230
|
|
232
231
|
Args:
|
233
|
-
Input (
|
232
|
+
Input (cupy.ndarray): The input to apply activations to.
|
234
233
|
activation_list (list): A list of activation function names to apply.
|
235
234
|
|
236
235
|
Returns:
|
237
|
-
|
236
|
+
cupy.ndarray: The input after all activations have been applied.
|
238
237
|
"""
|
239
238
|
|
240
239
|
origin_input = cp.copy(Input)
|
@@ -55,9 +55,8 @@ def decode_one_hot(encoded_data):
|
|
55
55
|
numpy.ndarray: Decoded categorical labels with shape (n_samples,).
|
56
56
|
"""
|
57
57
|
|
58
|
-
|
59
|
-
|
60
|
-
return decoded_labels
|
58
|
+
if encoded_data.ndim == 1: return np.argmax(encoded_data)
|
59
|
+
else: return np.argmax(encoded_data, axis=1)
|
61
60
|
|
62
61
|
|
63
62
|
def split(X, y, test_size, random_state=42, dtype=np.float32):
|
pyerualjetwork/plan.py
CHANGED
@@ -135,9 +135,9 @@ def fit(
|
|
135
135
|
# Training process
|
136
136
|
for index, inp in enumerate(x_train):
|
137
137
|
inp = np.array(inp, copy=False).ravel()
|
138
|
-
y_decoded = decode_one_hot(y_train)
|
138
|
+
y_decoded = decode_one_hot(y_train[index])
|
139
139
|
# Weight updates
|
140
|
-
STPW = feed_forward(inp, STPW, is_training=True, Class=y_decoded
|
140
|
+
STPW = feed_forward(inp, STPW, is_training=True, Class=y_decoded, activation_potentiation=activation_potentiation, LTD=LTD)
|
141
141
|
LTPW += normalization(STPW, dtype=dtype) if auto_normalization else STPW
|
142
142
|
if val and index != 0:
|
143
143
|
if index % math.ceil((val_count / len(x_train)) * 100) == 0:
|
pyerualjetwork/planeat.py
CHANGED
@@ -82,7 +82,7 @@ def evolver(weights,
|
|
82
82
|
bar_status=True,
|
83
83
|
strategy='normal_selective',
|
84
84
|
bad_genomes_mutation_prob=None,
|
85
|
-
fitness_bias=
|
85
|
+
fitness_bias=1,
|
86
86
|
cross_over_mode='tpm',
|
87
87
|
activation_mutate_add_prob=0.5,
|
88
88
|
activation_mutate_delete_prob=0.5,
|
@@ -93,7 +93,7 @@ def evolver(weights,
|
|
93
93
|
activation_mutate_prob=1,
|
94
94
|
activation_mutate_threshold=2,
|
95
95
|
weight_mutate_threshold=16,
|
96
|
-
weight_mutate_prob=1,
|
96
|
+
weight_mutate_prob=1,
|
97
97
|
dtype=np.float32):
|
98
98
|
"""
|
99
99
|
Applies the evolving process of a population of genomes using selection, crossover, mutation, and activation function potentiation.
|
@@ -139,7 +139,7 @@ def evolver(weights,
|
|
139
139
|
|
140
140
|
Default: 'aggressive'.
|
141
141
|
|
142
|
-
fitness_bias (float, optional): Fitness bias must be a probability value between 0 and 1 that determines the effect of fitness on the crossover process. Default:
|
142
|
+
fitness_bias (float, optional): Fitness bias must be a probability value between 0 and 1 that determines the effect of fitness on the crossover process. Default: 1.
|
143
143
|
|
144
144
|
bad_genomes_mutation_prob (float, optional): The probability of applying mutation to the bad genomes.
|
145
145
|
Must be in the range [0, 1]. Also affects the mutation probability of the best genomes inversely.
|
@@ -224,17 +224,14 @@ def evolver(weights,
|
|
224
224
|
if strategy == 'normal_selective':
|
225
225
|
if bad_genomes_mutation_prob is None: bad_genomes_mutation_prob = 0.7 # EFFECTS MUTATION
|
226
226
|
if bad_genomes_selection_prob is None: bad_genomes_selection_prob = 0.25 # EFFECTS CROSS-OVER
|
227
|
-
|
228
|
-
|
227
|
+
|
229
228
|
elif strategy == 'more_selective':
|
230
229
|
if bad_genomes_mutation_prob is None: bad_genomes_mutation_prob = 0.85 # EFFECTS MUTATION
|
231
230
|
if bad_genomes_selection_prob is None: bad_genomes_selection_prob = 0.1 # EFFECTS CROSS-OVER
|
232
|
-
if fitness_bias is None: fitness_bias = 0.7 # The pressure applied by FITNESS to the CROSS-OVER
|
233
231
|
|
234
232
|
elif strategy == 'less_selective':
|
235
233
|
if bad_genomes_mutation_prob is None: bad_genomes_mutation_prob = 0.6 # EFFECTS MUTATION
|
236
234
|
if bad_genomes_selection_prob is None: bad_genomes_selection_prob = 0.5 # EFFECTS CROSS-OVER
|
237
|
-
if fitness_bias is None: fitness_bias = 0.3 # The pressure applied by FITNESS to the CROSS-OVER
|
238
235
|
|
239
236
|
else:
|
240
237
|
raise ValueError("strategy parameter must be: 'normal_selective' or 'more_selective' or 'less_selective'")
|
pyerualjetwork/planeat_cuda.py
CHANGED
@@ -84,7 +84,7 @@ def evolver(weights,
|
|
84
84
|
bar_status=True,
|
85
85
|
strategy='normal_selective',
|
86
86
|
bad_genomes_mutation_prob=None,
|
87
|
-
fitness_bias=
|
87
|
+
fitness_bias=1,
|
88
88
|
cross_over_mode='tpm',
|
89
89
|
activation_mutate_add_prob=0.5,
|
90
90
|
activation_mutate_delete_prob=0.5,
|
@@ -141,7 +141,7 @@ def evolver(weights,
|
|
141
141
|
|
142
142
|
Default: 'aggressive'.
|
143
143
|
|
144
|
-
fitness_bias (float, optional): Fitness bias must be a probability value between 0 and 1 that determines the effect of fitness on the crossover process. Default:
|
144
|
+
fitness_bias (float, optional): Fitness bias must be a probability value between 0 and 1 that determines the effect of fitness on the crossover process. Default: 1`.
|
145
145
|
|
146
146
|
bad_genomes_mutation_prob (float, optional): The probability of applying mutation to the bad genomes.
|
147
147
|
Must be in the range [0, 1]. Also affects the mutation probability of the best genomes inversely.
|
@@ -164,7 +164,7 @@ def evolver(weights,
|
|
164
164
|
Must be in the range [0, 1]. Default is 0.5.
|
165
165
|
|
166
166
|
weight_mutate_prob (float, optional): The probability of mutating a weight in the genome.
|
167
|
-
Must be in the range [0, 1]. Default is 1.
|
167
|
+
Must be in the range [0, 1]. Default is 1 (%100).
|
168
168
|
|
169
169
|
weight_mutate_threshold (int): Determines max how much weight mutaiton operation applying. (Function automaticly determines to min) Default: 16
|
170
170
|
|
@@ -225,17 +225,14 @@ def evolver(weights,
|
|
225
225
|
if strategy == 'normal_selective':
|
226
226
|
if bad_genomes_mutation_prob is None: bad_genomes_mutation_prob = 0.7 # EFFECTS MUTATION
|
227
227
|
if bad_genomes_selection_prob is None: bad_genomes_selection_prob = 0.25 # EFFECTS CROSS-OVER
|
228
|
-
|
229
|
-
|
228
|
+
|
230
229
|
elif strategy == 'more_selective':
|
231
230
|
if bad_genomes_mutation_prob is None: bad_genomes_mutation_prob = 0.85 # EFFECTS MUTATION
|
232
231
|
if bad_genomes_selection_prob is None: bad_genomes_selection_prob = 0.1 # EFFECTS CROSS-OVER
|
233
|
-
if fitness_bias is None: fitness_bias = 0.7 # The pressure applied by FITNESS to the CROSS-OVER
|
234
232
|
|
235
233
|
elif strategy == 'less_selective':
|
236
234
|
if bad_genomes_mutation_prob is None: bad_genomes_mutation_prob = 0.6 # EFFECTS MUTATION
|
237
235
|
if bad_genomes_selection_prob is None: bad_genomes_selection_prob = 0.5 # EFFECTS CROSS-OVER
|
238
|
-
if fitness_bias is None: fitness_bias = 0.3 # The pressure applied by FITNESS to the CROSS-OVER
|
239
236
|
|
240
237
|
else:
|
241
238
|
raise ValueError("strategy parameter must be: 'normal_selective' or 'more_selective' or 'less_selective'")
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyerualjetwork
|
3
|
-
Version: 4.2.
|
3
|
+
Version: 4.2.9
|
4
4
|
Summary: PyerualJetwork is a machine learning library supported with GPU(CUDA) acceleration written in Python for professionals and researchers including with PLAN algorithm, PLANEAT algorithm (genetic optimization). Also includes data pre-process and memory manegament
|
5
5
|
Author: Hasan Can Beydili
|
6
6
|
Author-email: tchasancan@gmail.com
|
@@ -1,7 +1,7 @@
|
|
1
|
-
pyerualjetwork/__init__.py,sha256=
|
2
|
-
pyerualjetwork/activation_functions.py,sha256=
|
3
|
-
pyerualjetwork/activation_functions_cuda.py,sha256=
|
4
|
-
pyerualjetwork/data_operations.py,sha256=
|
1
|
+
pyerualjetwork/__init__.py,sha256=cSSRzg1vByQssMGXt65jQxrvHcdfiXqJKKQqgRMMGSE,639
|
2
|
+
pyerualjetwork/activation_functions.py,sha256=eLEesmMgDvkI1TqaLTpqtOgTaLbHEAyw-D57KIKd9G4,11775
|
3
|
+
pyerualjetwork/activation_functions_cuda.py,sha256=ztIw6rMR4t1289_TPIGYwE6qarl_YbSOGj5Ep3rUMqs,11803
|
4
|
+
pyerualjetwork/data_operations.py,sha256=Flteouu6rfSo2uHMqBHuzO02dXmbNa-I5qWmUpGTZ5Y,14760
|
5
5
|
pyerualjetwork/data_operations_cuda.py,sha256=UpoJoFhIwTU4xg9dVuLAxLAT4CkRaGsxvtJG9j1xrNo,17629
|
6
6
|
pyerualjetwork/help.py,sha256=nQ_YbYA2RtuafhuvkreNpX0WWL1I_nzlelwCtvei0_Y,775
|
7
7
|
pyerualjetwork/loss_functions.py,sha256=6PyBI232SQRGuFnG3LDGvnv_PUdWzT2_2mUODJiejGI,618
|
@@ -11,14 +11,14 @@ pyerualjetwork/metrics.py,sha256=q7MkhnZDRbCjFBDDfUgrl8lBYnUT_1ro1LxeBq105pI,607
|
|
11
11
|
pyerualjetwork/metrics_cuda.py,sha256=73h9GC7XwmnFCVzFEEiPQfF8CwHIz2wsCbxpZrJtYgw,5061
|
12
12
|
pyerualjetwork/model_operations.py,sha256=RKqnh7-MByFosxqme4q4jC1lOndX26O-OVXYV6ZxoEE,12965
|
13
13
|
pyerualjetwork/model_operations_cuda.py,sha256=XnKKq54ZLaqCm-NaJ6d8IToACKcKg2Ttq6moowVRRWo,13365
|
14
|
-
pyerualjetwork/plan.py,sha256=
|
14
|
+
pyerualjetwork/plan.py,sha256=x66wxPIVO19dLDQT6-KVFVr6PYHW3Eqj-ni8kGY3N_c,32134
|
15
15
|
pyerualjetwork/plan_cuda.py,sha256=hpXZl3h7B1qAVYW-gZebwKMZd4-ftAZ-u05teOJjsno,33525
|
16
|
-
pyerualjetwork/planeat.py,sha256=
|
17
|
-
pyerualjetwork/planeat_cuda.py,sha256=
|
16
|
+
pyerualjetwork/planeat.py,sha256=t6qyuMB2c5n8lsAJooEpShzEnw2GvepBI0bpLMx0DUI,39440
|
17
|
+
pyerualjetwork/planeat_cuda.py,sha256=UBdbAk87M5zEZzZlRBeOzW-q0Sy8c_XWl4zdrtDnyIs,39499
|
18
18
|
pyerualjetwork/ui.py,sha256=wu2BhU1k-w3Kcho5Jtq4SEKe68ftaUeRGneUOSCVDjU,575
|
19
19
|
pyerualjetwork/visualizations.py,sha256=1SKMZaJ80OD2qHUyMxW1IOv8zwmxzMPxclfbeq1Xr4g,28772
|
20
20
|
pyerualjetwork/visualizations_cuda.py,sha256=KbMhfsLlxujy_i3QrwCf734Q-k6d7Zn_7CEbm3gzK9w,29186
|
21
|
-
pyerualjetwork-4.2.
|
22
|
-
pyerualjetwork-4.2.
|
23
|
-
pyerualjetwork-4.2.
|
24
|
-
pyerualjetwork-4.2.
|
21
|
+
pyerualjetwork-4.2.9.dist-info/METADATA,sha256=OdylvYMVTVNn7_kzzMBeJ7312sRwF4ABJ6jqq0vE7rg,7452
|
22
|
+
pyerualjetwork-4.2.9.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
23
|
+
pyerualjetwork-4.2.9.dist-info/top_level.txt,sha256=BRyt62U_r3ZmJpj-wXNOoA345Bzamrj6RbaWsyW4tRg,15
|
24
|
+
pyerualjetwork-4.2.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|