How are the functions "train" and "trainNetwork" different underneath? When should I use "train" instead of "trainNetwork" or vice-versa?
"train" and "trainNetwork" and their associated functions correspond to two totally independent universes of network learning. "train" and associated functions are used to create and train a "Shallow Neural Network" which is useful for function approximation and clustering. On the other hand, "trainNetwork" and its associated functions are used to create and train a "Deep Neural Network"* *which* *is predominantly used for image classification.
The functions “train” and “trainNetwork” sit on top of totally independent code bases. They are part of the same toolbox (Neural Networks Toolbox), but independent of each other.
While you can train deep network or shallow networks with both functions, there are a few reasons that make training deep networks with “trainNetworks” easier:
If you set the same network architecture for both functions, the codebase optimizing the network parameters will be different, and the algorithms doing so will also be different. The function “train” offers more variety of algorithms. The function “trainNetwork” offers algorithms used in recent state of the art research on deep learning.