Refactor optimizer for new network API.
Refactor optimizer for new network API.

ersanliqiao/mlpack,lezorich/mlpack,BookChan/mlpack,ersanliqiao/mlpack,erubboli/mlpack,palashahuja/mlpack,BookChan/mlpack,lezorich/mlpack,theranger/mlpack,palashahuja/mlpack,ersanliqiao/mlpack,ranjan1990/mlpack,palashahuja/mlpack,ajjl/mlpack,erubboli/mlpack,theranger/mlpack,darcyliu/mlpack,ajjl/mlpack,darcyliu/mlpack,darcyliu/mlpack,erubboli/mlpack,stereomatchingkiss/mlpack,stereomatchingkiss/mlpack,ranjan1990/mlpack,lezorich/mlpack,theranger/mlpack,ajjl/mlpack,stereomatchingkiss/mlpack,ranjan1990/mlpack,BookChan/mlpack