- refactored criterion into network
- added support for L2 regularization