This project demonstrates a simple IoT classification task using synthetic data with PyTorch. The goal is to classify IoT device data into different categories.
src/: Contains the Python code for the project.generate_iot_data.py: Generates synthetic IoT data.dataset.py: Contains PyTorch Dataset and DataLoader helpers.model.py: Defines the neural network model.train.py: Contains the training and testing loop.utils.py: Provides utility functions like saving metrics to JSON.
requirements.txt: Lists the Python dependencies..gitignore: Specifies files and directories to be ignored by git.
-
Install the required packages:
pip install -r requirements.txt -
Generate synthetic IoT data:
python -m src.generate_iot_data -
Train the model and produce results:
python -m src.train --batch-size 32 --epochs 10 --lr 0.001 --train-ratio 0.8 -
Install TypeScript and ts-node:
npm install -
Display the model results:
npx ts-node ts/src/results.ts
- Python 3.x
- PyTorch
- NumPy
- Pandas
- Scikit-learn