AbstractIntegratedModule 0.6.2__tar.gz → 0.6.3__tar.gz

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.
Files changed (21) hide show
  1. abstractintegratedmodule-0.6.3/AbstractIntegratedModule.cp313-win_amd64.pyd +0 -0
  2. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/AbstractIntegratedModule.cpython-310-aarch64-linux-gnu.so +0 -0
  3. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/AbstractIntegratedModule.cpython-312-x86_64-linux-gnu.so +0 -0
  4. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3/AbstractIntegratedModule.egg-info}/PKG-INFO +4 -3
  5. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/AbstractIntegratedModule.py +22 -10
  6. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/AbstractOptimizedModules.c +152 -152
  7. {abstractintegratedmodule-0.6.2/AbstractIntegratedModule.egg-info → abstractintegratedmodule-0.6.3}/PKG-INFO +4 -3
  8. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/README.md +3 -2
  9. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/setup.py +1 -1
  10. abstractintegratedmodule-0.6.2/AbstractIntegratedModule.cp313-win_amd64.pyd +0 -0
  11. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/AbstractIntegratedModule.egg-info/SOURCES.txt +0 -0
  12. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/AbstractIntegratedModule.egg-info/dependency_links.txt +0 -0
  13. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/AbstractIntegratedModule.egg-info/requires.txt +0 -0
  14. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/AbstractIntegratedModule.egg-info/top_level.txt +0 -0
  15. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/AbstractOptimizedModules.cp313-win_amd64.pyd +0 -0
  16. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/AbstractOptimizedModules.cpython-310-aarch64-linux-gnu.so +0 -0
  17. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/AbstractOptimizedModules.cpython-312-x86_64-linux-gnu.so +0 -0
  18. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/AbstractOptimizedModules.pyx +0 -0
  19. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/MANIFEST.in +0 -0
  20. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/pyproject.toml +0 -0
  21. {abstractintegratedmodule-0.6.2 → abstractintegratedmodule-0.6.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AbstractIntegratedModule
3
- Version: 0.6.2
3
+ Version: 0.6.3
4
4
  Summary: Library for Advanced Integrated Non-LLM AI Models - Optimized Backend Framework For Non-LLM AI Agent
5
5
  Author: Micro-Novelty
6
6
  Author-email: hernikpuspita5@gmail.com
@@ -42,7 +42,7 @@ https://github.com/Micro-Novelty/IntegratedPipeline-Specialized-Non-LLM-AI-Agent
42
42
  #### Note: The README here you are reading is a direct copy from my README Repository, to download the necessary files, you can visit my Repository with the provided link above.
43
43
 
44
44
  ### Library Short Description:
45
- - Development Stage: 0.6.2 Official Release.
45
+ - Development Stage: 0.6.3 Official Release.
46
46
  - Maintainer: Micro-Novelty.
47
47
  - library Source-Code is Open-sourced on github.
48
48
  - Purpose: Specifically Designed for providing Non-LLM AI Agent Framework for edge Devices, Optimized for ARM64 architecture.
@@ -67,10 +67,11 @@ https://github.com/Micro-Novelty/IntegratedPipeline-Specialized-Non-LLM-AI-Agent
67
67
  - Robust Advanced prediction capabilities proven effective on ARM64 Using MLP + LSTM Architectures.
68
68
  - Transformer Modules Optimized using Cython, to reduce Memory overhead and Reduce CPU Usage, With Reduced Training Time.
69
69
  - Changelog:
70
- - v0.6.2:
70
+ - v0.6.3:
71
71
  - [=] New features:
72
72
  - Ensure proper shape handling before shape alignment in Transformer Training.
73
73
  - Fixed Silent bugs that can cause single scalar to bypass shape conditions gate in training step for Transformer.
74
+ - Ensure Robustness in LSTM Training step to prevent division by zero.
74
75
 
75
76
  -----
76
77
 
@@ -2044,6 +2044,8 @@ class LSTMEngine:
2044
2044
 
2045
2045
  # ── MC dropout forward ────────────────────
2046
2046
  def _mc_forward(self, x_seq: np.ndarray) -> np.ndarray:
2047
+
2048
+ eps = 1e-5
2047
2049
  T = x_seq.shape[0]
2048
2050
  H = self.model.cell.hidden_size
2049
2051
  expected_input = self.model.cell.input_size
@@ -2065,7 +2067,7 @@ class LSTMEngine:
2065
2067
  preds = np.empty(T) # preallocate output
2066
2068
 
2067
2069
  # precompute dropout scale factor
2068
- inv_keep = 1.0 / (1.0 - p)
2070
+ inv_keep = 1.0 / (1.0 - p) + eps
2069
2071
 
2070
2072
  for t in range(T):
2071
2073
  x = x_seq[t]
@@ -2253,12 +2255,16 @@ class LSTMEngine:
2253
2255
  # LSTM training loop with confidence layers integrated into the loss and validation monitoring.
2254
2256
  def fit_stm(self, X, Y, epochs=50, hidden=32, lr=5e-3, seq_len=20, print_every=5):
2255
2257
  print("[= =] Training LSTM with confidence layers (MC dropout + gate uncertainty + prediction intervals)")
2256
-
2258
+
2259
+ eps = 1e-3
2257
2260
  model = self.model
2258
2261
  AME = self.pipeline.AME_Encoder(X)
2259
2262
  AMR = 1.0 / (1.0 + np.exp(-AME))
2260
2263
 
2261
2264
  n_train = int((1.0 - AMR) * len(X))
2265
+ if np.isnan(n_train) or np.isinf(n_train) or n_train <= eps:
2266
+ n_train = self.pipeline.confidence_threshold + eps
2267
+
2262
2268
  X_tr, Y_tr = X[:n_train], Y[:n_train]
2263
2269
  X_te, Y_te = X[n_train:], Y[n_train:]
2264
2270
 
@@ -2270,7 +2276,7 @@ class LSTMEngine:
2270
2276
  for j in idx:
2271
2277
  loss, _ = model.train_step(X_tr[j], Y_tr[j], lr=lr, AMR=AMR)
2272
2278
  epoch_loss += loss
2273
- epoch_loss /= n_train
2279
+ epoch_loss /= n_train + eps
2274
2280
 
2275
2281
  if epoch % print_every == 0 or epoch == 1:
2276
2282
  # validation
@@ -2288,7 +2294,10 @@ class LSTMEngine:
2288
2294
  Y_te = Y_te[:preds.shape[0], :preds.shape[1]]
2289
2295
  preds = preds[:Y_te.shape[0], :Y_te.shape[1]]
2290
2296
 
2291
- val_loss += AMR * np.mean((preds - Y_te[j]) ** 2)
2297
+ val_loss += AMR * np.mean((preds - Y_te[j]) ** 2)
2298
+ # calculates how much value loss when multiplied by model error rate
2299
+ # to gain how much the model can greatly applied its losses efficiently vs the possible error rate during prediction.
2300
+ # Higher val_loss correlates to the model possible bad predicted capabilities in the future Training
2292
2301
  val_loss /= len(X_te)
2293
2302
  print(f"[=] Epoch {epoch:>4}/{epochs} "
2294
2303
  f"[=] train_loss={epoch_loss:.6f} val_loss={val_loss:.6f}")
@@ -2404,6 +2413,9 @@ class LSTMEngine:
2404
2413
  AMR = 1.0 / (1.0 + np.exp(-AME)) # abstract modelling rate
2405
2414
  point = preds_clean[:, 0] # (T,)
2406
2415
 
2416
+ if np.isnan(AMR) or np.isinf(AMR) or AMR <= 1e-10:
2417
+ AMR = self.pipeline.confidence_threshold + 1e-5
2418
+
2407
2419
  # ── MC dropout sampling ───────────────
2408
2420
  samples = np.stack([
2409
2421
  self._mc_forward(x_seq) for _ in range(self.n_samples)
@@ -2471,12 +2483,12 @@ class LSTMEngine:
2471
2483
  print("\n┌─────────────────────────────────────────┐")
2472
2484
  print(" │ LSTM Architecture Summary │")
2473
2485
  print(" ├─────────────────────────────────────────┤")
2474
- print(f" │ Input size : {I:<24}│")
2475
- print(f" │ Hidden size : {H:<24}│")
2476
- print(f" │ Output size : {O:<24}│")
2477
- print(f" │ LSTM params : {W_params:<24,}│")
2478
- print(f" │ Linear params : {Wy_params:<24,}│")
2479
- print(f" │ Total params : {total:<24,}│")
2486
+ print(f" │ Input size : {I:<24} │")
2487
+ print(f" │ Hidden size : {H:<24} │")
2488
+ print(f" │ Output size : {O:<24} │")
2489
+ print(f" │ LSTM params : {W_params:<24,} │")
2490
+ print(f" │ Linear params : {Wy_params:<24,} │")
2491
+ print(f" │ Total params : {total:<24,} │")
2480
2492
  print(" └─────────────────────────────────────────┘")
2481
2493
 
2482
2494