pyerualjetwork 3.3.2__py3-none-any.whl → 3.3.3__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 CHANGED
@@ -42,7 +42,7 @@ def fit(
42
42
  infoPLAN = """
43
43
  Creates and configures a PLAN model.
44
44
 
45
- Args:
45
+ fit Args:
46
46
  x_train (list[num]): List or numarray of input data.
47
47
  y_train (list[num]): List or numarray of target labels. (one hot encoded)
48
48
  val (None or True): validation in training process ? None or True default: None (optional)
@@ -125,10 +125,12 @@ def fit(
125
125
  else:
126
126
 
127
127
  layers = ['fex'] * visible_layer
128
+
129
+ x_train_0 = np.array(x_train[0])
128
130
 
129
- x_train[0] = np.array(x_train[0])
130
- x_train[0] = x_train[0].ravel()
131
- x_train_size = len(x_train[0])
131
+ x_train__0_vec = x_train_0.ravel()
132
+
133
+ x_train_size = len(x_train__0_vec)
132
134
 
133
135
  if visible_layer == None:
134
136
 
@@ -167,7 +169,7 @@ def fit(
167
169
 
168
170
  inp = np.array(inp)
169
171
  inp = inp.ravel()
170
-
172
+
171
173
  if x_train_size != len(inp):
172
174
  print(Fore.RED + "ERROR304: All input matrices or vectors in x_train list, must be same size. from: fit",
173
175
  infoPLAN + Style.RESET_ALL)
@@ -585,7 +587,7 @@ def activations_list():
585
587
  spiral,
586
588
  sigmoid,
587
589
  relu,
588
- tanh,
590
+ tanh,: good for general datasets
589
591
  swish,
590
592
  circular,
591
593
  mod_circular,
@@ -607,7 +609,7 @@ def activations_list():
607
609
  isra,
608
610
  waveakt,
609
611
  arctan,
610
- bent_identity,
612
+ bent_identity,: good for image datasets
611
613
  sech,
612
614
  softsign,
613
615
  pwl,
@@ -851,13 +853,8 @@ def normalization(
851
853
  (num) Scaled input data after normalization.
852
854
  """
853
855
 
854
- AbsVector = np.abs(Input)
855
-
856
- MaxAbs = np.max(AbsVector)
857
-
858
- ScaledInput = Input / MaxAbs
859
-
860
- return ScaledInput
856
+ MaxAbs = np.max(np.abs(Input)) # Direkt maksimumu hesapla
857
+ return Input / MaxAbs # Normalizasyonu geri döndür
861
858
 
862
859
 
863
860
  def evaluate(
@@ -958,7 +955,7 @@ def evaluate(
958
955
 
959
956
  for i, w in enumerate(Wc):
960
957
  W[i] = np.copy(w)
961
-
958
+
962
959
  except:
963
960
 
964
961
  print(Fore.RED + 'ERROR:' + infoTestModel + Style.RESET_ALL)
@@ -1942,26 +1939,32 @@ def plot_evaluate(x_test, y_test, y_preds, acc_list, W, activation_potentiation)
1942
1939
  np.arange(y_min, y_max, h))
1943
1940
 
1944
1941
  grid = np.c_[xx.ravel(), yy.ravel()]
1945
- grid_full = np.zeros((grid.shape[0], x_test.shape[1]))
1946
- grid_full[:, feature_indices] = grid
1947
-
1948
- Z = [None] * len(grid_full)
1949
1942
 
1950
- predict_progress = tqdm(total=len(grid_full),leave=False, desc="Predicts For Decision Boundary",ncols= 120)
1943
+ try:
1951
1944
 
1952
- for i in range(len(grid_full)):
1945
+ grid_full = np.zeros((grid.shape[0], x_test.shape[1]))
1946
+ grid_full[:, feature_indices] = grid
1947
+
1948
+ Z = [None] * len(grid_full)
1953
1949
 
1954
- Z[i] = np.argmax(predict_model_ram(grid_full[i], W=W, activation_potentiation=activation_potentiation))
1955
- predict_progress.update(1)
1950
+ predict_progress = tqdm(total=len(grid_full),leave=False, desc="Predicts For Decision Boundary",ncols= 120)
1956
1951
 
1957
- Z = np.array(Z)
1958
- Z = Z.reshape(xx.shape)
1952
+ for i in range(len(grid_full)):
1953
+
1954
+ Z[i] = np.argmax(predict_model_ram(grid_full[i], W=W, activation_potentiation=activation_potentiation))
1955
+ predict_progress.update(1)
1959
1956
 
1960
- axs[1,1].contourf(xx, yy, Z, alpha=0.8)
1961
- axs[1,1].scatter(x_test[:, feature_indices[0]], x_test[:, feature_indices[1]], c=decode_one_hot(y_test), edgecolors='k', marker='o', s=20, alpha=0.9)
1962
- axs[1,1].set_xlabel(f'Feature {0 + 1}')
1963
- axs[1,1].set_ylabel(f'Feature {1 + 1}')
1964
- axs[1,1].set_title('Decision Boundary')
1957
+ Z = np.array(Z)
1958
+ Z = Z.reshape(xx.shape)
1959
+
1960
+ axs[1,1].contourf(xx, yy, Z, alpha=0.8)
1961
+ axs[1,1].scatter(x_test[:, feature_indices[0]], x_test[:, feature_indices[1]], c=decode_one_hot(y_test), edgecolors='k', marker='o', s=20, alpha=0.9)
1962
+ axs[1,1].set_xlabel(f'Feature {0 + 1}')
1963
+ axs[1,1].set_ylabel(f'Feature {1 + 1}')
1964
+ axs[1,1].set_title('Decision Boundary')
1965
+
1966
+ except:
1967
+ pass
1965
1968
 
1966
1969
  plt.show()
1967
1970
 
@@ -2101,7 +2104,7 @@ def manuel_balancer(x_train, y_train, target_samples_per_class):
2101
2104
  y_train = np.array(y_train)
2102
2105
  except:
2103
2106
  pass
2104
-
2107
+
2105
2108
  classes = np.arange(y_train.shape[1])
2106
2109
  class_count = len(classes)
2107
2110
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 3.3.2
3
+ Version: 3.3.3
4
4
  Summary: Code improvements
5
5
  Author: Hasan Can Beydili
6
6
  Author-email: tchasancan@gmail.com
@@ -0,0 +1,6 @@
1
+ plan/__init__.py,sha256=LuFcY0nqAzpjTDWAZn7L7-wipwMpnREqVghPiva0Xjg,548
2
+ plan/plan.py,sha256=Wf9sM9N_ibeaoiFKQGs940ysmQcb7ORLryw5I0oqT7Y,68803
3
+ pyerualjetwork-3.3.3.dist-info/METADATA,sha256=PkJreUZLFg-dTz4-kxLeFLl-XH6wclatKeejotkjQws,244
4
+ pyerualjetwork-3.3.3.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
5
+ pyerualjetwork-3.3.3.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
6
+ pyerualjetwork-3.3.3.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- plan/__init__.py,sha256=LuFcY0nqAzpjTDWAZn7L7-wipwMpnREqVghPiva0Xjg,548
2
- plan/plan.py,sha256=ZNyDnEO12v9AGYxJe691kT9NICb-NmC5AfGqnZStzRQ,68651
3
- pyerualjetwork-3.3.2.dist-info/METADATA,sha256=GrHAKJ14Qf8vKcDtPoJL3lvD0q_c-kVFUdpt9gxakGQ,244
4
- pyerualjetwork-3.3.2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
5
- pyerualjetwork-3.3.2.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
6
- pyerualjetwork-3.3.2.dist-info/RECORD,,