Update README.md
Browse files
README.md
CHANGED
|
@@ -1,3 +1,62 @@
|
|
| 1 |
-
---
|
| 2 |
-
license: mit
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
license: mit
|
| 3 |
+
datasets:
|
| 4 |
+
- scikit-learn/iris
|
| 5 |
+
language:
|
| 6 |
+
- en
|
| 7 |
+
base_model:
|
| 8 |
+
- NeuralNine999/INET
|
| 9 |
+
pipeline_tag: tabular-classification
|
| 10 |
+
tags:
|
| 11 |
+
- biology
|
| 12 |
+
---
|
| 13 |
+
|
| 14 |
+
# INet - PyTorch Iris Classifier
|
| 15 |
+
|
| 16 |
+
## Overview
|
| 17 |
+
INet is a simple fully-connected neural network trained on the Iris dataset using PyTorch.
|
| 18 |
+
It classifies iris flowers into 4 categories based on 4 features: sepal length, sepal width, petal length, and petal width.
|
| 19 |
+
|
| 20 |
+
## Model Architecture
|
| 21 |
+
- Input: 4 features
|
| 22 |
+
- Hidden layers: 64 β 32 β 16 β 8 neurons (ReLU activations)
|
| 23 |
+
- Output: 4 classes
|
| 24 |
+
|
| 25 |
+
Architecture flow:
|
| 26 |
+
Input(4) β Linear(64) β ReLU β Linear(32) β ReLU β Linear(16) β ReLU β Linear(8) β ReLU β Linear(4)
|
| 27 |
+
|
| 28 |
+
- Loss: CrossEntropyLoss
|
| 29 |
+
- Optimizer: Adam, lr=0.01
|
| 30 |
+
- Epochs: 30
|
| 31 |
+
|
| 32 |
+
## Files
|
| 33 |
+
- inet.pth β Trained model weights
|
| 34 |
+
- model.py β Contains INet class and architecture
|
| 35 |
+
- README.md β This file
|
| 36 |
+
|
| 37 |
+
## How to Load
|
| 38 |
+
|
| 39 |
+
```python
|
| 40 |
+
import torch
|
| 41 |
+
from model import INet # make sure INet class is in model.py
|
| 42 |
+
|
| 43 |
+
model = INet()
|
| 44 |
+
model.load_state_dict(torch.load("inet.pth"))
|
| 45 |
+
model.eval()
|
| 46 |
+
|
| 47 |
+
# Example usage:
|
| 48 |
+
sample_input = torch.tensor([[5.1, 3.5, 1.4, 0.2]])
|
| 49 |
+
pred = model(sample_input)
|
| 50 |
+
pred_class = pred.argmax(dim=1).item()
|
| 51 |
+
print(pred_class)
|
| 52 |
+
```
|
| 53 |
+
|
| 54 |
+
## Notes
|
| 55 |
+
|
| 56 |
+
* Make sure PyTorch is installed correctly
|
| 57 |
+
|
| 58 |
+
```python
|
| 59 |
+
pip install torch
|
| 60 |
+
```
|
| 61 |
+
|
| 62 |
+
* The model expects input as a tensor of shape [batch_size, 4] with float32 values.
|