The complete procedure is presented in Algorithm REF . Note that we may use any sophisticated gradient-based learning method to optimize, such as Adam [1]}. As reported in [2]}, we observe that the learning procedure is stabilized by running several gradient descent steps on the stage 1 parameters \((\theta _{A(1)}, \theta _{Z})\)  before updating the stage 2 features \((\theta _{A(2)}, \theta _{W})\) . Furthermore, we may use mini-batch updates, which sample subsets of the data at the beginning of each iteration, and only use these subsamples to update the parameters.
