pyerualjetwork 2.2.0__py3-none-any.whl → 2.2.1__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.
- plan_bi/plan_bi.py +6 -6
- plan_di/plan_di.py +8 -38
- {pyerualjetwork-2.2.0.dist-info → pyerualjetwork-2.2.1.dist-info}/METADATA +1 -1
- pyerualjetwork-2.2.1.dist-info/RECORD +8 -0
- pyerualjetwork-2.2.0.dist-info/RECORD +0 -8
- {pyerualjetwork-2.2.0.dist-info → pyerualjetwork-2.2.1.dist-info}/WHEEL +0 -0
- {pyerualjetwork-2.2.0.dist-info → pyerualjetwork-2.2.1.dist-info}/top_level.txt +0 -0
plan_bi/plan_bi.py
CHANGED
@@ -95,8 +95,6 @@ def fit(
|
|
95
95
|
|
96
96
|
if Layer == 'fex':
|
97
97
|
W[Lindex] = fex(neural_layer, W[Lindex], activation_potential, Piece[Windex], True, y)
|
98
|
-
elif Layer == 'cat':
|
99
|
-
W[Lindex] = cat(neural_layer, W[Lindex], True, y)
|
100
98
|
|
101
99
|
|
102
100
|
for i, w in enumerate(W):
|
@@ -172,6 +170,8 @@ def weight_identification(
|
|
172
170
|
for w in range(ws):
|
173
171
|
W[w + 1] = np.ones((neurons[w + 1],neurons[w]))
|
174
172
|
W[layer_count] = np.ones((class_count,neurons[layer_count - 1]))
|
173
|
+
W[len(W) - 1] = np.eye(class_count)
|
174
|
+
|
175
175
|
return W
|
176
176
|
|
177
177
|
def synaptic_pruning(
|
@@ -471,7 +471,7 @@ def evaluate(
|
|
471
471
|
if layers[index] == 'fex':
|
472
472
|
neural_layer = fex(neural_layer, W[index], activation_potential, None, False, None)
|
473
473
|
if layers[index] == 'cat':
|
474
|
-
neural_layer =
|
474
|
+
neural_layer = np.dot(W[index], neural_layer)
|
475
475
|
|
476
476
|
for i, w in enumerate(Wc):
|
477
477
|
W[i] = np.copy(w)
|
@@ -594,7 +594,7 @@ def multiple_evaluate(
|
|
594
594
|
if layers[index] == 'fex':
|
595
595
|
neural_layer = fex(neural_layer, W[index], activation_potentials[m], None, False, None)
|
596
596
|
if layers[index] == 'cat':
|
597
|
-
neural_layer =
|
597
|
+
neural_layer = np.dot(W[index], neural_layer)
|
598
598
|
|
599
599
|
output_layer += neural_layer
|
600
600
|
|
@@ -914,7 +914,7 @@ def predict_model_ssd(Input, model_name, model_path):
|
|
914
914
|
if layers[index] == 'fex':
|
915
915
|
neural_layer = fex(neural_layer, W[index], activation_potential, None, False, None)
|
916
916
|
if layers[index] == 'cat':
|
917
|
-
neural_layer =
|
917
|
+
neural_layer = np.dot(W[index], neural_layer)
|
918
918
|
except:
|
919
919
|
print(Fore.RED + "ERROR: The input was probably entered incorrectly. from: predict_model_ssd" + infopredict_model_ssd + Style.RESET_ALL)
|
920
920
|
return 'e'
|
@@ -958,7 +958,7 @@ def predict_model_ram(Input, activation_potential, scaler, W):
|
|
958
958
|
if layers[index] == 'fex':
|
959
959
|
neural_layer = fex(neural_layer, W[index], activation_potential, None, False, None)
|
960
960
|
if layers[index] == 'cat':
|
961
|
-
neural_layer =
|
961
|
+
neural_layer = np.dot(W[index], neural_layer)
|
962
962
|
|
963
963
|
except:
|
964
964
|
print(Fore.RED + "ERROR: Unexpected input or wrong model parameters from: predict_model_ram." + infopredict_model_ram + Style.RESET_ALL)
|
plan_di/plan_di.py
CHANGED
@@ -58,6 +58,7 @@ def fit(
|
|
58
58
|
|
59
59
|
W = weight_identification(
|
60
60
|
len(layers) - 1, len(class_count), neurons, x_train_size)
|
61
|
+
|
61
62
|
Divides, Piece = synaptic_dividing(len(class_count), W)
|
62
63
|
trained_W = [1] * len(W)
|
63
64
|
print(Fore.GREEN + "Train Started with 0 ERROR" + Style.RESET_ALL)
|
@@ -94,8 +95,6 @@ def fit(
|
|
94
95
|
y = np.argmax(y_train[index])
|
95
96
|
if Layer == 'fex':
|
96
97
|
W[Lindex] = fex(neural_layer, W[Lindex], True, y)
|
97
|
-
elif Layer == 'cat':
|
98
|
-
W[Lindex] = cat(neural_layer, W[Lindex], True, y)
|
99
98
|
|
100
99
|
for i, w in enumerate(W):
|
101
100
|
trained_W[i] = trained_W[i] + w
|
@@ -165,6 +164,8 @@ def weight_identification(
|
|
165
164
|
for w in range(ws):
|
166
165
|
W[w + 1] = np.ones((neurons[w + 1], neurons[w]))
|
167
166
|
W[layer_count] = np.ones((class_count, neurons[layer_count - 1]))
|
167
|
+
W[len(W) - 1] = np.eye(class_count)
|
168
|
+
|
168
169
|
return W
|
169
170
|
|
170
171
|
|
@@ -302,37 +303,6 @@ def fex(
|
|
302
303
|
return neural_layer
|
303
304
|
|
304
305
|
|
305
|
-
def cat(
|
306
|
-
Input, # list[num]: Input data.
|
307
|
-
w, # list[num]: Weight matrix of the neural network.
|
308
|
-
# (bool): Flag indicating if the function is called during training (True or False).
|
309
|
-
is_training,
|
310
|
-
Class
|
311
|
-
) -> tuple:
|
312
|
-
"""
|
313
|
-
Applies categorization process to the input data using synaptic pruning if specified.
|
314
|
-
|
315
|
-
Args:
|
316
|
-
Input (list[num]): Input data.
|
317
|
-
w (list[num]): Weight matrix of the neural network.
|
318
|
-
is_training (bool): Flag indicating if the function is called during training (True or False).
|
319
|
-
Class (int): if is during training then which class(label) ? is isnt then put None.
|
320
|
-
Returns:
|
321
|
-
tuple: A tuple containing the neural layer (vector) result and the possibly updated weight matrix.
|
322
|
-
"""
|
323
|
-
|
324
|
-
if is_training == True:
|
325
|
-
|
326
|
-
w[Class, Class] += 1
|
327
|
-
|
328
|
-
return w
|
329
|
-
|
330
|
-
else:
|
331
|
-
|
332
|
-
neural_layer = np.dot(w, Input)
|
333
|
-
|
334
|
-
return neural_layer
|
335
|
-
|
336
306
|
|
337
307
|
def normalization(
|
338
308
|
Input # num: Input data to be normalized.
|
@@ -449,7 +419,7 @@ def evaluate(
|
|
449
419
|
if Layer == 'fex':
|
450
420
|
neural_layer = fex(neural_layer, W[index], False, None)
|
451
421
|
elif Layer == 'cat':
|
452
|
-
neural_layer =
|
422
|
+
neural_layer = np.dot(W[index], neural_layer)
|
453
423
|
|
454
424
|
for i, w in enumerate(Wc):
|
455
425
|
W[i] = np.copy(w)
|
@@ -571,7 +541,7 @@ def multiple_evaluate(
|
|
571
541
|
if Layer == 'fex':
|
572
542
|
neural_layer = fex(neural_layer, W[index], False, None)
|
573
543
|
elif Layer == 'cat':
|
574
|
-
neural_layer =
|
544
|
+
neural_layer = np.dot(W[index], neural_layer)
|
575
545
|
|
576
546
|
output_layer += neural_layer
|
577
547
|
|
@@ -887,7 +857,7 @@ def predict_model_ssd(Input, model_name, model_path):
|
|
887
857
|
if Layer == 'fex':
|
888
858
|
neural_layer = fex(neural_layer, W[index], False, None)
|
889
859
|
elif Layer == 'cat':
|
890
|
-
neural_layer =
|
860
|
+
neural_layer = np.dot(W[index], neural_layer)
|
891
861
|
except:
|
892
862
|
print(Fore.RED + "ERROR: The input was probably entered incorrectly. from: predict_model_ssd" +
|
893
863
|
infopredict_model_ssd + Style.RESET_ALL)
|
@@ -932,7 +902,7 @@ def predict_model_ram(Input, scaler, W):
|
|
932
902
|
if Layer == 'fex':
|
933
903
|
neural_layer = fex(neural_layer, W[index], False, None)
|
934
904
|
elif Layer == 'cat':
|
935
|
-
neural_layer =
|
905
|
+
neural_layer = np.dot(W[index], neural_layer)
|
936
906
|
|
937
907
|
except:
|
938
908
|
print(Fore.RED + "ERROR: Unexpected input or wrong model parameters from: predict_model_ram." +
|
@@ -1458,4 +1428,4 @@ def get_preds():
|
|
1458
1428
|
|
1459
1429
|
def get_acc():
|
1460
1430
|
|
1461
|
-
return 2
|
1431
|
+
return 2
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyerualjetwork
|
3
|
-
Version: 2.2.
|
3
|
+
Version: 2.2.1
|
4
4
|
Summary: 8 new functions: multiple_evaluate , encode_one_hot, split, metrics, decode_one_hot, roc_curve, confusion_matrix, plot_evaluate And Code improvements (Documentation in desc. Examples in GİTHUB: https://github.com/HCB06/PyerualJetwork)
|
5
5
|
Author: Hasan Can Beydili
|
6
6
|
Author-email: tchasancan@gmail.com
|
@@ -0,0 +1,8 @@
|
|
1
|
+
plan_bi/__init__.py,sha256=82q8bWRYqzwMrFuViQzBg7P19i6EqdV7VYBVxuQ-LV0,517
|
2
|
+
plan_bi/plan_bi.py,sha256=fNJK07y9JDVLU0GORD_RHKBjTUnVzb5ciYcQFpyiSvc,50490
|
3
|
+
plan_di/__init__.py,sha256=Eut7tVtvQaczEejYyqfQ4eqF71j69josJcY91WN_dkk,508
|
4
|
+
plan_di/plan_di.py,sha256=gKY0yCzX1nNNwdRwGOfmaLcvuQwfg1VrWD5oieVXz08,46265
|
5
|
+
pyerualjetwork-2.2.1.dist-info/METADATA,sha256=0P5kjlorW8wIUW_p7b90xAvyFYM6cprTalkAHOZ3IMo,457
|
6
|
+
pyerualjetwork-2.2.1.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
7
|
+
pyerualjetwork-2.2.1.dist-info/top_level.txt,sha256=aaXSOcnD62fbXG1x7tw4nV50Qxx9g9zDNLK7OD4BdPE,16
|
8
|
+
pyerualjetwork-2.2.1.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
plan_bi/__init__.py,sha256=82q8bWRYqzwMrFuViQzBg7P19i6EqdV7VYBVxuQ-LV0,517
|
2
|
-
plan_bi/plan_bi.py,sha256=tlxrr8-HJ1XodT0v5I6jS6IkrZUQEMKKlMY1tRihy-E,50588
|
3
|
-
plan_di/__init__.py,sha256=Eut7tVtvQaczEejYyqfQ4eqF71j69josJcY91WN_dkk,508
|
4
|
-
plan_di/plan_di.py,sha256=UKSp5YaTdG8jKAGrkSmwJl3gA81aU4MSJ6WyQEZatXs,47338
|
5
|
-
pyerualjetwork-2.2.0.dist-info/METADATA,sha256=iVpSNQ8pjr_EduOzO7xEEqc0WGJwtFCyrKIg4SvlW1U,457
|
6
|
-
pyerualjetwork-2.2.0.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
7
|
-
pyerualjetwork-2.2.0.dist-info/top_level.txt,sha256=aaXSOcnD62fbXG1x7tw4nV50Qxx9g9zDNLK7OD4BdPE,16
|
8
|
-
pyerualjetwork-2.2.0.dist-info/RECORD,,
|
File without changes
|
File without changes
|