Make a framework-free DNN Regression model step by step.
If we have a good command of the inside mechanism of Deep Neural Network (DNN), then we can be much better at machine learning frameworks with high-level abstraction, like TensorFlow, PyTorch, etc.
Given the labeled dataset which is generated from
such as
the model should try to fit the original function by a learned function,
with a relatively lower ½ Mean Squared Error (MSE) Loss, that is
- Use relatively pure Python to implement a DNN model that can fit any given mathematical function.
- No machine learning frameworks, eg. TensorFlow, PyTorch, scikit-learn, Keras, etc.
- Complete this task from imperfectly to perfectly within several version iterations.
- Regardless of efficiency.
Math | Code | Description |
---|---|---|
xi_j |
the ith weight/output of the jth layer | |
dw |
(Partial) derivative |
The notations follow the conventions in Andrew Ng's Machine Learning course.
Version | Network Architecture | Target |
---|---|---|
V1 | (1+)2 Layers: (1 x) 2 x 1 | Use the simplest approach to implement a DNN regression. |
V2 | Introduce OOP |