pyerualjetwork 2.5__py3-none-any.whl → 2.5.2__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
@@ -1,3 +1,6 @@
1
+ # -*- coding: utf-8 -*-
2
+
3
+
1
4
 
2
5
  """
3
6
  Created on Thu Jun 12 00:00:00 2024
@@ -95,7 +98,7 @@ def fit(
95
98
  for i, w in enumerate(W):
96
99
  trained_W[i] = trained_W[i] + w
97
100
 
98
- if show_training == True or 'final':
101
+ if show_training == True or show_training == 'final':
99
102
 
100
103
  try:
101
104
  row = x_train[1].shape[0]
@@ -854,17 +857,26 @@ def predict_model_ssd(Input, model_name, model_path):
854
857
  ndarray: Output from the model.
855
858
  """
856
859
  W, df = load_model(model_name, model_path)
857
-
858
- scaler_params = str(df['STANDARD SCALER'].iloc[0])
859
- activation_potential = str(df['ACTIVATION POTENTIAL'].iloc[0])
860
860
 
861
- if activation_potential != 'None':
862
-
861
+ activation_potential = str(df['ACTIVATION POTENTIAL'].iloc[0])
862
+
863
+ if activation_potential != 'nan':
864
+
863
865
  activation_potential = float(activation_potential)
866
+
867
+ try:
864
868
 
865
- if scaler_params != None:
869
+ scaler_params = df['STANDARD SCALER'].tolist()
870
+
871
+
872
+ scaler_params = [np.fromstring(arr.strip('[]'), sep=' ') for arr in scaler_params]
866
873
 
867
874
  Input = standard_scaler(None, Input, scaler_params)
875
+
876
+ except:
877
+
878
+ non_scaled = True
879
+
868
880
 
869
881
  layers = ['fex', 'cat']
870
882
 
@@ -907,7 +919,7 @@ def predict_model_ram(Input, scaler_params, W, activation_potential=None):
907
919
  Returns:
908
920
  ndarray: Output from the model.
909
921
  """
910
-
922
+
911
923
  if scaler_params != None:
912
924
 
913
925
  Input = standard_scaler(None, Input, scaler_params)
@@ -1055,35 +1067,37 @@ def standard_scaler(x_train, x_test, scaler_params=None):
1055
1067
  """
1056
1068
  try:
1057
1069
 
1058
- if scaler_params == None and x_test != None:
1059
-
1060
- mean = np.mean(x_train, axis=0)
1061
- std = np.std(x_train, axis=0)
1062
- train_data_scaled = (x_train - mean) / std
1063
- test_data_scaled = (x_test - mean) / std
1064
-
1065
- scaler_params = [mean, std]
1066
-
1067
- return scaler_params, train_data_scaled, test_data_scaled
1070
+ if scaler_params == None and x_test != None:
1068
1071
 
1069
- if scaler_params == None and x_test == None:
1070
-
1071
- mean = np.mean(x_train, axis=0)
1072
- std = np.std(x_train, axis=0)
1073
- train_data_scaled = (x_train - mean) / std
1074
-
1075
- scaler_params = [mean, std]
1076
-
1077
- return scaler_params, train_data_scaled
1078
-
1079
- if scaler_params != None:
1080
- test_data_scaled = (x_test - scaler_params[0]) / scaler_params[1]
1081
- return test_data_scaled
1072
+ mean = np.mean(x_train, axis=0)
1073
+ std = np.std(x_train, axis=0)
1074
+ train_data_scaled = (x_train - mean) / std
1075
+ test_data_scaled = (x_test - mean) / std
1076
+
1077
+ scaler_params = [mean, std]
1078
+
1079
+ return scaler_params, train_data_scaled, test_data_scaled
1080
+
1081
+ if scaler_params == None and x_test == None:
1082
+
1083
+ mean = np.mean(x_train, axis=0)
1084
+ std = np.std(x_train, axis=0)
1085
+ train_data_scaled = (x_train - mean) / std
1086
+
1087
+ scaler_params = [mean, std]
1088
+
1089
+ return scaler_params, train_data_scaled
1090
+
1091
+ if scaler_params != None:
1092
+
1093
+ test_data_scaled = (x_test - scaler_params[0]) / scaler_params[1]
1094
+ return test_data_scaled
1082
1095
 
1083
1096
  except:
1084
1097
  print(
1085
1098
  Fore.RED + "ERROR: x_train and x_test must be list[numpyarray] from standard_scaler" + info_standard_scaler)
1086
1099
 
1100
+
1087
1101
  def encode_one_hot(y_train, y_test):
1088
1102
  info_one_hot_encode = """
1089
1103
  Performs one-hot encoding on y_train and y_test data..
@@ -1563,4 +1577,4 @@ def get_preds():
1563
1577
 
1564
1578
  def get_acc():
1565
1579
 
1566
- return 2
1580
+ return 2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pyerualjetwork
3
- Version: 2.5
3
+ Version: 2.5.2
4
4
  Summary: plan_di and plan_bi merged to 'plan'. use 'import plan
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=lJlD0zpXgaKL6mEigJnXI9DI335Wtt2FkcPQr9SdikQ,53104
3
+ pyerualjetwork-2.5.2.dist-info/METADATA,sha256=esuX2RhdqSjuSWNEk6sXTTT-Ema9Uvx8oMEqMrojEmw,276
4
+ pyerualjetwork-2.5.2.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
5
+ pyerualjetwork-2.5.2.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
6
+ pyerualjetwork-2.5.2.dist-info/RECORD,,
@@ -1,6 +0,0 @@
1
- plan/__init__.py,sha256=gmaz8lnQfl18MbOQwabBUPmShajK5S99jfyY-hQe8tc,502
2
- plan/plan.py,sha256=vJRHBcDUPJNAE_5PGQBu0z7CiFFDXO7Cal3udtUIUAo,52965
3
- pyerualjetwork-2.5.dist-info/METADATA,sha256=OnIEx-tI8yBkw7FqTpM_q-2Ga1PcBoekF_BuG_BslWA,274
4
- pyerualjetwork-2.5.dist-info/WHEEL,sha256=2wepM1nk4DS4eFpYrW1TTqPcoGNfHhhO_i5m4cOimbo,92
5
- pyerualjetwork-2.5.dist-info/top_level.txt,sha256=G0Al3HuNJ88434XneyDtRKAIUaLCizOFYFYNhd7e2OM,5
6
- pyerualjetwork-2.5.dist-info/RECORD,,