pyerualjetwork 2.5.6__py3-none-any.whl → 2.5.7__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 +43 -19
- {pyerualjetwork-2.5.6.dist-info → pyerualjetwork-2.5.7.dist-info}/METADATA +1 -1
- pyerualjetwork-2.5.7.dist-info/RECORD +6 -0
- pyerualjetwork-2.5.6.dist-info/RECORD +0 -6
- {pyerualjetwork-2.5.6.dist-info → pyerualjetwork-2.5.7.dist-info}/WHEEL +0 -0
- {pyerualjetwork-2.5.6.dist-info → pyerualjetwork-2.5.7.dist-info}/top_level.txt +0 -0
plan/plan.py
CHANGED
@@ -1,3 +1,10 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
"""
|
3
|
+
Created on Tue Jun 18 23:32:16 2024
|
4
|
+
|
5
|
+
@author: hasan
|
6
|
+
"""
|
7
|
+
|
1
8
|
# optic
|
2
9
|
|
3
10
|
# -*- coding: utf-8 -*-
|
@@ -50,7 +57,7 @@ def fit(
|
|
50
57
|
y_train (list[num]): List of target labels. (one hot encoded)
|
51
58
|
show_training (bool, str): True, None or'final'
|
52
59
|
show_count (None, int): How many learning steps in total will be displayed in a single figure? (Adjust according to your hardware) Default: 10 (optional)
|
53
|
-
val_count (None, int): After how many examples learned will an accuracy test be performed? Default:
|
60
|
+
val_count (None, int): After how many examples learned will an accuracy test be performed? Default: 0.1 (%10) (optional)
|
54
61
|
x_val (list[num]): List of validation data. (optional) Default: x_train
|
55
62
|
y_val (list[num]): (list[num]): List of target labels. (one hot encoded) (optional) Default: y_train
|
56
63
|
activation_potential (float): Input activation potential (for binary injection) (optional) in range: -1, 1
|
@@ -72,8 +79,14 @@ def fit(
|
|
72
79
|
|
73
80
|
if val == True and val_count == None:
|
74
81
|
|
75
|
-
val_count =
|
76
|
-
|
82
|
+
val_count = 0.1
|
83
|
+
val_count_copy = val_count
|
84
|
+
|
85
|
+
if val == True:
|
86
|
+
|
87
|
+
val_count = int(len(x_train) * val_count)
|
88
|
+
|
89
|
+
val_count_copy = val_count
|
77
90
|
|
78
91
|
if show_training == True or show_training == 'final' and show_count == None:
|
79
92
|
|
@@ -82,10 +95,6 @@ def fit(
|
|
82
95
|
if show_training == True or show_training == 'final':
|
83
96
|
|
84
97
|
row, col = shape_control(x_train)
|
85
|
-
|
86
|
-
if row == 0:
|
87
|
-
|
88
|
-
return 'e'
|
89
98
|
|
90
99
|
class_count = set()
|
91
100
|
|
@@ -141,7 +150,9 @@ def fit(
|
|
141
150
|
|
142
151
|
if val == True:
|
143
152
|
|
144
|
-
if index
|
153
|
+
if index == val_count:
|
154
|
+
|
155
|
+
val_count += val_count_copy
|
145
156
|
|
146
157
|
layers.append('cat')
|
147
158
|
trained_W.append(np.eye(len(class_count)))
|
@@ -170,32 +181,44 @@ def fit(
|
|
170
181
|
if show_training == True:
|
171
182
|
|
172
183
|
if index %show_count == 0:
|
173
|
-
|
174
|
-
|
184
|
+
|
185
|
+
|
186
|
+
if index != 0:
|
175
187
|
plt.close(fig)
|
176
188
|
|
177
|
-
|
189
|
+
fig, ax = plt.subplots(1, len(class_count), figsize=(18, 14))
|
178
190
|
|
191
|
+
|
179
192
|
|
180
193
|
for j in range(len(class_count)):
|
181
|
-
|
182
|
-
mat = trained_W[0][j,:].reshape(row, col)
|
183
194
|
|
195
|
+
|
196
|
+
if row != 0:
|
197
|
+
|
198
|
+
mat = trained_W[0][j,:].reshape(row, col)
|
199
|
+
suptitle_info = 'Neurons Learning Progress: % '
|
200
|
+
title_info = f'{j+1}. Neuron'
|
201
|
+
|
202
|
+
else:
|
203
|
+
|
204
|
+
mat = trained_W[0]
|
205
|
+
suptitle_info = 'Weight Learning Progress: % '
|
206
|
+
j = 0
|
207
|
+
title_info = 'Weight Matrix Of Fex Layer'
|
208
|
+
|
184
209
|
ax[j].imshow(mat, interpolation='sinc', cmap='viridis')
|
185
210
|
ax[j].set_aspect('equal')
|
186
211
|
|
187
212
|
ax[j].set_xticks([])
|
188
213
|
ax[j].set_yticks([])
|
189
|
-
ax[j].set_title(
|
214
|
+
ax[j].set_title(title_info)
|
190
215
|
|
191
216
|
progress_status = f"{progress:.1f}"
|
192
|
-
fig.suptitle(
|
217
|
+
fig.suptitle(suptitle_info + progress_status)
|
193
218
|
plt.draw()
|
194
219
|
plt.pause(0.1)
|
195
220
|
|
196
221
|
|
197
|
-
|
198
|
-
|
199
222
|
W = weight_identification(
|
200
223
|
len(layers) - 1, len(class_count), neurons, x_train_size)
|
201
224
|
|
@@ -274,7 +297,7 @@ def shape_control(x_train):
|
|
274
297
|
|
275
298
|
except:
|
276
299
|
|
277
|
-
print(Fore.RED + 'ERROR: Change show_training to None. Input length cannot be reshaped'
|
300
|
+
print(Fore.RED + 'ERROR: Change show_training to None. Input length cannot be reshaped' + Style.RESET_ALL)
|
278
301
|
return [0, 0]
|
279
302
|
|
280
303
|
return row, col
|
@@ -1661,4 +1684,5 @@ def get_preds():
|
|
1661
1684
|
|
1662
1685
|
def get_acc():
|
1663
1686
|
|
1664
|
-
return 2
|
1687
|
+
return 2
|
1688
|
+
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: pyerualjetwork
|
3
|
-
Version: 2.5.
|
3
|
+
Version: 2.5.7
|
4
4
|
Summary: New optional parameters added for fit function, x_val, y_val show_count, val_count, val. For more information please read user document
|
5
5
|
Author: Hasan Can Beydili
|
6
6
|
Author-email: tchasancan@gmail.com
|
@@ -0,0 +1,6 @@
|
|
1
|
+
plan/__init__.py,sha256=gmaz8lnQfl18MbOQwabBUPmShajK5S99jfyY-hQe8tc,502
|
2
|
+
plan/plan.py,sha256=PEmoyvZidNWiNQTanaTbFBP9dlrAD0ZqU6-83wJXPV0,55726
|
3
|
+
pyerualjetwork-2.5.7.dist-info/METADATA,sha256=BjDzrhxLKzSODDlgEr8IFeRoypwj8tmBaN3GyNot3Ww,357
|
4
|
+
pyerualjetwork-2.5.7.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
5
|
+
pyerualjetwork-2.5.7.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
|
6
|
+
pyerualjetwork-2.5.7.dist-info/RECORD,,
|
@@ -1,6 +0,0 @@
|
|
1
|
-
plan/__init__.py,sha256=gmaz8lnQfl18MbOQwabBUPmShajK5S99jfyY-hQe8tc,502
|
2
|
-
plan/plan.py,sha256=-D6-2c5OtH5DMRJX8P5NISo_DbOvpaf2rHYvFfgDI80,55021
|
3
|
-
pyerualjetwork-2.5.6.dist-info/METADATA,sha256=NyHNKEa9B2FAUGaHeM41O7aiObTgLVIb3wvc8JxcTrw,357
|
4
|
-
pyerualjetwork-2.5.6.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
|
5
|
-
pyerualjetwork-2.5.6.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
|
6
|
-
pyerualjetwork-2.5.6.dist-info/RECORD,,
|
File without changes
|
File without changes
|