AbstractIntegratedModule 1.3.2__tar.gz → 1.3.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 (23) hide show
  1. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/AbstractIntegratedModule.egg-info/PKG-INFO +1 -1
  2. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/AbstractIntegratedModule.py +84 -80
  3. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/AbstractOptimizedModules.c +6 -6
  4. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/PKG-INFO +1 -1
  5. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/pyproject.toml +1 -1
  6. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/setup.py +1 -1
  7. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/AbstractIntegratedModule.egg-info/SOURCES.txt +0 -0
  8. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/AbstractIntegratedModule.egg-info/dependency_links.txt +0 -0
  9. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/AbstractIntegratedModule.egg-info/requires.txt +0 -0
  10. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/AbstractIntegratedModule.egg-info/top_level.txt +0 -0
  11. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/AbstractOptimizedModules.pyx +0 -0
  12. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/MANIFEST.in +0 -0
  13. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/README.md +0 -0
  14. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/abstract_model_storage/Cargo.toml +0 -0
  15. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/abstract_model_storage/pyproject.toml +0 -0
  16. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/abstract_model_storage/src/lib.rs +0 -0
  17. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/abstract_model_storage/target/debug/build/libsqlite3-sys-ed07b882cd2aa5e2/out/bindgen.rs +0 -0
  18. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/abstract_model_storage/target/debug/build/serde_core-ebc15f2e9cad7f5f/out/private.rs +0 -0
  19. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/abstract_model_storage/target/debug/build/target-lexicon-08527f45de28143d/out/host.rs +0 -0
  20. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/abstract_model_storage/target/release/build/libsqlite3-sys-bf0400df4523274c/out/bindgen.rs +0 -0
  21. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/abstract_model_storage/target/release/build/serde_core-5cdb76131825e4af/out/private.rs +0 -0
  22. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/abstract_model_storage/target/release/build/target-lexicon-43eb95a0588bf457/out/host.rs +0 -0
  23. {abstractintegratedmodule-1.3.2 → abstractintegratedmodule-1.3.3}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AbstractIntegratedModule
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: IntegratedPipeline Specifically provide a Framework to build Stateful continual learning Machine Learning Models optimized for Edge devices (ARM64).
5
5
  Author: Micro-Novelty
6
6
  Author-email: Micro-Novelty <hernikpuspita5@gmail.com>
@@ -2733,12 +2733,14 @@ class Transformer(TargetMemoryMixin):
2733
2733
 
2734
2734
  B, S, D = batch_size, seq_len, d_model
2735
2735
  M = D // self.n_heads
2736
- Q = optimized_project_heads(x, Wq_c, B, S, self.n_heads, D, M)
2737
- K = optimized_project_heads(x, Wk_c, B, S, self.n_heads, D, M)
2738
- V = optimized_project_heads(x, Wv_c, B, S, self.n_heads, D, M)
2736
+ Q = optimized_project_heads(x_c, Wq_c, B, S, self.n_heads, D, M)
2737
+ K = optimized_project_heads(x_c, Wk_c, B, S, self.n_heads, D, M)
2738
+ V = optimized_project_heads(x_c, Wv_c, B, S, self.n_heads, D, M)
2739
2739
  except Exception as e:
2740
- print(f'[>] Error in optimize project head: {e}')
2741
- continue
2740
+ print(f'[TRANSFORMER] Error in optimize project head: {e}')
2741
+ Q = np.einsum('bsd,hdm->bhsm', x, W_q_mix)
2742
+ K = np.einsum('bsd,hdm->bhsm', x, W_k_mix)
2743
+ V = np.einsum('bsd,hdm->bhsm', x, W_v_mix)
2742
2744
 
2743
2745
  else:
2744
2746
  Q = np.einsum('bsd,hdm->bhsm', x, W_q_mix)
@@ -8000,11 +8002,11 @@ class ExplainabilityModule:
8000
8002
  })
8001
8003
 
8002
8004
  print('=== DECISION HISTORY REPORT ===')
8003
- print(f'[=] ID: {history['id']}')
8004
- print(f'[=] Timestamp: {history['timestamp']}')
8005
- print(f'[=] Processed Input: {history['input']}')
8006
- print(f'[=] Prediction: {history['prediction']}')
8007
- print(f'[=] Confidence: {history['confidence']}')
8005
+ print(f"[=] ID: {history['id']}")
8006
+ print(f"[=] Timestamp: {history['timestamp']}")
8007
+ print(f"[=] Processed Input: {history['input']}")
8008
+ print(f"[=] Prediction: {history['prediction']}")
8009
+ print(f"[=] Confidence: {history['confidence']}")
8008
8010
 
8009
8011
  return history
8010
8012
 
@@ -15599,12 +15601,12 @@ class IntegratedPipeline:
15599
15601
  list_probs.append(peer_probs)
15600
15602
 
15601
15603
  for vote in votes:
15602
- print(f'[+] Prediction: {vote['prediction']}')
15603
- print(f'[+] Confidence: {vote['confidence']}')
15604
- print(f'[+] Trust: {vote['trust_score']}')
15605
- if vote['confidence'] > self.confidence_threshold:
15604
+ print(f'[+] Prediction: {vote["prediction"]}')
15605
+ print(f'[+] Confidence: {vote["confidence"]}')
15606
+ print(f'[+] Trust: {vote["trust_score"]}')
15607
+ if vote["confidence"] > self.confidence_threshold:
15606
15608
  for i in range(len(probs)):
15607
- probs = probs[i] * (1.0 + vote['trust_score'] * vote['confidence'])
15609
+ probs = probs[i] * (1.0 + vote["trust_score"] * vote["confidence"])
15608
15610
  probs = probs.copy() / np.sum(probs) # Normalize after adjustment
15609
15611
  else:
15610
15612
  print(f'[-] No alive agents found, Total: {alive_agents} Agent found. Using local prediction only.')
@@ -23468,7 +23470,7 @@ class PipelinePredictionManager:
23468
23470
 
23469
23471
  return result, cached['prediction'], cached['confidence']
23470
23472
  else:
23471
- print(f'[!] Similarity: {cached['similarity']} is low, Cannot pick label due to low certainty, Initiating advanced prediction...')
23473
+ print(f'[!] Similarity: {cached["similarity"]} is low, Cannot pick label due to low certainty, Initiating advanced prediction...')
23472
23474
  target_probs = mlp_probs.copy()
23473
23475
  else:
23474
23476
  print('[=] No verified output from cache available that matched samples, starting advanced prediction...')
@@ -24307,73 +24309,77 @@ class PipelinePredictionManager:
24307
24309
  total_with_expected = 0
24308
24310
  X_samples, input_ids = payload['X_samples'], payload['input_ids']
24309
24311
 
24310
- if self.error_counts is None or len(self.error_counts) < 1:
24312
+ if self.error_counts is None and self.label_map is not None:
24311
24313
  self.error_counts = np.zeros(len(self.label_map), dtype=np.float32)
24312
24314
 
24313
- for idx, result in enumerate(results):
24314
- print(f"\n{idx+1}. 📌 '{result['title']}'")
24315
- if result.get('expected'):
24316
- total_with_expected += 1
24317
- status = ": ✅" if result['predicted'] == result['expected'] else ": ❌"
24318
- print(f"[=] First Expectation: {result['expected']} || Model Answer: {status}")
24319
-
24320
- if 'sec_predicted' in result:
24321
- sec_status = ": ✅" if result['sec_predicted'] == result['expected'] else ": ❌"
24322
- print(f"[=] Second Expectation: {result['expected']} || Model Answer: {sec_status}")
24323
- if 'sec_predicted' in result and 'sec_confidence' in result and result['sec_predicted'] == result['expected']:
24324
- self.pipeline.accurate_cache_lookup.add_verified(
24325
- X_samples, input_ids,
24326
- result['sec_predicted'], result['sec_confidence'], result['sec_index'],
24327
- source='automatic_verified')
24328
-
24329
- sec_correct += 1
24315
+ if self.error_counts is not None and self.label_map is not None:
24316
+ for idx, result in enumerate(results):
24317
+ print(f"\n{idx+1}. 📌 '{result['title']}'")
24318
+ if result.get('expected'):
24319
+ total_with_expected += 1
24320
+ status = ": ✅" if result['predicted'] == result['expected'] else ": ❌"
24321
+ print(f"[=] First Expectation: {result['expected']} || Model Answer: {status}")
24322
+
24323
+ if 'sec_predicted' in result:
24324
+ sec_status = ": ✅" if result['sec_predicted'] == result['expected'] else ": ❌"
24325
+ print(f"[=] Second Expectation: {result['expected']} || Model Answer: {sec_status}")
24326
+ if 'sec_predicted' in result and 'sec_confidence' in result and result['sec_predicted'] == result['expected']:
24327
+ self.pipeline.accurate_cache_lookup.add_verified(
24328
+ X_samples, input_ids,
24329
+ result['sec_predicted'], result['sec_confidence'], result['sec_index'],
24330
+ source='automatic_verified')
24331
+
24332
+ sec_correct += 1
24333
+ else:
24334
+ error += 1
24335
+ if result.get('predicted_idx') < len(self.error_counts):
24336
+ if isinstance(self.error_counts[result.get('predicted_idx')], (int, float)):
24337
+ self.error_counts[result.get('predicted_idx')] += 1.0
24338
+
24339
+ if result['predicted'] == result['expected']:
24340
+ if 'sec_index' in result and result['sec_index'] is None:
24341
+ result['sec_index'] = None
24342
+
24343
+ if 'predicted_idx' in result and 'confidence' in result and 'predicted' in result:
24344
+ self.pipeline.accurate_cache_lookup.add_verified(
24345
+ X_samples, input_ids,
24346
+ result['predicted'], result['confidence'], result['predicted_idx'],
24347
+ source='automatic_verified')
24348
+ correct += 1
24330
24349
  else:
24331
24350
  error += 1
24332
24351
  if result.get('predicted_idx') < len(self.error_counts):
24333
- if isinstance(self.error_counts[result.get('predicted_idx')], (int, float)):
24352
+ if len(self.error_counts) > 0 and isinstance(self.error_counts[result.get('predicted_idx')], (int, float)):
24334
24353
  self.error_counts[result.get('predicted_idx')] += 1.0
24354
+
24355
+ # Agreement indicator
24356
+ agree_symbol = "✓" if result.get('models_agree', True) else "⚠️"
24357
+ print(f"[=] {agree_symbol} FINAL: {result['predicted']} ({result['confidence']:.1%})")
24335
24358
 
24336
- if result['predicted'] == result['expected']:
24337
- if 'sec_index' in result and result['sec_index'] is None:
24338
- result['sec_index'] = None
24339
-
24340
- if 'predicted_idx' in result and 'confidence' in result and 'predicted' in result:
24341
- self.pipeline.accurate_cache_lookup.add_verified(
24342
- X_samples, input_ids,
24343
- result['predicted'], result['confidence'], result['predicted_idx'],
24344
- source='automatic_verified')
24345
- correct += 1
24346
- else:
24347
- error += 1
24348
- if result.get('predicted_idx') < len(self.error_counts):
24349
- if len(self.error_counts) > 0 and isinstance(self.error_counts[result.get('predicted_idx')], (int, float)):
24350
- self.error_counts[result.get('predicted_idx')] += 1.0
24351
-
24352
- # Agreement indicator
24353
- agree_symbol = "✓" if result.get('models_agree', True) else "⚠️"
24354
- print(f"[=] {agree_symbol} FINAL: {result['predicted']} ({result['confidence']:.1%})")
24355
-
24356
- # MLP vs Transformer
24357
- print(f" ├─ [⚡] MLP: {result['mlp_prediction']} ({result['mlp_confidence']:.1%})")
24358
- if result.get('transformer_prediction'):
24359
- arrow = "⬆️" if result['transformer_confidence'] > result['mlp_confidence'] else "⬇️"
24360
- print(f" └─ [🌀] Transformer: {result['transformer_prediction']} ({result['transformer_confidence']:.1%}) {arrow}")
24361
-
24362
- # Top predictions
24363
- if 'top_predictions' in result:
24364
- print(f"\n [🔍] Top {top_k} possibilities:")
24365
- for j, pred in enumerate(result['top_predictions'][:top_k], 1):
24366
- bar = '█' * int(pred['confidence'] * 20)
24367
- print(f" {j}. {pred['label']:20s} {bar} {pred['confidence']:.1%}")
24368
-
24369
- if total_with_expected > 0:
24370
- accuracy = correct / total_with_expected
24371
- print(f"\n📊 Accuracy: {correct}/{total_with_expected} = {accuracy:.1%}")
24372
- if accuracy > acc_threshold:
24373
- if self.pipeline.lstm_engine:
24374
- self.pipeline.storage.save_weights(self.pipeline.memory_name, model_type='Pipeline')
24375
-
24376
- return correct, sec_correct
24359
+ # MLP vs Transformer
24360
+ print(f" ├─ [⚡] MLP: {result['mlp_prediction']} ({result['mlp_confidence']:.1%})")
24361
+ if result.get('transformer_prediction'):
24362
+ arrow = "⬆️" if result['transformer_confidence'] > result['mlp_confidence'] else "⬇️"
24363
+ print(f" └─ [🌀] Transformer: {result['transformer_prediction']} ({result['transformer_confidence']:.1%}) {arrow}")
24364
+
24365
+ # Top predictions
24366
+ if 'top_predictions' in result:
24367
+ print(f"\n [🔍] Top {top_k} possibilities:")
24368
+ for j, pred in enumerate(result['top_predictions'][:top_k], 1):
24369
+ bar = '█' * int(pred['confidence'] * 20)
24370
+ print(f" {j}. {pred['label']:20s} {bar} {pred['confidence']:.1%}")
24371
+
24372
+ if total_with_expected > 0:
24373
+ accuracy = correct / total_with_expected
24374
+ print(f"\n📊 Accuracy: {correct}/{total_with_expected} = {accuracy:.1%}")
24375
+ if accuracy > acc_threshold:
24376
+ if self.pipeline.lstm_engine:
24377
+ self.pipeline.storage.save_weights(self.pipeline.memory_name, model_type='Pipeline')
24378
+
24379
+ return correct, sec_correct
24380
+ else:
24381
+ print('[>] Display hybrid results is skipped due to unmet conditions.')
24382
+ return correct, sec_correct
24377
24383
 
24378
24384
  class ConsecutivePeerAgent:
24379
24385
  """
@@ -24723,8 +24729,8 @@ class ConsecutivePeerAgent:
24723
24729
  peer_results.append(result)
24724
24730
 
24725
24731
  print(f"[ConsecutivePeerAgent] Peer {host}:{port}: {result['prediction']} ({result['confidence']:.1%})")
24726
- print(f'[==] Local result: {local_result['prediction']} With Confidence: {local_result['confidence']}')
24727
- print(f'[==] Peer result: {result['prediction']} With Confidence: {result['confidence']}')
24732
+ print(f"[==] Local result: {local_result['prediction']} With Confidence: {local_result['confidence']}")
24733
+ print(f'[==] Peer result: {result["prediction"]} With Confidence: {result["confidence"]}')
24728
24734
 
24729
24735
  if peer_results:
24730
24736
  best_peer = max(peer_results, key=lambda x: x['confidence'])
@@ -26154,8 +26160,6 @@ async def run_secure_agent_cluster(pipeline,test_titles, label_map, rules, X=Non
26154
26160
 
26155
26161
  # Get API keys
26156
26162
  api_key = agent1.get_api_key()
26157
- print(f"\n🔑 Using API Key: {api_key[:20]}...")
26158
-
26159
26163
  texts = {"test_titles": test_titles, "label_map": label_map, "rules": rules, "X":X, "y":y, "use_transformer": True, "agent_id": agent_id}
26160
26164
 
26161
26165
  if daily is not None:
@@ -4,14 +4,14 @@
4
4
  {
5
5
  "distutils": {
6
6
  "depends": [
7
- "C:\\Users\\Dell\\AppData\\Local\\Temp\\build-env-yfnrhwmw\\Lib\\site-packages\\numpy\\_core\\include\\numpy\\arrayobject.h",
8
- "C:\\Users\\Dell\\AppData\\Local\\Temp\\build-env-yfnrhwmw\\Lib\\site-packages\\numpy\\_core\\include\\numpy\\arrayscalars.h",
9
- "C:\\Users\\Dell\\AppData\\Local\\Temp\\build-env-yfnrhwmw\\Lib\\site-packages\\numpy\\_core\\include\\numpy\\ndarrayobject.h",
10
- "C:\\Users\\Dell\\AppData\\Local\\Temp\\build-env-yfnrhwmw\\Lib\\site-packages\\numpy\\_core\\include\\numpy\\ndarraytypes.h",
11
- "C:\\Users\\Dell\\AppData\\Local\\Temp\\build-env-yfnrhwmw\\Lib\\site-packages\\numpy\\_core\\include\\numpy\\ufuncobject.h"
7
+ "C:\\Users\\Dell\\AppData\\Local\\Temp\\build-env-7dbx8614\\Lib\\site-packages\\numpy\\_core\\include\\numpy\\arrayobject.h",
8
+ "C:\\Users\\Dell\\AppData\\Local\\Temp\\build-env-7dbx8614\\Lib\\site-packages\\numpy\\_core\\include\\numpy\\arrayscalars.h",
9
+ "C:\\Users\\Dell\\AppData\\Local\\Temp\\build-env-7dbx8614\\Lib\\site-packages\\numpy\\_core\\include\\numpy\\ndarrayobject.h",
10
+ "C:\\Users\\Dell\\AppData\\Local\\Temp\\build-env-7dbx8614\\Lib\\site-packages\\numpy\\_core\\include\\numpy\\ndarraytypes.h",
11
+ "C:\\Users\\Dell\\AppData\\Local\\Temp\\build-env-7dbx8614\\Lib\\site-packages\\numpy\\_core\\include\\numpy\\ufuncobject.h"
12
12
  ],
13
13
  "include_dirs": [
14
- "C:\\Users\\Dell\\AppData\\Local\\Temp\\build-env-yfnrhwmw\\Lib\\site-packages\\numpy\\_core\\include"
14
+ "C:\\Users\\Dell\\AppData\\Local\\Temp\\build-env-7dbx8614\\Lib\\site-packages\\numpy\\_core\\include"
15
15
  ],
16
16
  "name": "AbstractOptimizedModules",
17
17
  "sources": [
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AbstractIntegratedModule
3
- Version: 1.3.2
3
+ Version: 1.3.3
4
4
  Summary: IntegratedPipeline Specifically provide a Framework to build Stateful continual learning Machine Learning Models optimized for Edge devices (ARM64).
5
5
  Author: Micro-Novelty
6
6
  Author-email: Micro-Novelty <hernikpuspita5@gmail.com>
@@ -8,7 +8,7 @@ name = "AbstractIntegratedModule"
8
8
  authors = [
9
9
  {name = "Micro-Novelty", email = "hernikpuspita5@gmail.com"},
10
10
  ]
11
- version = "1.3.2"
11
+ version = "1.3.3"
12
12
  description = "IntegratedPipeline Specifically provide a Framework to build Stateful continual learning Machine Learning Models optimized for Edge devices (ARM64)."
13
13
  readme = "readme-docs/README-AIM-1.md"
14
14
  license = "MIT"
@@ -24,7 +24,7 @@ extensions = [
24
24
 
25
25
  setup(
26
26
  name="AbstractIntegratedModule",
27
- version="1.3.2",
27
+ version="1.3.3",
28
28
  description="IntegratedPipeline Specifically provide a Framework to build Stateful continual learning Machine Learning Models optimized for Edge devices (ARM64).",
29
29
  long_description=long_description,
30
30
  long_description_content_type="text/markdown",