pyerualjetwork 2.7.9__py3-none-any.whl → 2.8.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.
- plan/Untitled-1.py +31 -0
- plan/plan.py +23 -13
- {pyerualjetwork-2.7.9.dist-info → pyerualjetwork-2.8.0.dist-info}/METADATA +2 -2
- pyerualjetwork-2.8.0.dist-info/RECORD +7 -0
- pyerualjetwork-2.7.9.dist-info/RECORD +0 -6
- {pyerualjetwork-2.7.9.dist-info → pyerualjetwork-2.8.0.dist-info}/WHEEL +0 -0
- {pyerualjetwork-2.7.9.dist-info → pyerualjetwork-2.8.0.dist-info}/top_level.txt +0 -0
plan/Untitled-1.py
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
|
2
|
+
|
3
|
+
import plan
|
4
|
+
import time
|
5
|
+
from colorama import Fore
|
6
|
+
import numpy as np
|
7
|
+
from sklearn.datasets import load_digits
|
8
|
+
|
9
|
+
# TRAIN
|
10
|
+
|
11
|
+
data = load_digits()
|
12
|
+
|
13
|
+
X = data.data
|
14
|
+
y = data.target
|
15
|
+
|
16
|
+
X = plan.normalization(X)
|
17
|
+
|
18
|
+
x_train, x_test, y_train, y_test = plan.split(X, y, 0.4, 42)
|
19
|
+
|
20
|
+
|
21
|
+
y_train, y_test = plan.encode_one_hot(y_train, y_test)
|
22
|
+
|
23
|
+
|
24
|
+
x_test, y_test = plan.auto_balancer(x_test, y_test)
|
25
|
+
|
26
|
+
|
27
|
+
W = plan.fit(x_train, y_train, val=True)
|
28
|
+
|
29
|
+
# TEST
|
30
|
+
|
31
|
+
test_model = plan.evaluate(x_test, y_test,show_metrices=True, W=W)
|
plan/plan.py
CHANGED
@@ -137,28 +137,31 @@ def fit(
|
|
137
137
|
if Layer == 'fex':
|
138
138
|
STPW[Lindex] = fex(neural_layer, STPW[Lindex], True, y[index], activation_potentiation)
|
139
139
|
|
140
|
+
STPW = normalization(STPW)
|
141
|
+
|
140
142
|
for i, w in enumerate(STPW):
|
141
143
|
LTPW[i] = LTPW[i] + w
|
142
144
|
|
143
145
|
|
144
|
-
if val == True
|
145
|
-
|
146
|
-
|
147
|
-
val_count += val_count_copy
|
146
|
+
if val == True:
|
148
147
|
|
149
|
-
validation_model = evaluate(x_val, y_val, LTPW, activation_potentiation=activation_potentiation, show_metrices=None)
|
148
|
+
validation_model = evaluate(x_val, y_val, LTPW,bar_status=False, activation_potentiation=activation_potentiation, show_metrices=None)
|
150
149
|
|
151
150
|
val_acc = validation_model[get_acc()]
|
152
151
|
val_preds = validation_model[get_preds()]
|
153
|
-
|
152
|
+
|
153
|
+
|
154
154
|
plot_decision_space(x_val, val_preds, s=100, color='tab20')
|
155
155
|
|
156
|
+
|
157
|
+
plt.pause(0.0001)
|
158
|
+
|
156
159
|
val_list.append(val_acc)
|
157
160
|
|
158
161
|
if v_iter == 0:
|
159
162
|
|
160
163
|
val_bar.update(val_acc)
|
161
|
-
|
164
|
+
pass
|
162
165
|
|
163
166
|
if v_iter != 0:
|
164
167
|
|
@@ -246,14 +249,19 @@ def fit(
|
|
246
249
|
|
247
250
|
if val == 'final':
|
248
251
|
|
249
|
-
validation_model = evaluate(x_val, y_val, LTPW, activation_potentiation
|
250
|
-
|
252
|
+
validation_model = evaluate(x_val, y_val, LTPW,bar_status=False, activation_potentiation=activation_potentiation, show_metrices=None)
|
253
|
+
|
251
254
|
val_acc = validation_model[get_acc()]
|
252
|
-
|
255
|
+
val_preds = validation_model[get_preds()]
|
256
|
+
|
257
|
+
|
258
|
+
plot_decision_space(x_val, val_preds, s=100, color='tab20')
|
259
|
+
|
253
260
|
val_list.append(val_acc)
|
254
261
|
|
255
262
|
val_bar.update(val_acc)
|
256
|
-
|
263
|
+
|
264
|
+
|
257
265
|
LTPW = normalization(LTPW)
|
258
266
|
|
259
267
|
return LTPW
|
@@ -1567,8 +1575,9 @@ def plot_decision_space(x, y, s=100, color='tab20'):
|
|
1567
1575
|
X_pca = pca(x, n_components=2)
|
1568
1576
|
else:
|
1569
1577
|
X_pca = x
|
1570
|
-
|
1571
|
-
|
1578
|
+
|
1579
|
+
|
1580
|
+
num_classes = len(np.unique(y))
|
1572
1581
|
|
1573
1582
|
|
1574
1583
|
cmap = plt.get_cmap(color)
|
@@ -1579,6 +1588,7 @@ def plot_decision_space(x, y, s=100, color='tab20'):
|
|
1579
1588
|
|
1580
1589
|
plt.draw()
|
1581
1590
|
|
1591
|
+
|
1582
1592
|
def manuel_balancer(x_train, y_train, target_samples_per_class):
|
1583
1593
|
"""
|
1584
1594
|
Generates synthetic examples to balance classes to the specified number of examples per class.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyerualjetwork
|
3
|
-
Version: 2.
|
4
|
-
Summary:
|
3
|
+
Version: 2.8.0
|
4
|
+
Summary: Code improvoments
|
5
5
|
Home-page: UNKNOWN
|
6
6
|
Author: Hasan Can Beydili
|
7
7
|
Author-email: tchasancan@gmail.com
|
@@ -0,0 +1,7 @@
|
|
1
|
+
plan/Untitled-1.py,sha256=DbHjYRG0-vHpMfNNQXZCHIKm68DzwbNnDrF9xoEr7u0,526
|
2
|
+
plan/__init__.py,sha256=WStB_zoAADCWXzIqieDZo4frPQMEZzxXnRZ6QiQKSGY,523
|
3
|
+
plan/plan.py,sha256=aZgJxaaZNyYnApF24Zj6sbGmk5D4GT2EBhAtHp1ncQk,54726
|
4
|
+
pyerualjetwork-2.8.0.dist-info/METADATA,sha256=PnX6wxeHQmH6Nf0jRcXfwTGSc7XzU1tZBTKaJC62CW8,312
|
5
|
+
pyerualjetwork-2.8.0.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
6
|
+
pyerualjetwork-2.8.0.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
|
7
|
+
pyerualjetwork-2.8.0.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
plan/__init__.py,sha256=WStB_zoAADCWXzIqieDZo4frPQMEZzxXnRZ6QiQKSGY,523
|
2
|
-
plan/plan.py,sha256=mGYaNgbEjJKjBz9zCWG2weGBHQoIXDGF2Z6prL8xGq8,54466
|
3
|
-
pyerualjetwork-2.7.9.dist-info/METADATA,sha256=CqzPI6YYfXXC46C1RtmvYun29c1wxlIAX4rK37OtMzs,364
|
4
|
-
pyerualjetwork-2.7.9.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
5
|
-
pyerualjetwork-2.7.9.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
|
6
|
-
pyerualjetwork-2.7.9.dist-info/RECORD,,
|
File without changes
|
File without changes
|