pyerualjetwork 2.4.2__py3-none-any.whl → 2.4.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_bi/plan_bi.py CHANGED
@@ -96,10 +96,16 @@ def fit(
96
96
  row = x_train[1].shape[0]
97
97
  col = x_train[1].shape[1]
98
98
  except:
99
+
99
100
  print(Fore.MAGENTA + 'WARNING: You try train showing but inputs is raveled. x_train inputs to should be reshape for training_show.', infoPLAN + Style.RESET_ALL)
100
101
 
101
- row, col = find_factors(len(x_train[0]))
102
-
102
+ try:
103
+ row, col = find_numbers(len(x_train[0]))
104
+
105
+ except:
106
+ print(Fore.RED + 'ERROR: You try train showing but inputs is raveled. x_train inputs to must be reshape for training_show. Input length cannot be reshaped', infoPLAN + Style.RESET_ALL
107
+ return 'e'
108
+
103
109
  for j in range(len(class_count)):
104
110
 
105
111
  mat = trained_W[0][j,:].reshape(row, col)
@@ -142,9 +148,16 @@ def fit(
142
148
  row = x_train[1].shape[0]
143
149
  col = x_train[1].shape[1]
144
150
  except:
151
+
145
152
  print(Fore.MAGENTA + 'WARNING: You try train showing but inputs is raveled. x_train inputs to should be reshape for training_show.', infoPLAN + Style.RESET_ALL)
146
153
 
147
- row, col = find_factors(len(x_train[0]))
154
+ try:
155
+ row, col = find_numbers(len(x_train[0]))
156
+
157
+ except:
158
+
159
+ print(Fore.RED + 'ERROR: You try train showing but inputs is raveled. x_train inputs to must be reshape for training_show. Input length cannot be reshaped', infoPLAN + Style.RESET_ALL
160
+ return 'e'
148
161
 
149
162
  for j in range(len(class_count)):
150
163
 
@@ -204,6 +217,19 @@ def weight_normalization(
204
217
 
205
218
  # FUNCTIONS -----
206
219
 
220
+ def find_numbers(n):
221
+ if n <= 1:
222
+ raise ValueError("Parameter 'n' must be greater than 1.")
223
+
224
+ for i in range(2, int(n**0.5) + 1):
225
+ if n % i == 0:
226
+ factor1 = i
227
+ factor2 = n // i
228
+ if factor1 == factor2:
229
+ return factor1, factor2
230
+
231
+ return None
232
+
207
233
  def weight_identification(
208
234
  layer_count, # int: Number of layers in the neural network.
209
235
  class_count, # int: Number of classes in the classification task.
plan_di/plan_di.py CHANGED
@@ -95,10 +95,18 @@ def fit(
95
95
  try:
96
96
  row = x_train[1].shape[0]
97
97
  col = x_train[1].shape[1]
98
+
98
99
  except:
100
+
99
101
  print(Fore.MAGENTA + 'WARNING: You try train showing but inputs is raveled. x_train inputs to should be reshape for training_show.', infoPLAN + Style.RESET_ALL)
100
102
 
101
- row, col = find_factors(len(x_train[0]))
103
+ try:
104
+ row, col = find_numbers(len(x_train[0]))
105
+
106
+ except:
107
+ print(Fore.RED + 'ERROR: You try train showing but inputs is raveled. x_train inputs to must be reshape for training_show. Input length cannot be reshaped', infoPLAN + Style.RESET_ALL
108
+ return 'e'
109
+
102
110
 
103
111
  for j in range(len(class_count)):
104
112
 
@@ -138,12 +146,20 @@ def fit(
138
146
  fig, ax = plt.subplots(1, 10, figsize=(18, 14))
139
147
 
140
148
  try:
149
+
141
150
  row = x_train[1].shape[0]
142
151
  col = x_train[1].shape[1]
152
+
143
153
  except:
154
+
144
155
  print(Fore.MAGENTA + 'WARNING: You try train showing but inputs is raveled. x_train inputs to should be reshape for training_show.', infoPLAN + Style.RESET_ALL)
145
156
 
146
- row, col = find_factors(len(x_train[0]))
157
+ try:
158
+ row, col = find_numbers(len(x_train[0]))
159
+
160
+ except:
161
+ print(Fore.RED + 'ERROR: You try train showing but inputs is raveled. x_train inputs to must be reshape for training_show. Input length cannot be reshaped', infoPLAN + Style.RESET_ALL
162
+ return 'e'
147
163
 
148
164
  for j in range(len(class_count)):
149
165
 
@@ -182,31 +198,18 @@ def fit(
182
198
 
183
199
  # FUNCTIONS -----
184
200
 
185
- def prime_factors(n):
186
- factors = []
187
- divisor = 2
188
-
189
- while divisor <= n:
190
- if n % divisor == 0:
191
- factors.append(divisor)
192
- n //= divisor
193
- else:
194
- divisor += 1
195
-
196
- return factors
201
+ def find_numbers(n):
202
+ if n <= 1:
203
+ raise ValueError("Parameter 'n' must be greater than 1.")
197
204
 
198
- def find_factors(n):
199
- factors = prime_factors(n)
200
-
201
- if len(factors) < 2:
202
- return None, None
203
-
204
- a = factors[0]
205
- b = 1
206
- for factor in factors[1:]:
207
- b *= factor
208
-
209
- return a, b
205
+ for i in range(2, int(n**0.5) + 1):
206
+ if n % i == 0:
207
+ factor1 = i
208
+ factor2 = n // i
209
+ if factor1 == factor2:
210
+ return factor1, factor2
211
+
212
+ return None
210
213
 
211
214
  def weight_normalization(
212
215
  W,
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 2.4.2
3
+ Version: 2.4.4
4
4
  Summary: show_training parameter added for fit function[True, 'final' or any]. Code improvements
5
5
  Author: Hasan Can Beydili
6
6
  Author-email: tchasancan@gmail.com
@@ -0,0 +1,8 @@
1
+ plan_bi/__init__.py,sha256=kHnuGDOKyMHQqeX49ToUUsdZckh9RPuyADhYw0SrmIo,514
2
+ plan_bi/plan_bi.py,sha256=Xn-Tpxse6llDRsilb-k9JAElvRUDvdtQ3B4fnW4s5EA,53602
3
+ plan_di/__init__.py,sha256=DJzUsYj-tgbeewoGz-K9nfGsKqrRFUxIr_z-NgqySBk,505
4
+ plan_di/plan_di.py,sha256=6Jml4SeYbM7mNCNY-gJiamsqsy7HNZsDjOBYpzCHhuo,51118
5
+ pyerualjetwork-2.4.4.dist-info/METADATA,sha256=BxWIsiPEgRTrFXXVyQ_wGkTYURkAL5Q6X2YpSPKFBrI,309
6
+ pyerualjetwork-2.4.4.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
7
+ pyerualjetwork-2.4.4.dist-info/top_level.txt,sha256=aaXSOcnD62fbXG1x7tw4nV50Qxx9g9zDNLK7OD4BdPE,16
8
+ pyerualjetwork-2.4.4.dist-info/RECORD,,
@@ -1,8 +0,0 @@
1
- plan_bi/__init__.py,sha256=kHnuGDOKyMHQqeX49ToUUsdZckh9RPuyADhYw0SrmIo,514
2
- plan_bi/plan_bi.py,sha256=31YsVfHNxIwnn7q6tAA4v2nyfSanfxBM7Wt7Z2ptyhI,52589
3
- plan_di/__init__.py,sha256=DJzUsYj-tgbeewoGz-K9nfGsKqrRFUxIr_z-NgqySBk,505
4
- plan_di/plan_di.py,sha256=izbP2BuixM2bUumACPXYE66Wj6LnVbuiH3NXLMrN2EY,50514
5
- pyerualjetwork-2.4.2.dist-info/METADATA,sha256=Ege0t_siyKePfxhYLb3vhdic5wjxkD3QriA2XbttbiY,309
6
- pyerualjetwork-2.4.2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
7
- pyerualjetwork-2.4.2.dist-info/top_level.txt,sha256=aaXSOcnD62fbXG1x7tw4nV50Qxx9g9zDNLK7OD4BdPE,16
8
- pyerualjetwork-2.4.2.dist-info/RECORD,,