File size: 1,381 Bytes
43fd7ed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
---
license: mit
datasets:
- scikit-learn/iris
language:
- en
base_model:
- NeuralNine999/INET
pipeline_tag: tabular-classification
tags:
- biology
---

# INet - PyTorch Iris Classifier

## Overview
INet is a simple fully-connected neural network trained on the Iris dataset using PyTorch.
It classifies iris flowers into 4 categories based on 4 features: sepal length, sepal width, petal length, and petal width.

## Model Architecture
- Input: 4 features
- Hidden layers: 64 β†’ 32 β†’ 16 β†’ 8 neurons (ReLU activations)
- Output: 4 classes

Architecture flow:
Input(4) β†’ Linear(64) β†’ ReLU β†’ Linear(32) β†’ ReLU β†’ Linear(16) β†’ ReLU β†’ Linear(8) β†’ ReLU β†’ Linear(4)

- Loss: CrossEntropyLoss
- Optimizer: Adam, lr=0.01
- Epochs: 30

## Files
- inet.pth β†’ Trained model weights
- model.py β†’ Contains INet class and architecture
- README.md β†’ This file

## How to Load

```python
import torch
from model import INet  # make sure INet class is in model.py

model = INet()
model.load_state_dict(torch.load("inet.pth"))
model.eval()

# Example usage:
sample_input = torch.tensor([[5.1, 3.5, 1.4, 0.2]])
pred = model(sample_input)
pred_class = pred.argmax(dim=1).item()
print(pred_class)
```

## Notes

* Make sure PyTorch is installed correctly
  
```python
pip install torch
```

* The model expects input as a tensor of shape [batch_size, 4] with float32 values.