This Python code is a simple visualization tool for a Multilayer Perceptron (MLP) neural network. It uses Matplotlib to plot the neural network's decision boundaries and allows the user to interactively input data points with left-clicks and right-clicks to label them. The neural network's training process uses a gradient descent algorithm to update its weights and find decision boundaries for the given data points.
- Python 3.x
- NumPy
- Matplotlib
- Install Python from the official website: https://www.python.org/downloads/
- Install the required libraries using pip:
pip install numpy matplotlib
To run the code, execute the following command in your terminal or command prompt:
python filename.py
- Left-click on the plot to label the data point as "Class 1."
- Right-click on the plot to label the data point as "Class 0."
- Click the "Iniciar" button to start the training process of the MLP neural network.
- During the training process, the code will display the neural network's decision boundaries after certain iterations to visualize the learning progress.
Please note that this code is intended for educational purposes and might not be suitable for complex real-world problems. It serves as a simple demonstration of how a multilayer perceptron neural network can be visualized and trained using basic gradient descent.
This code is licensed under the MIT License.
The code was inspired by various online tutorials and educational resources on neural networks and Matplotlib.
Feel free to use and modify this code for learning purposes or as a starting point for more advanced projects involving neural networks. If you find any issues or have suggestions for improvement, please feel free to contribute by opening a pull request. Happy coding!