This repository contains an implementation of a simple neural network using Python and NumPy. The neural network is built with fully connected layers and supports multiple activation and loss functions. The implementation is designed to train on the MNIST dataset.
- Fully connected neural network with customizable layers
- Supports different activation functions (e.g., ReLU, Sigmoid)
- Implements L2 regularization
- Backpropagation and weight updates with gradient descent
- Batch training with mini-batches
- Supports multiple loss functions (e.g., SSE, Cross-Entropy)
- Validation and accuracy tracking
- Includes visualization utilities for cost function and predictions
To run this project, install the following dependencies:
pip install .You can add layers to the neural network before training:
model = Perceptron(epochs=25, loss_function="cross_entropy")
model.add_layer(50, "relu", 784) # Hidden layer with 50 neurons
model.add_layer(10, "sigmoid") # Output layer with 10 neurons (for MNIST digits)model.fit(x_train, y_train, validation_split=0.1)validation_split parameter is not required.
y_pred = model.predict(x_test)