This repository contains the code used to demonstrate the effects of regularization in neural networks. Follow the steps below to set up the project and reproduce the results.
To begin, download the repository from GitHub. You can either:
- Clone the repository using Git:
git clone https://github.com/DeepAstrix/Machine-learning-tutorial.git cd your-repo-name
- Download the ZIP file:
- Go to the repository page on GitHub.
- Click the green Code button.
- Select Download ZIP.
- Extract the ZIP file to your desired location.
Ensure you have Python installed on your system (preferably version 3.7 or higher).
- Create a virtual environment:
python -m venv env
- Activate the virtual environment:
- Windows:
.\env\Scripts\activate
- macOS/Linux:
source env/bin/activate
- Windows:
Install the following essential libraries using pip:
- TensorFlow/Keras
- Matplotlib
- NumPy
- Pandas
After setting up the environment, run the provided Python script to train the models and generate results.
- Navigate to the project directory if not already there:
cd your-repo-name
- Run the script:
python ML_Tutorial.py
- The script will train models with different regularization methods (
Baseline
,L2 Regularization
, andDropout
) and display validation loss and accuracy results for comparison. - Graphs such as Validation Loss Comparison, Training vs. Validation Accuracy and Distribution of Weights will come out as results.
Contributions are welcome! Feel free to fork the repository, submit issues, or make pull requests.
This project is licensed under the MIT License. See the LICENSE
file for more details.