This repository has been archived by the owner on May 29, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from MGTheTrain/feature/ml-training-app
[Feature] Simple feedforward neural network with MNIST dataset to map input images to their corresponding digit classes
- Loading branch information
Showing
28 changed files
with
143 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# python | ||
# Keras training app with mnist dataset | ||
|
||
### Folder structure | ||
|
||
|
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from src import train | ||
|
||
if __name__ == "__main__": | ||
train.main() |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tensorflow=2.16.1 | ||
numpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import tensorflow as tf | ||
|
||
def load_data(): | ||
# Load MNIST dataset | ||
(x_train, y_train), (x_test, y_test) = tf.keras.datasets.mnist.load_data() | ||
|
||
# Normalize pixel values to the range [0, 1] | ||
x_train, x_test = x_train / 255.0, x_test / 255.0 | ||
|
||
# Add channel dimension for convolutional networks | ||
x_train = x_train[..., tf.newaxis] | ||
x_test = x_test[..., tf.newaxis] | ||
|
||
return (x_train, y_train), (x_test, y_test) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import tensorflow as tf | ||
from tensorflow.keras import layers, models | ||
|
||
def build_model(): | ||
model = models.Sequential([ | ||
layers.Dense(64, activation='relu', input_shape=(28, 28)), | ||
layers.Dense(10, activation='softmax') | ||
]) | ||
return model |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
from .data_loader import load_data | ||
from .model import build_model | ||
|
||
def main(): | ||
x_train, y_train = load_data() | ||
model = build_model() | ||
model.compile(optimizer='adam', | ||
loss='sparse_categorical_crossentropy', | ||
metrics=['accuracy']) | ||
|
||
model.fit(x_train, y_train, epochs=10, batch_size=32) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
def preprocess_data(data): | ||
# Data preprocessing code here | ||
pass |
Empty file.
Empty file.
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
env/ | ||
build/ | ||
dist/ | ||
eggs/ | ||
*.egg-info/ | ||
|
||
# IDEs | ||
.idea/ | ||
.vscode/ | ||
|
||
# Dependency directories | ||
venv/ | ||
env/ | ||
|
||
# Compiled Python files | ||
*.pyc | ||
*.pyo | ||
|
||
# Logs and databases | ||
*.log | ||
*.sqlite | ||
*.db | ||
|
||
# Model artifacts | ||
*.pt # PyTorch model files | ||
*.h5 # TensorFlow model files | ||
|
||
# Miscellaneous | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Tensorflow yolov4 training app with coco dataset | ||
|
||
### Folder structure | ||
|
||
```sh | ||
project_root/ | ||
│ | ||
├── data/ # Directory for storing datasets | ||
│ └── dataset/ | ||
│ └── ... | ||
│ | ||
├── models/ # Directory for storing trained models | ||
│ └── saved_models/ | ||
│ └── ... | ||
│ | ||
├── src/ # Source code directory | ||
│ ├── data_loader.py # Data loading utilities. Load the dataset from the specified directory (data/ in this case) or from external sources like databases or APIs | ||
│ ├── model.py # Model architecture definition | ||
│ ├── train.py # Training script | ||
│ └── utils.py # Utility functions | ||
│ | ||
├── requirements.txt # Python dependencies | ||
├── README.md # Project README file | ||
└── main.py # Main entry point script for running the application | ||
``` |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
from src import train | ||
|
||
if __name__ == "__main__": | ||
train.main() |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tensorflow=2.16.1 | ||
numpy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import tensorflow as tf | ||
|
||
def load_data(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
|
||
def build_model(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .data_loader import load_data | ||
from .model import build_model | ||
|
||
def main(): | ||
pass |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
def preprocess_data(data): | ||
# Data preprocessing code here | ||
pass |