This research project provides an in-depth comparative analysis of activation functions across two distinct machine learning datasets: MNIST (handwritten digit recognition) and Titanic (passenger survival prediction).
- Compare performance of different activation function configurations
- Analyze impact of optimizers on model learning
- Provide insights into activation function selection strategies
- ReLU → Sigmoid → Tanh → Sigmoid/Softmax
- ReLU → ReLU → ReLU → Sigmoid/Softmax
- Sigmoid → Sigmoid → Sigmoid → Sigmoid/Softmax
- Tanh → Tanh → Tanh → Sigmoid/Softmax
- ADAM
- Stochastic Gradient Descent (SGD)
- RMSProp
-
MNIST: Handwritten digit recognition
- 28x28 pixel grayscale images
- 10 classification categories (0-9)
-
Titanic: Passenger survival prediction
- Structured dataset with mixed feature types
- Binary classification (survived/not survived)
- Best Configuration: ReLU → ReLU → ReLU → Softmax
- Peak Accuracy: 96.30%
- Lowest Loss: 0.1300
- Best Configuration: ADAM with ReLU → Sigmoid → Tanh → Sigmoid
- Most stable learning curve
- Lowest final test loss
- Python 3.8+
- TensorFlow/Keras
- NumPy
- Matplotlib
- Pandas
git clone https://github.com/yourusername/activation-function-study.git
cd activation-function-study
pip install -r requirements.txtpython mnist_experiments.py
python titanic_experiments.py- Epoch-level Training Loss
- Test Accuracy
- Batch Loss Distribution
- Cumulative Batch Losses
- Performance Metrics Heatmap
- ReLU shows superior performance in complex classification tasks
- ADAM optimizer provides fastest and most stable convergence
- Mixed activation functions offer enhanced model flexibility
- Implement multiple activation function configurations
- Train models using different optimizers
- Compare performance metrics
- Visualize and analyze results
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Explore additional activation functions
- Investigate hyperparameter tuning
- Expand to more diverse datasets