pyerualjetwork 2.8.2__py3-none-any.whl → 2.8.4__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/plan.py +57 -58
- {pyerualjetwork-2.8.2.dist-info → pyerualjetwork-2.8.4.dist-info}/METADATA +1 -1
- pyerualjetwork-2.8.4.dist-info/RECORD +6 -0
- pyerualjetwork-2.8.2.dist-info/RECORD +0 -6
- {pyerualjetwork-2.8.2.dist-info → pyerualjetwork-2.8.4.dist-info}/WHEEL +0 -0
- {pyerualjetwork-2.8.2.dist-info → pyerualjetwork-2.8.4.dist-info}/top_level.txt +0 -0
plan/plan.py
CHANGED
@@ -503,76 +503,76 @@ def evaluate(
|
|
503
503
|
real_classes = []
|
504
504
|
predict_classes = []
|
505
505
|
|
506
|
-
|
507
|
-
|
506
|
+
try:
|
507
|
+
layers = ['fex']
|
508
508
|
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
for i, w in enumerate(W):
|
515
|
-
Wc[i] = np.copy(w)
|
509
|
+
Wc = [0] * len(W) # Wc = Weight copy
|
510
|
+
true = 0
|
511
|
+
y_preds = []
|
512
|
+
acc_list = []
|
516
513
|
|
517
|
-
|
518
|
-
|
514
|
+
for i, w in enumerate(W):
|
515
|
+
Wc[i] = np.copy(w)
|
516
|
+
|
517
|
+
|
518
|
+
if bar_status == True:
|
519
519
|
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
520
|
+
test_progress = tqdm(total=len(x_test),leave=False, desc='Testing',ncols=120)
|
521
|
+
acc_bar = tqdm(total=1, desc="Test Accuracy", ncols=120)
|
522
|
+
|
523
|
+
|
524
|
+
for inpIndex, Input in enumerate(x_test):
|
525
|
+
Input = np.array(Input)
|
526
|
+
Input = Input.ravel()
|
527
|
+
neural_layer = Input
|
528
528
|
|
529
|
-
|
529
|
+
for index, Layer in enumerate(layers):
|
530
530
|
|
531
|
-
|
532
|
-
|
531
|
+
if Layer == 'fex':
|
532
|
+
neural_layer = fex(neural_layer, W[index], False, None, activation_potentiation)
|
533
533
|
|
534
534
|
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
535
|
+
for i, w in enumerate(Wc):
|
536
|
+
W[i] = np.copy(w)
|
537
|
+
|
538
|
+
neural_layer = Softmax(neural_layer)
|
539
|
+
max_value = max(neural_layer)
|
540
540
|
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
541
|
+
predict_probabilitys.append(max_value)
|
542
|
+
|
543
|
+
|
544
|
+
RealOutput = np.argmax(y_test[inpIndex])
|
545
|
+
real_classes.append(RealOutput)
|
546
|
+
PredictedOutput = np.argmax(neural_layer)
|
547
|
+
predict_classes.append(PredictedOutput)
|
548
548
|
|
549
|
-
|
550
|
-
|
551
|
-
|
549
|
+
if RealOutput == PredictedOutput:
|
550
|
+
true += 1
|
551
|
+
acc = true / len(y_test)
|
552
552
|
|
553
553
|
|
554
|
-
|
555
|
-
|
554
|
+
acc_list.append(acc)
|
555
|
+
y_preds.append(PredictedOutput)
|
556
|
+
|
557
|
+
if bar_status == True:
|
558
|
+
test_progress.update(1)
|
559
|
+
if inpIndex == 0:
|
560
|
+
acc_bar.update(acc)
|
561
|
+
|
562
|
+
else:
|
563
|
+
acc = acc - acc_list[inpIndex - 1]
|
564
|
+
acc_bar.update(acc)
|
565
|
+
|
566
|
+
if show_metrices == True:
|
567
|
+
plot_evaluate(x_test, y_test, y_preds, acc_list)
|
556
568
|
|
557
|
-
if bar_status == True:
|
558
|
-
test_progress.update(1)
|
559
|
-
if inpIndex == 0:
|
560
|
-
acc_bar.update(acc)
|
561
|
-
|
562
|
-
else:
|
563
|
-
acc = acc - acc_list[inpIndex - 1]
|
564
|
-
acc_bar.update(acc)
|
565
569
|
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
for i, w in enumerate(Wc):
|
571
|
-
W[i] = np.copy(w)
|
572
|
-
|
573
|
-
#except:
|
570
|
+
for i, w in enumerate(Wc):
|
571
|
+
W[i] = np.copy(w)
|
572
|
+
|
573
|
+
except:
|
574
574
|
|
575
|
-
|
575
|
+
print(Fore.RED + 'ERROR:' + infoTestModel + Style.RESET_ALL)
|
576
576
|
|
577
577
|
return W, y_preds, acc
|
578
578
|
|
@@ -1607,8 +1607,7 @@ def plot_decision_boundry(x, y, y_preds=None, s=100, color='tab20'):
|
|
1607
1607
|
X_pca = x
|
1608
1608
|
|
1609
1609
|
if y_preds == None:
|
1610
|
-
y_preds = y
|
1611
|
-
|
1610
|
+
y_preds = decode_one_hot(y)
|
1612
1611
|
|
1613
1612
|
y = decode_one_hot(y)
|
1614
1613
|
num_classes = len(np.unique(y))
|
@@ -0,0 +1,6 @@
|
|
1
|
+
plan/__init__.py,sha256=SLgk4uuvhVr3CjscpcqN2TQMGyAd4Pe8YBiXfl3brd8,525
|
2
|
+
plan/plan.py,sha256=YzmhHtaEyH51NcnfZLsAtUDBClag_TFCjy67554ouQM,56261
|
3
|
+
pyerualjetwork-2.8.4.dist-info/METADATA,sha256=K9L9_hqmgaEIWjPRmTmihY6Kllp1L5mOwiGtT9fU9o0,331
|
4
|
+
pyerualjetwork-2.8.4.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
5
|
+
pyerualjetwork-2.8.4.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
|
6
|
+
pyerualjetwork-2.8.4.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
plan/__init__.py,sha256=SLgk4uuvhVr3CjscpcqN2TQMGyAd4Pe8YBiXfl3brd8,525
|
2
|
-
plan/plan.py,sha256=DUNmfjy81eQBB2gtQDLxOpTio7d8i5-H3VbietxVO-Y,56026
|
3
|
-
pyerualjetwork-2.8.2.dist-info/METADATA,sha256=YuQspdVsLubSt0LaA5vLv_tzp7Q7WzjOcvWtzK4YtP4,331
|
4
|
-
pyerualjetwork-2.8.2.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
5
|
-
pyerualjetwork-2.8.2.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
|
6
|
-
pyerualjetwork-2.8.2.dist-info/RECORD,,
|
File without changes
|
File without changes
|