oikan 0.0.3.5__py3-none-any.whl → 0.0.3.6__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.
- oikan/model.py +12 -1
- oikan/neural.py +1 -0
- {oikan-0.0.3.5.dist-info → oikan-0.0.3.6.dist-info}/METADATA +28 -5
- oikan-0.0.3.6.dist-info/RECORD +10 -0
- {oikan-0.0.3.5.dist-info → oikan-0.0.3.6.dist-info}/WHEEL +1 -1
- oikan-0.0.3.5.dist-info/RECORD +0 -10
- {oikan-0.0.3.5.dist-info → oikan-0.0.3.6.dist-info}/licenses/LICENSE +0 -0
- {oikan-0.0.3.5.dist-info → oikan-0.0.3.6.dist-info}/top_level.txt +0 -0
oikan/model.py
CHANGED
@@ -41,10 +41,12 @@ class OIKAN(ABC):
|
|
41
41
|
Whether to display training progress.
|
42
42
|
evaluate_nn : bool, optional (default=False)
|
43
43
|
Whether to evaluate neural network performance before full training.
|
44
|
+
random_state: int, optional (default=None)
|
45
|
+
Random seed for reproducibility.
|
44
46
|
"""
|
45
47
|
def __init__(self, hidden_sizes=[64, 64], activation='relu', augmentation_factor=10,
|
46
48
|
alpha=0.1, sigma=0.1, epochs=100, lr=0.001, batch_size=32,
|
47
|
-
verbose=False, evaluate_nn=False, top_k=5):
|
49
|
+
verbose=False, evaluate_nn=False, top_k=5, random_state=None):
|
48
50
|
if not isinstance(hidden_sizes, list) or not all(isinstance(x, int) and x > 0 for x in hidden_sizes):
|
49
51
|
raise InvalidParameterError("hidden_sizes must be a list of positive integers")
|
50
52
|
if activation not in ['relu', 'tanh', 'leaky_relu', 'elu', 'swish', 'gelu']:
|
@@ -78,6 +80,11 @@ class OIKAN(ABC):
|
|
78
80
|
self.neural_net = None
|
79
81
|
self.symbolic_model = None
|
80
82
|
self.evaluation_done = False
|
83
|
+
self.random_state = random_state
|
84
|
+
|
85
|
+
if self.random_state is not None:
|
86
|
+
torch.manual_seed(self.random_state)
|
87
|
+
np.random.seed(self.random_state)
|
81
88
|
|
82
89
|
@abstractmethod
|
83
90
|
def fit(self, X, y):
|
@@ -448,6 +455,8 @@ class OIKANRegressor(OIKAN):
|
|
448
455
|
if self.verbose:
|
449
456
|
print(f"Augmented data: features shape: {X_aug.shape} | target shape: {y_aug.shape}")
|
450
457
|
self._perform_symbolic_regression(X_aug, y_aug)
|
458
|
+
if self.verbose:
|
459
|
+
print("OIKANRegressor model training completed successfully!")
|
451
460
|
|
452
461
|
def predict(self, X):
|
453
462
|
"""
|
@@ -500,6 +509,8 @@ class OIKANClassifier(OIKAN):
|
|
500
509
|
if self.verbose:
|
501
510
|
print(f"Augmented data: features shape: {X_aug.shape} | target shape: {logits_aug.shape}")
|
502
511
|
self._perform_symbolic_regression(X_aug, logits_aug)
|
512
|
+
if self.verbose:
|
513
|
+
print("OIKANClassifier model training completed successfully!")
|
503
514
|
|
504
515
|
def predict(self, X):
|
505
516
|
"""
|
oikan/neural.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: oikan
|
3
|
-
Version: 0.0.3.
|
3
|
+
Version: 0.0.3.6
|
4
4
|
Summary: OIKAN: Neuro-Symbolic ML for Scientific Discovery
|
5
5
|
Author: Arman Zhalgasbayev
|
6
6
|
License: MIT
|
@@ -34,7 +34,11 @@ OIKAN is a neuro-symbolic machine learning framework inspired by Kolmogorov-Arno
|
|
34
34
|
[](https://opensource.org/licenses/MIT)
|
35
35
|
[](https://github.com/silvermete0r/oikan/issues)
|
36
36
|
[](https://silvermete0r.github.io/oikan/)
|
37
|
+
|
37
38
|
[](https://deepwiki.com/silvermete0r/oikan)
|
39
|
+
[](https://colab.research.google.com/github/silvermete0r/oikan/blob/main/examples/oikan-v0-0-3-get-started-template-notebook.ipynb)
|
40
|
+
[](https://www.kaggle.com/code/armanzhalgasbayev/oikan-v0-0-3-get-started-template-notebook)
|
41
|
+
[](https://github.com/silvermete0r/awesome-oikan)
|
38
42
|
|
39
43
|
> **Important Disclaimer**: OIKAN is an experimental research project. It is not intended for production use or real-world applications. This framework is designed for research purposes, experimentation, and academic exploration of neuro-symbolic machine learning concepts.
|
40
44
|
|
@@ -111,9 +115,20 @@ cd OIKAN
|
|
111
115
|
pip install -e . # Install in development mode
|
112
116
|
```
|
113
117
|
|
118
|
+
#### System Requirements
|
119
|
+
|
120
|
+
| Requirement | Details |
|
121
|
+
|-------------------|--------------------------------------|
|
122
|
+
| Python | Version 3.7 or higher |
|
123
|
+
| Operating System | Platform independent (Windows/macOS/Linux) |
|
124
|
+
| Memory | Recommended minimum 4GB RAM |
|
125
|
+
| Disk Space | ~100MB for installation (including dependencies) |
|
126
|
+
| GPU | Optional (for faster training) |
|
127
|
+
| Dependencies | torch, numpy, scikit-learn, sympy, tqdm |
|
128
|
+
|
114
129
|
### Regression Example
|
115
130
|
```python
|
116
|
-
from oikan
|
131
|
+
from oikan import OIKANRegressor
|
117
132
|
from sklearn.metrics import mean_squared_error
|
118
133
|
|
119
134
|
# Initialize model
|
@@ -128,7 +143,8 @@ model = OIKANRegressor(
|
|
128
143
|
lr=0.001, # Learning rate
|
129
144
|
batch_size=32, # Batch size for training
|
130
145
|
verbose=True, # Verbose output during training
|
131
|
-
evaluate_nn=True # Validate neural network performance before full process
|
146
|
+
evaluate_nn=True, # Validate neural network performance before full process
|
147
|
+
random_state=42 # Random seed for reproducibility
|
132
148
|
)
|
133
149
|
|
134
150
|
# Fit the model
|
@@ -162,7 +178,7 @@ loaded_model.load("outputs/model.json")
|
|
162
178
|
|
163
179
|
### Classification Example
|
164
180
|
```python
|
165
|
-
from oikan
|
181
|
+
from oikan import OIKANClassifier
|
166
182
|
from sklearn.metrics import accuracy_score
|
167
183
|
|
168
184
|
# Initialize model
|
@@ -177,7 +193,8 @@ model = OIKANClassifier(
|
|
177
193
|
lr=0.001, # Learning rate
|
178
194
|
batch_size=32, # Batch size for training
|
179
195
|
verbose=True, # Verbose output during training
|
180
|
-
evaluate_nn=True # Validate neural network performance before full process
|
196
|
+
evaluate_nn=True, # Validate neural network performance before full process
|
197
|
+
random_state=42 # Random seed for reproducibility
|
181
198
|
)
|
182
199
|
|
183
200
|
# Fit the model
|
@@ -211,6 +228,12 @@ loaded_model.load("outputs/model.json")
|
|
211
228
|
|
212
229
|
### Architecture Diagram
|
213
230
|
|
231
|
+
#### High-Level Architecture:
|
232
|
+
|
233
|
+

|
234
|
+
|
235
|
+
#### UML Diagram:
|
236
|
+
|
214
237
|
-architecture-oop.png)
|
215
238
|
|
216
239
|
## OIKAN Symbolic Model Compilers
|
@@ -0,0 +1,10 @@
|
|
1
|
+
oikan/__init__.py,sha256=zEzhm1GYLT4vNaIQ4CgZcNpUk3uo8SWnoaHYtHW_XSQ,628
|
2
|
+
oikan/exceptions.py,sha256=GhHWqy2Q5LVBcteTy4ngnqxr7FOoLNyD8dNt1kfRXyw,901
|
3
|
+
oikan/model.py,sha256=vnn5THWhndj5-P2Vsa78CErsT24LVmjMd8CnWeW09Kg,23663
|
4
|
+
oikan/neural.py,sha256=PZjaffSuABuCNxu-7PinU1GR6ji0Y6xRgSQ3n5HRDxI,1572
|
5
|
+
oikan/utils.py,sha256=7UCm9obO-8Q2zhetdAkukMDOZvGSBWUL_dSF04XqM7k,8808
|
6
|
+
oikan-0.0.3.6.dist-info/licenses/LICENSE,sha256=75ASVmU-XIpN-M4LbVmJ_ibgbzbvRLVti8FhnR0BTf8,1096
|
7
|
+
oikan-0.0.3.6.dist-info/METADATA,sha256=P-07jTsmYsaANnQOjh_mzmjLk1Q9rqN665CBp_FKYjU,12749
|
8
|
+
oikan-0.0.3.6.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
9
|
+
oikan-0.0.3.6.dist-info/top_level.txt,sha256=XwnwKwTJddZwIvtrUsAz-l-58BJRj6HjAGWrfYi_3QY,6
|
10
|
+
oikan-0.0.3.6.dist-info/RECORD,,
|
oikan-0.0.3.5.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
oikan/__init__.py,sha256=zEzhm1GYLT4vNaIQ4CgZcNpUk3uo8SWnoaHYtHW_XSQ,628
|
2
|
-
oikan/exceptions.py,sha256=GhHWqy2Q5LVBcteTy4ngnqxr7FOoLNyD8dNt1kfRXyw,901
|
3
|
-
oikan/model.py,sha256=Ke5FdHOr1YwnUCJieXN2VjTXhxAGxHWzCfNgw0_WYbA,23157
|
4
|
-
oikan/neural.py,sha256=wxmGgzmtpwJ3lvH6u6D4i4BiAzg018czrIdw49phSCY,1558
|
5
|
-
oikan/utils.py,sha256=7UCm9obO-8Q2zhetdAkukMDOZvGSBWUL_dSF04XqM7k,8808
|
6
|
-
oikan-0.0.3.5.dist-info/licenses/LICENSE,sha256=75ASVmU-XIpN-M4LbVmJ_ibgbzbvRLVti8FhnR0BTf8,1096
|
7
|
-
oikan-0.0.3.5.dist-info/METADATA,sha256=sUzI5w2hfUd70B4s1K5vULOvQpQbkvb239NTfS2gAPU,11388
|
8
|
-
oikan-0.0.3.5.dist-info/WHEEL,sha256=DnLRTWE75wApRYVsjgc6wsVswC54sMSJhAEd4xhDpBk,91
|
9
|
-
oikan-0.0.3.5.dist-info/top_level.txt,sha256=XwnwKwTJddZwIvtrUsAz-l-58BJRj6HjAGWrfYi_3QY,6
|
10
|
-
oikan-0.0.3.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|