Paper:
MAKING STOCHASTIC NEURAL NETWORKS FROM DETERMINISTIC ONES
It has been believed that stochastic feedforward neural networks (SFNN) have several advantages beyond deterministic deep neural networks (DNN): they have more expressive power allowing multi-modal mappings and regularize better due to their stochastic nature. However, training SFNN is notoriously harder. In this paper, we aim at developing efficient training methods for large-scale SFNN, in particular using known architectures and pre-trained parameters of DNN. To this end, we propose a new intermediate stochastic model, called Simplified-SFNN, which can be built upon any baseline DNN and approximates certain SFNN by simplifying its upper latent units above stochastic ones. The main novelty of our approach is in establishing the connection between three models, i.e., DNN → Simplified-SFNN → SFNN, which naturally leads to an efficient training procedure of the stochastic models utilizing pre-trained parameters of DNN. Using several popular DNNs, we show how they can be effectively transferred to the corresponding stochastic models for both multi-modal and classification tasks on MNIST, TFD, CIFAR-10, CIFAR-100 and SVHN datasets. In particular, our stochastic model built from the wide residual network has 28 layers and 36 million parameters, where the former consistently outperforms the latter for the classification tasks on CIFAR-10 and CIFAR-100 due to its stochastic regularizing effect.
1 INTRODUCTION
Recently, deterministic deep neural networks (DNN) have demonstrated state-of-the-art performance on many supervised tasks, e.g., speech recognition (Hinton et al., 2012a) and object recognition (Krizhevsky et al., 2012). One of the main components underlying these successes is on the efficient training methods for deeper and wider DNNs, which include backpropagation (Rumelhart et al., 1988), stochastic gradient descent (Robbins & Monro, 1951), dropout/dropconnect (Hinton et al., 2012b; Wan et al., 2013), batch/weight normalization (Ioffe & Szegedy, 2015; Salimans & Kingma, 2016), and various activation functions (Nair & Hinton, 2010; Gulcehre et al., 2016). On the other hand, stochastic feedforward neural networks (SFNN) (Neal, 1990) having random latent units are often necessary in order to model complex stochastic natures in many real-world tasks, e.g., structured prediction (Tang & Salakhutdinov, 2013), image generation (Goodfellow et al., 2014) and memory networks (Zaremba & Sutskever, 2015). Furthermore, it has been believed that SFNN has several advantages beyond DNN (Raiko et al., 2014): it has more expressive power for multi-modal learning and regularizes better for large-scale learning.
Training large-scale SFNN is notoriously hard since backpropagation is not directly applicable. Certain stochastic neural networks using continuous random units are known to be trainable efficiently using backpropagation under the variational techniques and the reparameterization tricks (Kingma & Welling, 2013). On the other hand, training SFNN having discrete, i.e., binary or multi-modal, random units is more difficult since intractable probabilistic inference is involved requiring too many random samples. There have been several efforts developing efficient training methods for SFNN having binary random latent units (Neal, 1990; Saul et al., 1996; Tang & Salakhutdinov, 2013; Bengio et al., 2013; Raiko et al., 2014; Gu et al., 2015) (see Section 2.1 for more details). However, training SFNN is still significantly slower than doing DNN of the same architecture, e.g., most prior
works on this line have considered a small number (at most 5 or so) of layers in SFNN. We aim for the same goal, but our direction is orthogonal to them.
Instead of training SFNN directly, we study whether pre-trained parameters of DNN (or easier models) can be transferred to it, possibly with further fine-tuning of light cost. This approach can be attractive since one can utilize recent advances in DNN on its design and training. For example, one can design the network structure of SFNN following known specialized ones of DNN and use their pre-trained parameters. To this end, we first try transferring pre-trained parameters of DNN using sigmoid activation functions to those of the corresponding SFNN directly. In our experiments, the heuristic reasonably works well. For multi-modal learning, SFNN under such a simple transformation outperforms DNN. Even for the MNIST classification, the former performs similarly as the latter (see Section 2 for more details). However, it is questionable whether a similar strategy works in general, particularly for other unbounded activation functions like ReLU (Nair & Hinton, 2010) since SFNN has binary, i.e., bounded, random latent units. Moreover, it lost the regularization benefit of SFNN: it is rather believed that transferring parameters of stochastic models to DNN helps its regularization, but the opposite direction is unlikely possible.
To address the issues, we propose a special form of stochastic neural networks, named SimplifiedSFNN, which intermediates between SFNN and DNN, having the following properties. First, Simplified-SFNN can be built upon any baseline DNN, possibly having unbounded activation functions. The most significant part of our approach lies in providing rigorous network knowledge transferring (Chen et al., 2015) between Simplified-SFNN and DNN. In particular, we prove that parameters of DNN can be transformed to those of the corresponding Simplified-SFNN while preserving the performance, i.e., both represent the same mapping and features. Second, Simplified-SFNN approximates certain SFNN, better than DNN, by simplifying its upper latent units above stochastic ones using two different non-linear activation functions. Simplified-SFNN is much easier to train than SFNN while utilizing its stochastic nature for regularization.
The above connection DNN→ Simplified-SFNN→ SFNN naturally suggests the following training procedure for both SFNN and Simplified-SFNN: train a baseline DNN first and then fine-tune its corresponding Simplified-SFNN initialized by the transformed DNN parameters. The pre-training stage accelerates the training task since DNN is faster to train than Simplified-SFNN. In addition, one can also utilize known DNN training techniques such as dropout and batch normalization for fine-tuning Simplified-SFNN. In our experiments, we train SFNN and Simplified-SFNN under the proposed strategy. They consistently outperform the corresponding DNN for both multi-modal and classification tasks, where the former and the latter are for measuring the model expressive power and the regularization effect, respectively. To the best of our knowledge, we are the first to confirm that SFNN indeed regularizes better than DNN. We also construct the stochastic models following the same network structure of popular DNNs including Lenet-5 (LeCun et al., 1998), NIN (Lin et al., 2014) and WRN (Zagoruyko & Komodakis, 2016). In particular, WRN (wide residual network) of 28 layers and 36 million parameters has shown the state-of-art performances on CIFAR-10 and CIFAR-100 classification datasets, and our stochastic models built upon WRN outperform the deterministic WRN on the datasets.
Organization. In Section 2, we focus on DNNs having sigmoid and ReLU activation functions and study simple transformations of their parameters to those of SFNN. In Section 3, we consider DNNs having general activation functions and describe more advanced transformations via introducing a new model, named Simplified-SFNN.
2 SIMPLE TRANSFORMATION FROM DNN TO SFNN
2.1 PRELIMINARIES FOR SFNN
Stochastic feedforward neural network (SFNN) is a hybrid model, which has both stochastic binary and deterministic hidden units. We first introduce SFNN with one stochastic hidden layer (and without deterministic hidden layers) for simplicity. Throughout this paper, we commonly denote the bias for unit i and the weight matrix of the `-th hidden layer by b`i and W
`, respectively. Then, the stochastic hidden layer in SFNN is defined as a binary random vector with N1 units, i.e., h1 ∈
{0, 1}N1 , drawn under the following distribution:
P ( h1 | x ) = N1∏ i=1 P ( h1i | x ) , where P ( h1i = 1 | x ) = σ ( W1ix+ b 1 i ) . (1)
In the above, x is the input vector and σ (x) = 1/ (1 + e−x) is the sigmoid function. Our conditional distribution of the output y is defined as follows:
P (y | x) = EP (h1|x) [ P ( y | h1 )] = EP (h1|x) [ N ( y |W2h1 + b2, σ2y )] ,
where N (·) denotes the normal distribution with mean W2h1 + b2 and (fixed) variance σ2y . Therefore, P (y | x) can express a very complex, multi-modal distribution since it is a mixture of exponentially many normal distributions. The multi-layer extension is straightforward via a combination of stochastic and deterministic hidden layers, e.g., see Tang & Salakhutdinov (2013), Raiko et al. (2014). Furthermore, one can use any other output distributions as like DNN, e.g., softmax for classification tasks.
There are two computational issues for training SFNN: computing expectations with respect to stochastic units in forward pass and computing gradients in backward pass. One can notice that both are computationally intractable since they require summations over exponentially many configurations of all stochastic units. First, in order to handle the issue in forward pass, one can use the follow-
ing Monte Carlo approximation for estimating the expectation: P (y | x) w 1M M∑ m=1 P (y | h(m)),
where h(m) ∼ P ( h1 | x ) and M is the number of samples. This random estimator is unbiased and has relatively low variance (Tang & Salakhutdinov, 2013) since its accuracy does not depend on the dimensionality of h1 and one can draw samples from the exact distribution. Next, in order to handle the issue in backward pass, Neal (1990) proposed a Gibbs sampling, but it is known that it often mixes poorly. Saul et al. (1996) proposed a variational learning based on the mean-field approximation, but it has additional parameters making the variational lower bound looser. More recently, several other techniques have been proposed including unbiased estimators of the variational bound using importance sampling (Tang & Salakhutdinov, 2013; Raiko et al., 2014) and biased/unbiased estimators of the gradient for approximating backpropagation (Bengio et al., 2013; Raiko et al., 2014; Gu et al., 2015).
2.2 SIMPLE TRANSFORMATION FROM SIGMOID-DNN AND RELU-DNN TO SFNN
Despite the recent advances, training SFNN is still very slow compared to DNN due to the sampling procedures: in particular, it is notoriously hard to train SFNN when the network structure is deeper and wider. In order to handle these issues, we consider the following approximation:
P (y | x) = EP (h1|x) [ N ( y |W2h1 + b2, σ2y )] w N ( y | EP (h1|x) [ W2h1 ] + b2, σ2y ) = N ( y |W2σ ( W1x+ b1 ) + b2, σ2y ) . (2)
Note that the above approximation corresponds to replacing stochastic units by deterministic ones such that their hidden activation values are same as marginal distributions of stochastic units, i.e., SFNN can be approximated by DNN using sigmoid activation functions, say sigmoid-DNN. When there exist more latent layers above the stochastic one, one has to apply similar approximations to all of them, i.e., exchanging the orders of expectations and non-linear functions, for making DNN and SFNN are equivalent. Therefore, instead of training SFNN directly, one can try transferring pretrained parameters of sigmoid-DNN to those of the corresponding SFNN directly: train sigmoidDNN instead of SFNN, and replace deterministic units by stochastic ones for the inference purpose. Although such a strategy looks somewhat ‘rude’, it was often observed in the literature that it reasonably works well for SFNN (Raiko et al., 2014) and we also evaluate it as reported in Table 1. We also note that similar approximations appear in the context of dropout: it trains a stochastic model averaging exponentially many DNNs sharing parameters, but also approximates a single DNN well.
Now we investigate a similar transformation in the case when DNN uses the unbounded ReLU activation function, say ReLU-DNN. Many recent deep networks are of ReLU-DNN type due to the gradient vanishing problem, and their pre-trained parameters are often available. Although it is straightforward to build SFNN from sigmoid-DNN, it is less clear in this case since ReLU is
unbounded. To handle this issue, we redefine the stochastic latent units of SFNN:
P ( h1 | x ) = N1∏ i=1 P ( h1i | x ) , where P ( h1i = 1 | x ) = min { αf ( W1ix+ b 1 i ) , 1 } . (3)
In the above, f(x) = max{x, 0} is the ReLU activation function and α is some hyper-parameter. A simple transformation can be defined similarly as the case of sigmoid-DNN via replacing deterministic units by stochastic ones. However, to preserve the parameter information of ReLU-DNN, one has to choose α such that αf ( W1ix+ b 1 i ) ≤ 1 and rescale upper parameters W2 as follows:
α−1 ← max i,x ∣∣∣f (Ŵ1ix+ b̂1i)∣∣∣ , (W1, b1)← (Ŵ1, b̂1) , (W2, b2)← ( Ŵ2/α, b̂2) . (4) Then, applying similar approximations as in (2), i.e., exchanging the orders of expectations and non-linear functions, one can observe that ReLU-DNN and SFNN are equivalent.
We evaluate the performance of the simple transformations from DNN to SFNN on the MNIST dataset (LeCun et al., 1998) and the synthetic dataset (Bishop, 1994), where the former and the latter are popular datasets used for a classification task and a multi-modal (i.e., one-to-many mappings) prediction learning, respectively. In all experiments reported in this paper, we commonly use the softmax and Gaussian with standard deviation of σy = 0.05 are used for the output probability on classification and regression tasks, respectively. The only first hidden layer of DNN is replaced by stochastic one, and we use 500 samples for estimating the expectations in the SFNN inference. As reported in Table 1, we observe that the simple transformation often works well for both tasks: the SFNN and sigmoid-DNN inferences (using same parameters trained by sigmoid-DNN) perform similarly for the classification task and the former significantly outperforms for the latter for the
multi-modal task (also see Figure 1). It might suggest some possibilities that the expensive SFNN training might not be not necessary, depending on the targeted learning quality. However, in case of ReLU, SFNN performs much worse than ReLU-DNN for the MNIST classification task under the parameter transformation.
3 TRANSFORMATION FROM DNN TO SFNN VIA SIMPLIFIED-SFNN
In this section, we propose an advanced method to utilize the pre-trained parameters of DNN for training SFNN. As shown in the previous section, simple parameter transformations from DNN to SFNN are not clear to work in general, in particular for activation functions other than sigmoid. Moreover, training DNN does not utilize the stochastic regularizing effect, which is an important benefit of SFNN. To address the issues, we design an intermediate model, called Simplified-SFNN. The proposed model is a special form of stochastic neural networks, which approximates certain SFNN by simplifying its upper latent units above stochastic ones. Then, we establish more rigorous connections between three models: DNN → Simplified-SFNN → SFNN, which leads to an efficient training procedure of the stochastic models utilizing pre-trained parameters of DNN. In our experiments, we evaluate the strategy for various tasks and popular DNN architectures.
3.1 SIMPLIFIED-SFNN OF TWO HIDDEN LAYERS AND NON-NEGATIVE ACTIVATION FUNCTIONS
For clarity of presentation, we first introduce Simplified-SFNN with two hidden layers and nonnegative activation functions, where its extensions to multiple layers and general activation functions are presented in Appendix B. We also remark that we primarily describe fully-connected SimplifiedSFNNs, but their convolutional versions can also be naturally defined. In Simplified-SFNN of two hidden layers, we assume that the first and second hidden layers consist of stochastic binary hidden units and deterministic ones, respectively. As like (3), the first layer is defined as a binary random vector with N1 units, i.e., h1 ∈ {0, 1}N1 , drawn under the following distribution:
P ( h1 | x ) = N1∏ i=1 P ( h1i | x ) , where P ( h1i = 1 | x ) = min { α1f ( W1ix+ b 1 i ) , 1 } . (5)
where x is the input vector, α1 > 0 is a hyper-parameter for the first layer, and f : R→ R+ is some non-negative non-linear activation function with |f ′(x)| ≤ 1 for all x ∈ R, e.g., ReLU and sigmoid activation functions. Now the second layer is defined as the following deterministic vector with N2 units, i.e., h2(x) ∈ RN2 : h2 (x) = [ f ( α2 ( EP (h1|x) [ s ( W2jh 1 + b2j )] − s (0) )) : ∀j ∈ N2 ] , (6)
where α2 > 0 is a hyper-parameter for the second layer and s : R → R is a differentiable function with |s′′(x)| ≤ 1 for all x ∈ R, e.g., sigmoid and tanh functions. In our experiments, we use the sigmoid function for s(x). Here, one can note that the proposed model also has the same computational issues with SFNN in forward and backward passes due to the complex expectation. One can train Simplified-SFNN similarly as SFNN: we use Monte Carlo approximation for estimating the expectation and the (biased) estimator of the gradient for approximating backpropagation inspired by Raiko et al. (2014) (more detailed explanation is presented in Appendix A).
We are interested in transferring parameters of DNN to Simplified-SFNN to utilize the training benefits of DNN since the former is much faster to train than the latter. To this end, we consider the following DNN of which `-th hidden layer is deterministic and defined as follows:
ĥ` (x) = [ ĥ`i (x) = f ( Ŵ`i ĥ `−1 (x) + b̂`i ) : i ∈ N ` ] , (7)
where ĥ0(x) = x. As stated in the following theorem, we establish a rigorous way how to initialize parameters of Simplified-SFNN in order to transfer the knowledge stored in DNN.
Theorem 1 Assume that both DNN and Simplified-SFNN with two hidden layers have same network structure with non-negative activation function f . Given parameters {Ŵ`, b̂` : ` = 1, 2} of DNN and input dataset D, choose those of Simplified-SFNN as follows:(
α1,W 1, b1 ) ← ( 1
γ1 , Ŵ1, b̂1
) , ( α2,W 2, b2 ) ← ( γ2γ1 s′ (0) , 1 γ2 Ŵ2, 1 γ1γ2 b̂2 ) , (8)
where γ1 = max
i,x∈D
∣∣∣f (Ŵ1ix+ b̂1i)∣∣∣ and γ2 > 0 is any positive constant. Then, it follows that
∣∣∣h2j (x)− ĥ2j (x)∣∣∣ ≤ γ1 (∑ i ∣∣∣Ŵ 2ij∣∣∣+ b̂2jγ−11 )2 2s′ (0) γ2 , ∀j,x ∈ D.
The proof of the above theorem is presented in Appendix D.1. Our proof is built upon the first-order Taylor expansion of non-linear function s(x). Theorem 1 implies that one can make Simplified-SFNN represent the function values of DNN with bounded errors using a linear transformation. Furthermore, the errors can be made arbitrarily small by choosing large γ2, i.e., lim γ2→∞
∣∣∣h2j (x)− ĥ2j (x)∣∣∣ = 0, ∀j,x ∈ D. Figure 2(c) shows that knowledge transferring loss decreases as γ2 increases on MNIST classification. Based on this, we choose γ2 = 50 commonly for all experiments.
3.2 WHY SIMPLIFIED-SFNN ?
Given a Simplified-SFNN model, the corresponding SFNN can be naturally defined by taking out the expectation in (6). As illustrated in Figure 2(a), the main difference between SFNN and SimplifiedSFNN is that the randomness of the stochastic layer propagates only to its upper layer in the latter, i.e., the randomness of h1 is averaged out at its upper units h2 and does not propagate to h3 or output y. Hence, Simplified-SFNN is no longer a Bayesian network. This makes training Simplified-SFNN much easier than SFNN since random samples are not required at some layers1 and consequently the quality of gradient estimations can also be improved, in particular for unbounded activation functions. Furthermore, one can use the same approximation procedure (2) to see that SimplifiedSFNN approximates SFNN. However, since Simplified-SFNN still maintains binary random units, it uses approximation steps later, in comparison with DNN. In summary, Simplified-SFNN is an intermediate model between DNN and SFNN, i.e., DNN→ Simplified-SFNN→ SFNN. The above connection naturally suggests the following training procedure for both SFNN and Simplified-SFNN: train a baseline DNN first and then fine-tune its corresponding Simplified-SFNN initialized by the transformed DNN parameters. Finally, the fine-tuned parameters can be used for SFNN as well. We evaluate the strategy for the MNIST classification, which is reported in Table 2 (see Appendix C for more detailed experiment setups). We found that SFNN under the two-stage training always performs better than SFNN under a simple transformation (4) from ReLU-DNN.
1 For example, if one replaces the first feature maps in the fifth residual unit of Pre-ResNet having 164 layers (He et al., 2016) by stochastic ones, then the corresponding DNN, Simplified-SFNN and SFNN took 1 mins 35 secs, 2 mins 52 secs and 16 mins 26 secs per each training epoch, respectively, on our machine with one Intel CPU (Core i7-5820K 6-Core@3.3GHz) and one NVIDIA GPU (GTX Titan X, 3072 CUDA cores). Here, we trained both stochastic models using the biased estimator (Raiko et al., 2014) with 10 random samples on CIFAR-10 dataset.
More interestingly, Simplified-SFNN consistently outperforms its baseline DNN due to the stochastic regularizing effect, even when we train both models using dropout (Hinton et al., 2012b) and batch normalization (Ioffe & Szegedy, 2015). In order to confirm the regularization effects, one can again approximate a trained Simplified-SFNN by a new deterministic DNN which we call DNN∗ and is different from its baseline DNN under the following approximation at upper latent units above binary random units:
EP (h`|x) [ s ( W`+1j h ` )] w s ( EP (h`|x) [ W`+1j h ` ]) = s (∑ i W `+1ij P ( h`i = 1 | x )) . (9)
We found that DNN∗ using fined-tuned parameters of Simplified-SFNN also outperforms the baseline DNN as shown in Table 2 and Figure 2(b).
3.3 EXPERIMENTAL RESULTS ON MULTI-MODAL LEARNING AND CONVOLUTIONAL NETWORKS
We present several experimental results for both multi-modal and classification tasks on MNIST (LeCun et al., 1998), Toronto Face Database (TFD) (Susskind et al., 2010), CIFAR-10, CIFAR-100 (Krizhevsky & Hinton, 2009) and SVHN (Netzer et al., 2011). Here, we present some key results due to the space constraints and more detailed explanations for our experiment setups are presented in Appendix C.
We first verify that it is possible to learn one-to-many mapping via Simplified-SFNN on the TFD and MNIST datasets, where the former and the latter are used to predict multiple facial expressions from the mean of face images per individual and the lower half of the MNIST digit given the upper half, respectively. We remark that both tasks are commonly performed in recent other works to test the multi-modal learning using SFNN (Raiko et al., 2014; Gu et al., 2015). In all experiments, we first train a baseline DNN, and the trained parameters of DNN are used for further fine-tuning those of Simplified-SFNN. As shown in Table 3 and Figure 3, stochastic models outperform their baseline DNN, and generate different digits for the case of ambiguous inputs (while DNN does not). We also evaluate the regularization effect of Simplified-SFNN for the classification tasks on CIFAR-10, CIFAR-100 and SVHN. Table 4 reports the classification error rates using convolutional neural networks such as Lenet-5 (LeCun et al., 1998), NIN (Lin et al., 2014) and WRN (Zagoruyko & Komodakis, 2016). Due to the regularization effects, Simplified-SFNNs consistently outperform
their baseline DNNs. For example, WRN∗ outperforms WRN by 0.08% on CIFAR-10 and 0.58% on CIFAR-100. We expect that if one introduces more stochastic layers, the error would be decreased more (see Figure 4), but it increases the fine-tuning time-complexity of Simplified-SFNN.
4 CONCLUSION
In order to develop an efficient training method for large-scale SFNN, this paper proposes a new intermediate stochastic model, called Simplified-SFNN. We establish the connection between three models, i.e., DNN → Simplified-SFNN → SFNN, which naturally leads to an efficient training procedure of the stochastic models utilizing pre-trained parameters of DNN. This connection naturally leads an efficient training procedure of the stochastic models utilizing pre-trained parameters and architectures of DNN. We believe that our work brings a new important direction for training stochastic neural networks, which should be of broader interest in many related applications.
A TRAINING SIMPLIFIED-SFNN
The parameters of Simplified-SFNN can be learned using a variant of the backpropagation algorithm (Rumelhart et al., 1988) in a similar manner to DNN. However, in contrast to DNN, there are two computational issues for simplified-SFNN: computing expectations with respect to stochastic units in forward pass and computing gradients in back pass. One can notice that both are intractable since they require summations over all possible configurations of all stochastic units. First, in order to handle the issue in forward pass, we use the following Monte Carlo approximation for estimating the expectation:
EP (h1|x) [ s ( W2jh 1 + b2j )] w 1
M M∑ m=1 s ( W2jh (m) + b2j ) , h(m) ∼ P ( h1 | x ) ,
where M is the number of samples. This random estimator is unbiased and has relatively low variance (Tang & Salakhutdinov, 2013) since its accuracy does not depend on the dimensionality of h1 and one can draw samples from the exact distribution. Next, in order to handle the issue in back pass, we use the following approximation inspired by (Raiko et al., 2014):
∂
∂W2j EP (h1|x)
[ s ( W2jh 1 + b2j )] w 1
M ∑ m ∂ ∂W2j s ( W2jh (m) + b2j ) ,
∂
∂W1i EP (h1|x)
[ s ( W2jh 1 + b2j )] w W 2ij M ∑ m s′ ( W2jh (m) + b2j ) ∂ ∂W1i P ( h1i = 1 | x ) ,
where h(m) ∼ P ( h1 | x ) and M is the number of samples. In our experiments, we commonly choose M = 20.
B EXTENSIONS OF SIMPLIFIED-SFNN
In this section, we describe how the network knowledge transferring between Simplified-SFNN and DNN, i.e., Theorem 1, generalizes to multiple layers and general activation functions.
B.1 EXTENSION TO MULTIPLE LAYERS
A deeper Simplified-SFNN with L hidden layers can be defined similarly as the case of L = 2. We also establish network knowledge transferring between Simplified-SFNN and DNN with L hidden layers as stated in the following theorem. Here, we assume that stochastic layers are not consecutive for simpler presentation, but the theorem is generalizable for consecutive stochastic layers.
Theorem 2 Assume that both DNN and Simplified-SFNN with L hidden layers have same network structure with non-negative activation function f . Given parameters {Ŵ`, b̂` : ` = 1, . . . , L} of DNN and input dataset D, choose the same ones for Simplified-SFNN initially and modify them for each `-th stochastic layer and its upper layer as follows:
α` ← 1 γ` , ( α`+1,W `+1, b`+1 ) ← ( γ`γ`+1 s′ (0) , Ŵ`+1 γ`+1 , b̂`+1 γ`γ`+1 ) ,
where γ` = max i,x∈D ∣∣∣f (Ŵ`ih`−1(x) + b̂`i)∣∣∣ and γ`+1 is any positive constant. Then, it follows that lim
γ`+1→∞ ∀ stochastic hidden layer ` ∣∣∣hLj (x)− ĥLj (x)∣∣∣ = 0, ∀j,x ∈ D. The above theorem again implies that it is possible to transfer knowledge from DNN to SimplifiedSFNN by choosing large γl+1. The proof of Theorem 2 is similar to that of Theorem 1 and given in Appendix D.2.
B.2 EXTENSION TO GENERAL ACTIVATION FUNCTIONS
In this section, we describe an extended version of Simplified-SFNN which can utilize any activation function. To this end, we modify the definitions of stochastic layers and their upper layers by introducing certain additional terms. If the `-th hidden layer is stochastic, then we slightly modify the original definition (5) as follows:
P ( h` | x ) = N`∏ i=1 P ( h`i | x ) with P ( h`i = 1 | x ) = min { α`f ( W1ix+ b 1 i + 1 2 ) , 1 } ,
where f : R → R is a non-linear (possibly, negative) activation function with |f ′(x)| ≤ 1 for all x ∈ R. In addition, we re-define its upper layer as follows:
h`+1 (x) = [ f ( α`+1 ( EP (h`|x) [ s ( W`+1j h ` + b`+1j )] − s (0)−s ′ (0)
2 ∑ i W `+1ij
)) : ∀j ] ,
where h0(x) = x and s : R→ R is a differentiable function with |s′′(x)| ≤ 1 for all x ∈ R. Under this general Simplified-SFNN model, we also show that transferring network knowledge from DNN to Simplified-SFNN is possible as stated in the following theorem. Here, we again assume that stochastic layers are not consecutive for simpler presentation.
Theorem 3 Assume that both DNN and Simplified-SFNN with L hidden layers have same network structure with non-linear activation function f . Given parameters {Ŵ`, b̂` : ` = 1, . . . , L} of DNN and input dataset D, choose the same ones for Simplified-SFNN initially and modify them for each `-th stochastic layer and its upper layer as follows:
α` ← 1 2γ` , ( α`+1,W `+1, b`+1 ) ← ( 2γ`γ`+1 s′(0) , Ŵ`+1 γ`+1 , b̂`+1 2γ`γ`+1 ) ,
where γ` = max i,x∈D ∣∣∣f (Ŵ`ih`−1(x) + b̂`i)∣∣∣, and γ`+1 is any positive constant. Then, it follows that lim
γ`+1→∞ ∀ stochastic hidden layer ` ∣∣∣hLj (x)− ĥLj (x)∣∣∣ = 0, ∀j,x ∈ D. We omit the proof of the above theorem since it is somewhat direct adaptation of that of Theorem 2.
C EXPERIMENTAL SETUPS
In this section, we describe detailed explanation about all the experiments described in Section 3. In all experiments, the softmax and Gaussian with the standard deviation of 0.05 are used as the output probability for the classification task and the multi-modal prediction, respectively. The loss was minimized using ADAM learning rule (Kingma & Ba, 2014) with a mini-batch size of 128. We used an exponentially decaying learning rate.
C.1 CLASSIFICATION ON MNIST
The MNIST dataset consists of 28 × 28 pixel greyscale images, each containing a digit 0 to 9 with 60,000 training and 10,000 test images. For this experiment, we do not use any data augmentation or pre-processing. Hyper-parameters are tuned on the validation set consisting of the last 10,000 training images. All Simplified-SFNNs are constructed by replacing the first hidden layer of a baseline DNN with stochastic hidden layer. As described in Section 3.2, we train Simplified-SFNNs under the two-stage procedure: first train a baseline DNN for first 200 epochs, and the trained parameters of DNN are used for initializing those of Simplified-SFNN. For 50 epochs, we train simplified-SFNN. We choose the hyper-parameter γ2 = 50 in the parameter transformation. All Simplified-SFNNs are trained with M = 20 samples at each epoch, and in the test, we use 500 samples.
C.2 MULTI-MODAL REGRESSION ON TFD AND MNIST
The Toronto Face Database (TFD) (Susskind et al., 2010) dataset consists of 48×48 pixel greyscale images, each containing a face image of 900 individuals with 7 different expressions. Similar to (Raiko et al., 2014), we use 124 individuals with at least 10 facial expressions as data. We randomly choose 100 individuals with 1403 images for training and the remaining 24 individuals with 326 images for the test. We take the mean of face images per individual as the input and set the output as the different expressions of the same individual. The MNIST dataset consists of 28 × 28 pixel greyscale images, each containing a digit 0 to 9 with 60,000 training and 10,000 test images. For this experiments, each pixel of every digit images is binarized using its grey-scale value. We take the upper half of the MNIST digit as the input and set the output as the lower half of it. All SimplifiedSFNNs are constructed by replacing the first hidden layer of a baseline DNN with stochastic hidden layer. We train Simplified-SFNNs with M = 20 samples at each epoch, and in the test, we use 500 samples. We use 200 hidden units for each layer of neural networks in two experiments. Learning rate is chosen from {0.005 , 0.002, 0.001, ... , 0.0001} , and the best result is reported for both tasks.
C.3 CLASSIFICATION ON CIFAR-10, CIFAR-100 AND SVHN
The CIFAR-10 and CIFAR-100 datasets consist of 50,000 training and 10,000 test images. The SVHN dataset consists of 73,257 training and 26,032 test images.2 We pre-process the data using global contrast normalization and ZCA whitening. For these datasets, we design a convolutional version of Simplified-SFNN. In a similar manner to the case of fully-connected networks, one can define a stochastic convolution layer, which considers the input feature map as a binary random matrix and generates the output feature map as defined in (6). All Simplified-SFNNs are constructed by replacing a hidden feature map of a baseline models, i.e., Lenet-5, NIN and WRN, with stochastic one as shown in Figure 5(d). We use WRN with 16 and 28 layers for SVHN and CIFAR datasets, respectively, since they showed state-of-the-art performance as reported by Zagoruyko & Komodakis (2016). In case of WRN, we introduce up to two stochastic convolution layers.For 100 epochs, we first train baseline models, i.e., Lenet-5, NIN and WRN, and trained parameters are used for initializing those of Simplified-SFNNs. All Simplified-SFNNs are trained with M = 5 samples and the test error is only measured by the approximation (9). The test errors of baseline models are measured after training them for 200 epochs similar to Zagoruyko & Komodakis (2016).
D PROOFS OF THEOREMS
D.1 PROOF OF THEOREM 1
First consider the first hidden layer, i.e., stochastic layer. Let γ1 = max i,x∈D
f ( Ŵ1ix+ b̂ 1 i ) be
the maximum value of hidden units in DNN. If we initialize the parameters ( α1,W 1, b1 ) ←(
1 γ1 , Ŵ1, b̂1
) , then the marginal distribution of each hidden unit i becomes
P ( h1i = 1 | x,W1,b1 ) = min { α1f ( Ŵ1ix+ b̂ 1 i ) , 1 } = 1 γ1 f ( Ŵ1ix+ b̂ 1 i ) , ∀i,x ∈ D. (10)
2We do not use the extra SVHN dataset for training.
Next consider the second hidden layer. From Taylor’s theorem, there exists a value z between 0 and x such that s(x) = s(0) + s′(0)x + R(x), where R(x) = s ′′(z)x2
2! . Since we consider a binary random vector, i.e., h1 ∈ {0, 1}N1 , one can write EP (h1|x) [ s ( βj ( h1 ))]
= ∑ h1 ( s (0) + s′ (0)βj ( h1 ) +R ( βj ( h1 ))) P ( h1 | x ) = s (0) + s′ (0)
(∑ i W 2ijP (h 1 i = 1 | x) + b2j ) + EP (h1|x) [ R(βj(h 1)) ] ,
where βj ( h1 ) := W2jh
1 + b2j is the incoming signal. From (6) and (10), for every hidden unit j, it follows that
h2j ( x;W2,b2 ) = f ( α2 ( s′(0) ( 1
γ1 ∑ i W 2ij ĥ 1 i (x) + b 2 j
) + EP (h1|x) [ R ( βj ( h1 ))])) .
Since we assume that |f ′(x)| ≤ 1, the following inequality holds:∣∣∣∣∣h2j (x;W2,b2)− f ( α2s ′(0) ( 1
γ1 ∑ i W 2ij ĥ 1 i (x) + b 2 j ))∣∣∣∣∣ ≤ ∣∣α2EP (h1|x) [R(βj(h1))]∣∣ ≤ α2
2 EP (h1|x)
[( W2jh 1 + b2j )2] ,
where we use |s′′(z)| < 1 for the last inequality. Therefore, it follows that ∣∣∣h2j (x;W2,b2)− ĥ2j (x;Ŵ2, b̂2)∣∣∣ ≤ γ1 (∑ i ∣∣∣Ŵ 2ij∣∣∣+ b̂2jγ−11 )2 2s′(0)γ2 , ∀j,
since we set ( α2,W 2, b2 ) ← ( γ2γ1 s′(0) , Ŵ2 γ2 , γ−11 γ2 b̂2 ) . This completes the proof of Theorem 1.
D.2 PROOF OF THEOREM 2
For the proof of Theorem 2, we first state the two key lemmas on error propagation in SimplifiedSFNN.
Lemma 4 Assume that there exists some positive constant B such that∣∣∣h`−1i (x)− ĥ`−1i (x)∣∣∣ ≤ B, ∀i,x ∈ D, and the `-th hidden layer of NCSFNN is standard deterministic layer as defined in (7). Given parameters {Ŵ`, b̂`} of DNN, choose same ones for NCSFNN. Then, the following inequality holds:∣∣∣h`j (x)− ĥ`j (x)∣∣∣ ≤ BN `−1Ŵ `max, ∀j,x ∈ D. where Ŵ `max = max
ij ∣∣∣Ŵ `ij∣∣∣. Proof. See Appendix D.3.
Lemma 5 Assume that there exists some positive constant B such that∣∣∣h`−1i (x)− ĥ`−1i (x)∣∣∣ ≤ B, ∀i,x ∈ D, and the `-th hidden layer of simplified-SFNN is stochastic layer. Given parameters {Ŵ`,Ŵ`+1, b̂`, b̂`+1} of DNN, choose those of Simplified-SFNN as follows:
α` ← 1 γ` , ( α`+1,W `+1, b`+1 ) ← ( γ`γ`+1 s′ (0) , Ŵ`+1 γ`+1 , b̂`+1 γ`γ`+1 ) ,
where γ` = max j,x∈D ∣∣∣f (Ŵ`jh`−1(x) + b̂`j)∣∣∣ and γ`+1 is any positive constant. Then, it follows that ∣∣∣h`+1k (x)− ĥ`+1k (x)∣∣∣ ≤ BN `−1N `Ŵ `maxŴ `+1max + ∣∣∣∣∣∣∣ γ` ( N `Ŵ `+1max + b̂ `+1 maxγ −1 ` )2 2s′(0)γ`+1
∣∣∣∣∣∣∣ , ∀k,x ∈ D, where b̂`max = max
j ∣∣∣̂b`j∣∣∣ and Ŵ `max = max ij ∣∣∣Ŵ `ij∣∣∣. Proof. See Appendix D.4.
Assume that `-th layer is first stochastic hidden layer in Simplified-SFNN. Then, from Theorem 1, we have
∣∣∣h`+1j (x)− ĥ`+1j (x)∣∣∣ ≤ ∣∣∣∣∣∣∣ γ` ( N `Ŵ `+1max + b̂ `+1 maxγ −1 ` )2 2s′(0)γ`+1 ∣∣∣∣∣∣∣ , ∀j,x ∈ D. (11)
According to Lemma 4 and 5, the final error generated by the right hand side of (11) is bounded by
τ`γ` ( N `Ŵ `+1max + b̂ `+1 maxγ −1 ` )2 2s′ (0) γ`+1 , (12)
where τ` = L∏
`′=l+2
( N ` ′−1Ŵ ` ′
max
) . One can note that every error generated by each stochastic layer
is bounded by (12). Therefore, it follows that
∣∣∣hLj (x)− ĥLj (x)∣∣∣ ≤ ∑ `:stochastic hidden layer
τ`γ` ( N `Ŵ `+1max + b̂ `+1 maxγ −1 ` )2 2s′ (0) γ`+1  , ∀j,x ∈ D. From above inequality, we can conclude that
lim γ`+1→∞
∀ stochastic hidden layer ` ∣∣∣hLj (x)− ĥLj (x)∣∣∣ = 0, ∀j,x ∈ D. This completes the proof of Theorem 2.
D.3 PROOF OF LEMMA 4
From assumption, there exists some constant i such that | i| < B and
h`−1i (x) = ĥ `−1 i (x) + i, ∀i,x.
By definition of standard deterministic layer, it follows that
h`j (x) = f (∑ i Ŵ `ijh `−1 i (x) + b̂ `−1 j ) = f (∑ i Ŵ `ij ĥ `−1 i (x) + ∑ i Ŵ `ij i + b̂ ` j ) .
Since we assume that |f ′(x)| ≤ 1, one can conclude that∣∣∣∣∣h`j (x)− f (∑
i
Ŵ `ij ĥ `−1 i (x) + b̂ ` j )∣∣∣∣∣ ≤ ∣∣∣∣∣∑ i Ŵ `ij i ∣∣∣∣∣ ≤ B ∣∣∣∣∣∑ i Ŵ `ij ∣∣∣∣∣ ≤ BN `−1Ŵ `max. This completes the proof of Lemma 4.
D.4 PROOF OF LEMMA 5
From assumption, there exists some constant `−1i such that ∣∣ `−1i ∣∣ < B and
h`−1i (x) = ĥ `−1 i (x) + `−1 i , ∀i,x. (13)
Let γ` = max j,x∈D ∣∣∣f (Ŵ`jh`−1(x) + b̂`j)∣∣∣ be the maximum value of hidden units. If we initialize the parameters ( α`,W `, b` ) ← (
1 γ` , Ŵ`, b̂`
) , then the marginal distribution becomes
P ( h`j = 1 | x,W`,b` ) = min { α`f ( Ŵ`jh `−1 (x) + b̂`j ) , 1 } = 1 γ` f ( Ŵ`jh `−1 (x) + b̂`j ) , ∀j,x.
From (13), it follows that
P ( h`j = 1 | x,W`,b` ) = 1
γ` f
( Ŵ`jĥ `−1 (x) + ∑ i Ŵ `ij `−1 i + b̂ ` j ) , ∀j,x.
Similar to Lemma 4, there exists some constant `j such that ∣∣ `j∣∣ < BN `−1Ŵ `max and
P ( h`j = 1 | x,W`,b` ) = 1
γ`
( ĥ`j (x) + ` j ) , ∀j,x. (14)
Next, consider the upper hidden layer of stochastic layer. From Taylor’s theorem, there exists a value z between 0 and t such that s(x) = s(0) + s′(0)x+ R(x), where R(x) = s ′′(z)x2
2! . Since we consider a binary random vector, i.e., h` ∈ {0, 1}N` , one can write
EP (h`|x)[s(βk(h`))] = ∑ h` ( s(0) + s′(0)βk(h `) +R ( βk(h `) )) P (h` | x)
= s(0) + s′(0) ∑ j W `+1jk P (h ` j = 1 | x) + b`+1k +∑ h` R(βk(h `))P (h` | x),
where βk(h`) = W`+1k h ` + b`+1k is the incoming signal. From (14) and above equation, for every hidden unit k, we have
h`+1k (x;W `+1,b`+1)
= f α`+1 s′(0)  1 γ` ∑ j W `+1jk ĥ ` j(x) + ∑ j W `+1jk ` j + b`+1k + EP (h`|x) [R(βk(h`))]  . Since we assume that |f ′(x)| < 1, the following inequality holds:∣∣∣∣∣∣h`+1k (x;W`+1,b`+1)− f α`+1s′(0)  1 γ` ∑ j W `+1ij ĥ ` j(x) + b `+1 j
∣∣∣∣∣∣ ≤ ∣∣∣∣∣∣α`+1s ′(0) γ` ∑ j W `+1jk ` j + α`+1EP (h`|x) [ R(βk(h `)) ]∣∣∣∣∣∣
≤ ∣∣∣∣∣∣α`+1s ′(0) γ` ∑ j W `+1jk ` j ∣∣∣∣∣∣+ ∣∣∣α`+1 2 EP (h`|x) [( W`+1k h ` + b`+1k )2]∣∣∣ , (15)
where we use |s′′(z)| < 1 for the last inequality. Therefore, it follows that ∣∣∣h`+1k (x)− ĥ`+1k (x)∣∣∣ ≤ BN `−1N `Ŵ `maxŴ `+1max + ∣∣∣∣∣∣∣ γ` ( N `Ŵ `+1max + b̂ `+1 maxγ −1 ` )2 2s′(0)γ`+1 ∣∣∣∣∣∣∣ , since we set ( α`+1,W `+1, b`+1 ) ← ( γ`+1γ` s′(0) , Ŵ`+1 γ`+1 , γ−1` b̂ `+1 γ`+1 ) . This completes the proof of Lemma 5.

Review:
Update: Because no revision of the paper has been provided by the authors, I am reducing my rating to "marginally below acceptance".
----------
This paper addresses the problem of training stochastic feedforward neural networks.  It proposes to transfer weights from a deterministic deep neural network trained using standard procedures (including techniques such as dropout and batch normalization) to a stochastic network having the same topology.  The initial mechanism described for performing the transfer involves a rescaling of unit inputs and layer weights, and appropriate specification of the stochastic latent units if the DNN used for pretraining employs ReLU nonlinearities.  Initial experiments on MNIST classification and a toy generative task with a multimodal target distribution show that the simple transfer process works well if the DNN used for pretraining uses sigmoid nonlinearities, but not if the pretraining DNN uses ReLUs.  To tackle this problem, the paper introduces the "simplified stochastic feedforward neural network," in which every stochastic layer is followed by a layer that takes an expectation over samples from its input, thus limiting the propagation of stochasticity in the network.  A modified process for transferring weights from a pretraining DNN to the simplified SFNN is described and justified.  The training process then occurs in three steps:  (1) pretrain a DNN, (2) transfer weights from the DNN to a simplified SFNN and continue training, and (3) optionally transfer the weights to a full SFNN and continue training or transfer them to a deterministic model (called DNN*) and continue training.  The third step can be skipped and the simplified SFNN may also be used directly as an inference model.  Experimental results on MNIST classification show that the use of simplified SFNN training can improve a deterministic DNN* model over a DNN baseline trained with batch normalization and dropout.  Experiments on two generative tasks (MNIST-half and the Toronto Faces Database) show that the proposed pretraining process improves test set negative log-likelihoods.  Finally, experiments on CIFAR-10, CIFAR-100, and SVHN with the LeNet-5, network-in-network, and wide residual network architectures show that use of a stochastic training step can improve performance of a deterministic (DNN*) model.
It is a bit confusing to refer to "multi-modal" tasks, when what is meant is "generative tasks with a multimodal target distribution" because "multi-modal" task can also refer to a learning task that crosses sensory modalities such as audio-visual speech recognition, text-based image retrieval, or image captioning.  I recommend that you use the more precise term ("generative tasks with a multimodal target distribution") early in the introduction and then say that you will refer to such tasks as "multi-modal tasks" in the rest of the paper for the sake of brevity.
The paper would be easier to read if "SFNN" were not used to refer to both the singular ("stochastic feedforward neural network") and plural ("stochastic feedforward neural networks") cases.  When the plural is meant, write "SFNNs".
In Table 1, why does the 3 hidden layer SFNN initialized from a ReLU DNN have so much worse of a test NLL than the 2 hidden layer SFNN initialized from a ReLU DNN?
The notation that uses superscripts to indicate layer indexes is confusing.  The reader naturally parses N² as "N squared" and not as "the number of units in the second layer."
When you transfer weights back from the simplified SFNN to the DNN* model, do you need to perform some sort of rescaling that undoes the operations in Equation (8) in the paper?
What does NCSFNN stand for in the supplementary material?
Pros
+ The proposed model is easy to implement and apply to other tasks.
+ The MNIST results showing that the stochastic model training can produce a deterministic model (called DNN* in the paper) that generalizes better than a DNN trained with batch normalization and dropout is quite exciting.
Cons
- For the reasons outlined above, the paper is at times a bit hard to follow.
- The results CIFAR-10, CIFAR-100, and SVHN would be more convincing if the baselines used dropout and batch normalization.  While this is shown on MINST, demonstration of a similar result on a more challenging task would strengthen the paper.
Minor issues
It has been believed that stochastic → It is believed that stochastic
underlying these successes is on the efficient training methods → underlying these successes is efficient training methods
necessary in order to model complex stochastic natures in many real-world tasks → necessary in to model the complex stochastic nature of many real-world tasks
structured prediction, image generation and memory networks : memory networks are models, not tasks.
Furthermore, it has been believed that SFNN → Furthermore, it is believed that SFNN
using backpropagation under the variational techniques and the reparameterization tricks  → using backpropagation with variational techniques and reparameterization tricks
There have been several efforts developing efficient training methods → There have been several efforts toward developing efficient training methods
However, training SFNN is still significantly slower than doing DNN → However, training a SFNN is still significantly slower than training a DNN
e.g., most prior works on this line have considered a → consequently most prior works in this area have considered a
Instead of training SFNN directly → Instead of training a SFNN directly
whether pre-trained parameters of DNN → whether pre-trained parameters from a DNN
with further fine-tuning of light cost → with further low-cost fine-tuning
recent advances in DNN on its design and training → recent advances in DNN design and training
it is rather believed that transferring parameters →  it is believed that transferring parameters
but the opposite direction is unlikely possible → but the opposite is unlikely
To address the issues, we propose → To address these issues, we propose
which intermediates between SFNN and DNN, → which is intermediate between SFNN and DNN,
in forward pass and computing gradients in backward pass → in the forward pass and computing gradients in the backward pass
in order to handle the issue in forward pass →  in order to handle the issue in the forward pass
Neal (1990) proposed a Gibbs sampling → Neal (1990) proposed Gibbs sampling
for making DNN and SFNN are equivalent → for making the DNN and SFNN equivalent
in the case when DNN uses the unbounded ReLU → in the case when the DNN uses the unbounded ReLU
are of ReLU-DNN type due to the gradient vanishing problem → are of the ReLU-DNN type because they mitigate the gradient vanishing problem
multiple modes in outupt space y → multiple modes in output space y
The only first hidden layer of DNN → Only the first hidden layer of the DNN
is replaced by stochastic one, → is replaced by a stochastic layer,
the former significantly outperforms for the latter for the → the former significantly outperforms the latter for the
simple parameter transformations from DNN to SFNN are not clear to work in general, → simple parameter transformations from DNN to SFNN do not clearly work in general,
is a special form of stochastic neural networks → is a special form of stochastic neural network
As like (3), the first layer is → As in (3), the first layer is
This connection naturally leads an efficient training procedure → This connection naturally leads to an efficient training procedure