AbstractIntegratedModule 0.3.5__tar.gz → 0.3.7__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.
- abstractintegratedmodule-0.3.7/AbstractIntegratedModule.cp313-win_amd64.pyd +0 -0
- {abstractintegratedmodule-0.3.5 → abstractintegratedmodule-0.3.7}/AbstractIntegratedModule.cpython-310-aarch64-linux-gnu.so +0 -0
- {abstractintegratedmodule-0.3.5 → abstractintegratedmodule-0.3.7}/AbstractIntegratedModule.cpython-312-x86_64-linux-gnu.so +0 -0
- {abstractintegratedmodule-0.3.5 → abstractintegratedmodule-0.3.7/AbstractIntegratedModule.egg-info}/PKG-INFO +2 -2
- {abstractintegratedmodule-0.3.5 → abstractintegratedmodule-0.3.7}/AbstractIntegratedModule.py +56 -51
- {abstractintegratedmodule-0.3.5/AbstractIntegratedModule.egg-info → abstractintegratedmodule-0.3.7}/PKG-INFO +2 -2
- {abstractintegratedmodule-0.3.5 → abstractintegratedmodule-0.3.7}/README.md +1 -1
- {abstractintegratedmodule-0.3.5 → abstractintegratedmodule-0.3.7}/setup.py +1 -1
- abstractintegratedmodule-0.3.5/AbstractIntegratedModule.cp313-win_amd64.pyd +0 -0
- {abstractintegratedmodule-0.3.5 → abstractintegratedmodule-0.3.7}/AbstractIntegratedModule.egg-info/SOURCES.txt +0 -0
- {abstractintegratedmodule-0.3.5 → abstractintegratedmodule-0.3.7}/AbstractIntegratedModule.egg-info/dependency_links.txt +0 -0
- {abstractintegratedmodule-0.3.5 → abstractintegratedmodule-0.3.7}/AbstractIntegratedModule.egg-info/requires.txt +0 -0
- {abstractintegratedmodule-0.3.5 → abstractintegratedmodule-0.3.7}/AbstractIntegratedModule.egg-info/top_level.txt +0 -0
- {abstractintegratedmodule-0.3.5 → abstractintegratedmodule-0.3.7}/MANIFEST.in +0 -0
- {abstractintegratedmodule-0.3.5 → abstractintegratedmodule-0.3.7}/pyproject.toml +0 -0
- {abstractintegratedmodule-0.3.5 → abstractintegratedmodule-0.3.7}/setup.cfg +0 -0
|
Binary file
|
|
Binary file
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: AbstractIntegratedModule
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.7
|
|
4
4
|
Summary: Framework for Advanced Integrated Non-LLM AI Module library - Backend Framework for Non-LLM AI Agent Framework
|
|
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: Beta, 0.3.
|
|
45
|
+
- Development Stage: Beta, 0.3.7.
|
|
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.
|
{abstractintegratedmodule-0.3.5 → abstractintegratedmodule-0.3.7}/AbstractIntegratedModule.py
RENAMED
|
@@ -45,9 +45,6 @@ from sklearn.preprocessing import StandardScaler
|
|
|
45
45
|
# initial Setup logging for AgentDistributedInference and ModelStorage class logger and security logger
|
|
46
46
|
logger = logging.getLogger(__name__)
|
|
47
47
|
_integrated_pipeline_lock = threading.Lock()
|
|
48
|
-
# thread lock for P2P safety to prevent conflicting instances
|
|
49
|
-
_agent_inference_lock = threading.Lock()
|
|
50
|
-
_integrated_pipeline_lock = threading.Lock()
|
|
51
48
|
|
|
52
49
|
class MessagePriority(Enum):
|
|
53
50
|
LOW = 0
|
|
@@ -306,21 +303,22 @@ class GeometricWeightShaping:
|
|
|
306
303
|
|
|
307
304
|
def eigenvalue_encoder(self, x):
|
|
308
305
|
eps = 1e-5
|
|
309
|
-
|
|
310
|
-
if
|
|
311
|
-
|
|
306
|
+
raw_X = np.asarray(x)
|
|
307
|
+
if raw_X.ndim > 2:
|
|
308
|
+
raw_X = raw_X.reshape(raw_X.shape[0], -1)
|
|
312
309
|
|
|
313
|
-
mag = np.mean(np.linalg.norm(
|
|
310
|
+
mag = np.mean(np.linalg.norm(raw_X, axis=-1))
|
|
311
|
+
if np.isnan(mag) or np.isinf(mag):
|
|
312
|
+
mag = self.AME_Encoder(raw_X)
|
|
314
313
|
|
|
315
|
-
anisotropy = self.anisotropy_measurement(
|
|
314
|
+
anisotropy = self.anisotropy_measurement(raw_X)
|
|
316
315
|
|
|
317
|
-
structured_noise = np.random.uniform(0, mag, size=
|
|
318
|
-
X = np.vstack((
|
|
319
|
-
if X.ndim
|
|
320
|
-
X =
|
|
316
|
+
structured_noise = np.random.uniform(0, mag, size=raw_X.shape)
|
|
317
|
+
X = np.vstack((raw_X, structured_noise))
|
|
318
|
+
if X.ndim == 2 and X.shape[1] == 1:
|
|
319
|
+
X = np.hstack((raw_X, structured_noise))
|
|
321
320
|
|
|
322
321
|
cov = np.cov(X, rowvar=False)
|
|
323
|
-
|
|
324
322
|
eigenvalues, eigenvectors = np.linalg.eigh(cov)
|
|
325
323
|
idx = np.argsort(eigenvalues)[::-1]
|
|
326
324
|
|
|
@@ -334,22 +332,33 @@ class GeometricWeightShaping:
|
|
|
334
332
|
trA = k / (1.0 - anisotropy) + eps
|
|
335
333
|
trB = (1/2 + mag_G) / (1.0 + trA**2)
|
|
336
334
|
trC = (1/6 + K_G) / (trB**2 - 1.0)
|
|
337
|
-
return trC, k
|
|
338
335
|
|
|
336
|
+
if np.isnan(trC) or np.isinf(trC):
|
|
337
|
+
trC = anisotropy * (1.0 - mag_G) + eps
|
|
339
338
|
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
339
|
+
floating_point = np.random.uniform(0, trC, size=X.shape)
|
|
340
|
+
return k, floating_point, structured_noise
|
|
341
|
+
|
|
342
|
+
|
|
343
|
+
def spectral_signature(self, x, structured_noise, k=5):
|
|
344
|
+
raw_X = np.asarray(x)
|
|
345
|
+
if raw_X.ndim > 2:
|
|
346
|
+
X = raw_X.reshape(raw_X.shape[0], -1)
|
|
347
|
+
else:
|
|
348
|
+
X = raw_X.reshape(raw_X.shape[0], -1)
|
|
349
|
+
|
|
350
|
+
X = np.atleast_2d(X)
|
|
351
|
+
if X.ndim == 2 and X.shape[1] == 1:
|
|
352
|
+
X = np.hstack((X, structured_noise))
|
|
353
|
+
|
|
354
|
+
cov= np.cov(X, rowvar=False, ddof=1)
|
|
346
355
|
eigvals = np.linalg.eigvalsh(cov)
|
|
347
356
|
eigvals = np.sort(eigvals)[::-1]
|
|
348
357
|
return eigvals[:k] / (eigvals.sum() + 1e-8)
|
|
349
358
|
|
|
350
|
-
def spectral_similarity(self, a, b):
|
|
351
|
-
sa = self.spectral_signature(a)
|
|
352
|
-
sb = self.spectral_signature(b)
|
|
359
|
+
def spectral_similarity(self, a, b, structured_noise):
|
|
360
|
+
sa = self.spectral_signature(a, structured_noise)
|
|
361
|
+
sb = self.spectral_signature(b, structured_noise)
|
|
353
362
|
return np.exp(-np.linalg.norm(sa - sb))
|
|
354
363
|
|
|
355
364
|
# abstract modelling error provides the model how to better process weights when the data complexity has little geometric complexity
|
|
@@ -386,23 +395,28 @@ class GeometricWeightShaping:
|
|
|
386
395
|
def abstract_weight_shaping(self, x):
|
|
387
396
|
input_size = self.input_size
|
|
388
397
|
output_size = self.output_size
|
|
398
|
+
eps = 1e-5
|
|
399
|
+
x = np.asarray(x)
|
|
389
400
|
|
|
390
401
|
rng = np.random.default_rng()
|
|
391
402
|
|
|
392
403
|
anisotropy = self.anisotropy_measurement(x)
|
|
393
404
|
mag = np.mean(np.linalg.norm(x))
|
|
394
405
|
|
|
395
|
-
|
|
406
|
+
k, floating_point, structured_noise = self.eigenvalue_encoder(x)
|
|
396
407
|
AME = self.AME_Encoder(x)
|
|
408
|
+
AMR = 1.0 / (1.0 + np.exp(-AME)) # abstract modelling rate
|
|
409
|
+
|
|
397
410
|
|
|
398
|
-
|
|
399
|
-
spectral_similarity = self.spectral_similarity(x, floating_point)
|
|
411
|
+
spectral_similarity = self.spectral_similarity(x, floating_point, structured_noise)
|
|
400
412
|
|
|
401
|
-
AEL = 0.3 + spectral_similarity * anisotropy
|
|
413
|
+
AEL = (0.3 + spectral_similarity + eps) * anisotropy
|
|
402
414
|
scaled_anisotropy = anisotropy / (anisotropy + 1.0)
|
|
403
|
-
AMR = 1.0 / (1.0 + np.exp(-AME)) # abstract modelling rate
|
|
404
415
|
|
|
405
416
|
efficient_distributed_energy = k + AEL * (1.0 - AMR)
|
|
417
|
+
if np.isnan(efficient_distributed_energy) or np.isinf(efficient_distributed_energy):
|
|
418
|
+
efficient_distributed_energy = (1 - AMR) + eps
|
|
419
|
+
|
|
406
420
|
floating_context = rng.uniform(0, efficient_distributed_energy, size=(input_size, output_size))
|
|
407
421
|
self.floating_context = floating_context
|
|
408
422
|
|
|
@@ -425,6 +439,7 @@ class GeometricWeightShaping:
|
|
|
425
439
|
return floating_context
|
|
426
440
|
|
|
427
441
|
|
|
442
|
+
|
|
428
443
|
# ________ UTILITY functions for activations and losses, can be used across different models and architectures _________
|
|
429
444
|
|
|
430
445
|
def sigmoid(x):
|
|
@@ -1805,14 +1820,15 @@ class LSTMEngine:
|
|
|
1805
1820
|
preds, _, _, _ = model.forward(X_te[j])
|
|
1806
1821
|
if preds.shape != Y_te.shape:
|
|
1807
1822
|
if preds.shape[0] > Y_te.shape[0]:
|
|
1808
|
-
Y_te = Y_te[:preds.shape[0], :
|
|
1823
|
+
Y_te = Y_te[:preds.shape[0], :]
|
|
1809
1824
|
if Y_te.shape[0] > preds.shape[0]:
|
|
1810
|
-
preds = preds[:Y_te.shape[0], :
|
|
1825
|
+
preds = preds[:Y_te.shape[0], :]
|
|
1811
1826
|
else:
|
|
1812
1827
|
preds = preds[:Y_te.shape[0], :Y_te.shape[1]]
|
|
1813
1828
|
|
|
1814
1829
|
Y_te = Y_te[:preds.shape[0], :preds.shape[1]]
|
|
1815
|
-
preds = preds[:Y_te.shape[0], :Y_te.shape[1]]
|
|
1830
|
+
preds = preds[:Y_te.shape[0], :Y_te.shape[1]]
|
|
1831
|
+
|
|
1816
1832
|
val_loss += AMR * np.mean((preds - Y_te[j]) ** 2)
|
|
1817
1833
|
val_loss /= len(X_te)
|
|
1818
1834
|
print(f"[=] Epoch {epoch:>4}/{epochs} "
|
|
@@ -4761,6 +4777,7 @@ class ThreadedMessageQueue:
|
|
|
4761
4777
|
class AgentDistributedInference:
|
|
4762
4778
|
def __init__(self, pipeline, storage, memory_name, port=5555, use_async=False, secret_key=None, ssl_cert_file=None, ssl_key_file=None, shared_auth_token=None, predict_manager=None):
|
|
4763
4779
|
# Stored initialization params for debugging later
|
|
4780
|
+
|
|
4764
4781
|
self.pipeline = pipeline
|
|
4765
4782
|
self.memory_name = memory_name
|
|
4766
4783
|
self.port = port
|
|
@@ -4900,9 +4917,12 @@ class AgentDistributedInference:
|
|
|
4900
4917
|
def _setup_ssl(self):
|
|
4901
4918
|
# Setup SSL context for encrypted connections
|
|
4902
4919
|
try:
|
|
4903
|
-
self.ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
|
|
4920
|
+
self.ssl_context = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
|
|
4921
|
+
self.ssl_context.verify_mode = ssl.CERT_REQUIRED
|
|
4922
|
+
self.ssl_context.check_hostname = True
|
|
4904
4923
|
if self.ssl_cert_file and self.ssl_key_file:
|
|
4905
4924
|
self.ssl_context.load_cert_chain(self.ssl_cert_file, self.ssl_key_file)
|
|
4925
|
+
self.ssl_context.verify_mode = ssl.CERT_REQUIRED
|
|
4906
4926
|
else:
|
|
4907
4927
|
# Generate self-signed certificate for first layer security
|
|
4908
4928
|
self._generate_self_signed_cert()
|
|
@@ -4961,7 +4981,6 @@ class AgentDistributedInference:
|
|
|
4961
4981
|
self.ssl_key_file = 'server.key'
|
|
4962
4982
|
self.ssl_context.load_cert_chain(self.ssl_cert_file, self.ssl_key_file)
|
|
4963
4983
|
|
|
4964
|
-
|
|
4965
4984
|
def _generate_auth_token(self):
|
|
4966
4985
|
return hashlib.sha256(os.urandom(32)).hexdigest()
|
|
4967
4986
|
|
|
@@ -5176,9 +5195,6 @@ class AgentDistributedInference:
|
|
|
5176
5195
|
self.running = True
|
|
5177
5196
|
logger.info(f"[=] Server started on port {self.port} with SSL={'enabled' if self.enable_ssl else 'disabled'}")
|
|
5178
5197
|
|
|
5179
|
-
if self.enable_ssl and self.ssl_context:
|
|
5180
|
-
self.socket = self.ssl_context.wrap_socket(self.socket, server_side=True)
|
|
5181
|
-
|
|
5182
5198
|
print(f"[🤖] Agent listening on port {self.port}")
|
|
5183
5199
|
|
|
5184
5200
|
# Start accepting connections in background
|
|
@@ -6876,7 +6892,7 @@ class IntegratedPipeline:
|
|
|
6876
6892
|
def __init__(self, memory_name='agent_memory', use_async=False, agent_port=None, ssl_cert_file=None, ssl_key_file=None, secret_key=None, shared_auth_token=None, predict_manager=None):
|
|
6877
6893
|
# Only initialized once and when allowed
|
|
6878
6894
|
|
|
6879
|
-
print('[= MEMORY =] Initializing IntegratedPipeline with memory name:', memory_name)
|
|
6895
|
+
print('[= MEMORY =] Initializing IntegratedPipeline with memory name:', memory_name)
|
|
6880
6896
|
with _integrated_pipeline_lock:
|
|
6881
6897
|
super().__init__()
|
|
6882
6898
|
|
|
@@ -6893,7 +6909,7 @@ class IntegratedPipeline:
|
|
|
6893
6909
|
'ssl_key_file': ssl_key_file,
|
|
6894
6910
|
'shared_auth_token': shared_auth_token
|
|
6895
6911
|
|
|
6896
|
-
}
|
|
6912
|
+
}
|
|
6897
6913
|
|
|
6898
6914
|
self.ssl_cert_file = ssl_cert_file
|
|
6899
6915
|
self.ssl_key_file = ssl_key_file
|
|
@@ -12343,8 +12359,6 @@ class ConsecutivePeerAgent:
|
|
|
12343
12359
|
self.server_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
12344
12360
|
self.server_socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
|
|
12345
12361
|
self.server_socket.bind(('0.0.0.0', self.port))
|
|
12346
|
-
if self.pipeline.distribution.enable_ssl and self.pipeline.distribution.ssl_context:
|
|
12347
|
-
self.server_socket = self.pipeline.distribution.ssl_context.wrap_socket(self.server_socket, server_side=True)
|
|
12348
12362
|
|
|
12349
12363
|
self.server_socket.listen(5)
|
|
12350
12364
|
self.running = True
|
|
@@ -12494,7 +12508,6 @@ class CohesiveAgentDeployment:
|
|
|
12494
12508
|
label=label_name
|
|
12495
12509
|
)
|
|
12496
12510
|
|
|
12497
|
-
|
|
12498
12511
|
self._peer_agent = ConsecutivePeerAgent(
|
|
12499
12512
|
peer_id=self.pipeline.memory_name,
|
|
12500
12513
|
port=peer_discovery_port + 100,
|
|
@@ -12735,11 +12748,7 @@ class CohesiveAgentDeployment:
|
|
|
12735
12748
|
while not self._shutdown_event.is_set() and self.discovery:
|
|
12736
12749
|
try:
|
|
12737
12750
|
# UDP broadcast socket
|
|
12738
|
-
|
|
12739
|
-
sock = self.pipeline.distribution.ssl_context.wrap_socket(socket.socket(socket.AF_INET, socket.SOCK_DGRAM))
|
|
12740
|
-
else:
|
|
12741
|
-
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
12742
|
-
|
|
12751
|
+
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
12743
12752
|
print(f"[broadcast_discovery() SOCKET CREATED] id={id(sock)}")
|
|
12744
12753
|
sock.setsockopt(socket.SOL_SOCKET, socket.SO_BROADCAST, 1)
|
|
12745
12754
|
sock.settimeout(2)
|
|
@@ -13205,11 +13214,7 @@ class CohesiveAgentDeployment:
|
|
|
13205
13214
|
|
|
13206
13215
|
def _is_server_listening(self) -> bool:
|
|
13207
13216
|
# if the server is actually listening on its port
|
|
13208
|
-
|
|
13209
|
-
sock = self.pipeline.distribution.ssl_context.wrap_socket(socket.socket(socket.AF_INET, socket.SOCK_STREAM))
|
|
13210
|
-
else:
|
|
13211
|
-
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
|
13212
|
-
|
|
13217
|
+
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
|
13213
13218
|
sock.settimeout(1)
|
|
13214
13219
|
try:
|
|
13215
13220
|
result = sock.connect_ex(('127.0.0.1', self.peer_discovery_port))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: AbstractIntegratedModule
|
|
3
|
-
Version: 0.3.
|
|
3
|
+
Version: 0.3.7
|
|
4
4
|
Summary: Framework for Advanced Integrated Non-LLM AI Module library - Backend Framework for Non-LLM AI Agent Framework
|
|
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: Beta, 0.3.
|
|
45
|
+
- Development Stage: Beta, 0.3.7.
|
|
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.
|
|
@@ -10,7 +10,7 @@ https://github.com/Micro-Novelty/IntegratedPipeline-Specialized-Non-LLM-AI-Agent
|
|
|
10
10
|
#### 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.
|
|
11
11
|
|
|
12
12
|
### Library Short Description:
|
|
13
|
-
- Development Stage: Beta, 0.3.
|
|
13
|
+
- Development Stage: Beta, 0.3.7.
|
|
14
14
|
- Maintainer: Micro-Novelty.
|
|
15
15
|
- library Source-Code is Open-sourced on github.
|
|
16
16
|
- Purpose: Specifically Designed for providing Non-LLM AI Agent Framework for edge Devices, Optimized for ARM64 architecture.
|
|
@@ -8,7 +8,7 @@ class BinaryDistribution(Distribution):
|
|
|
8
8
|
|
|
9
9
|
setup(
|
|
10
10
|
name="AbstractIntegratedModule",
|
|
11
|
-
version="0.3.
|
|
11
|
+
version="0.3.7",
|
|
12
12
|
description="Framework for Advanced Integrated Non-LLM AI Module library - Backend Framework for Non-LLM AI Agent Framework",
|
|
13
13
|
long_description=open("README.md", encoding="utf-8").read(),
|
|
14
14
|
long_description_content_type="text/markdown",
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|