During the Deep Learning Udacity Nanodegree, we were asked to implement a neuralnet with 1 hidden layer in pure Python. This project is in pure C.
Code is NOT meant for production use, this project is actually a playground for me to better understand concepts and technology limitations but still had better metrics than LSTM/CNN approaches tried on some datasets.
Key implementation info:
- Pure C even for Backpropagation and Stochastic Gradient Descent
- Multi-Threaded
- Fast file loading
- NN Weights saved/loaded
- Early Stopping so no need to specify number of epochs
- Learning Rate range test so no need to specify learning rate
- Learning Rate decay
- Appropriate weight initialization
- Two sentiment outputs objectivity/subjectivity and polarity (measure and score)
- All the above in 729 lines of pure C without using external frameworks or libraries
./fastsent_train TRAIN_FILE VALIDATION_FILE TEST_FILE
-
Validation_file needed for early stopping
-
All files in the kaggle.*.input format
-
Output metrics: 1rst train, 2nd validation, 3rd test
Winner LSTM: 80% accuracy, CURRENT 1-hidden-layer MLP (no hyperparameter tuning): 77%