Title: MAKING STOCHASTIC NEURAL NETWORKS FROM DETERMINISTIC ONES

Abstract: 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 Simplified-SFNN, 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 N 1 units, i.e., h 1 ∈ {0, 1} N 1 , drawn under the following distribution:

EQUATION

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) = E P (h 1 |x) P y | h 1 = E P (h 1 |x) N y | W 2 h 1 + b 2 , σ 2 y ,

where N (•) denotes the normal distribution with mean W 2 h 1 + b 2 and (fixed) variance σ 2 y . 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 following Monte Carlo approximation for estimating the expectation:

P (y | x) 1 M M m=1 P (y | h (m) ),

where h (m) ∼ P h 1 | 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 h 1 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) = E P (h 1 |x) N y | W 2 h 1 + b 2 , σ 2 y N y | E P (h 1 |x) W 2 h 1 + b 2 , σ 2 y = N y | W 2 σ W 1 x + b 1 + b 2 , σ 2 y .

(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 sigmoid-DNN 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 Under review as a conference paper at ICLR 2017 Table 1 : The performance of simple parameter transformations from DNN to SFNN on the MNIST and synthetic datasets, where each layer of neural networks contains 800 and 50 hidden units for two datasets, respectively. For all experiments, the only first hidden layer of DNN is replaced by stochastic one. We report negative log-likelihood (NLL) and classification error rates.

unbounded. To handle this issue, we redefine the stochastic latent units of SFNN:

EQUATION

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 W 1 i x + b 1 i ≤ 1 and rescale upper parameters W 2 as follows:

α -1 ← max i,x f W 1 i x + b 1 i , W 1 , b 1 ← W 1 , b 1 , W 2 , b 2 ← 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 Simplified-SFNNs, 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 N 1 units, i.e., h 1 ∈ {0, 1} N 1 , drawn under the following distribution:

P h 1 | x = N 1 i=1 P h 1 i | x , where P h 1 i = 1 | x = min α 1 f W 1 i x + 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 N 2 units, i.e., h 2 (x) ∈ R N 2 :

EQUATION

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:

EQUATION

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 , b 1 ← 1 γ 1 , W 1 , b 1 , α 2 , W 2 , b 2 ← γ 2 γ 1 s (0) , 1 γ 2 W 2 , 1 γ 1 γ 2 b 2 , (8)

|D| 1 N x i h i (x) -h i (x) is decreasing.

where

γ 1 = max i,x∈D f W 1 i x + b 1 i

and γ 2 > 0 is any positive constant. Then, it follows that

h 2 j (x) -h 2 j (x) ≤ γ 1 i W 2 ij + b 2 j γ -1 1 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→∞ h 2 j (x) -h 2 j (x) = 0, ∀j, x ∈ D.

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 Simplified-SFNN is that the randomness of the stochastic layer propagates only to its upper layer in the latter, i.e., the randomness of h 1 is averaged out at its upper units h 2 and does not propagate to h 3 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 layers 1 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 Simplified-SFNN 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:

E P (h |x) s W +1 j h s E P (h |x) W +1 j h = s i W +1 ij 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 

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:

E P (h 1 |x) s W 2 j h 1 + b 2 j 1 M M m=1 s W 2 j h (m) + b 2 j , h (m) ∼ P h 1 | 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 h 1 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) :

∂ ∂W 2 j E P (h 1 |x) s W 2 j h 1 + b 2 j 1 M m ∂ ∂W 2 j s W 2 j h (m) + b 2 j , ∂ ∂W 1 i E P (h 1 |x) s W 2 j h 1 + b 2 j W 2 ij M m s W 2 j h (m) + b 2 j ∂ ∂W 1 i P h 1 i = 1 | x ,

where h (m) ∼ P h 1 | 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 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 i h -1 (x) + b i and γ +1 is any positive constant. Then, it follows that lim γ +1 →∞ ∀ stochastic hidden layer h L j (x) -h L j (x) = 0, ∀j, x ∈ D.

The above theorem again implies that it is possible to transfer knowledge from DNN to Simplified-SFNN 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 W 1 i x + 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 E P (h |x) s W +1 j h + b +1 j -s (0) - s (0) 2 i W +1 ij : ∀j ,

where h 0 (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 i h -1 (x) + b i

, and γ +1 is any positive constant. Then, it follows that

lim γ +1 →∞ ∀ stochastic hidden layer h L j (x) -h L j (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.

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 Simplified-SFNNs 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., NIN and WRN, and 

1 , W 1 , b 1 ← 1 γ1 , W 1 , b 1

, then the marginal distribution of each hidden unit i becomes Next consider the second hidden layer. From Taylor's theorem, there exists a value z between 0 and x such that s

EQUATION

EQUATION

(x) = s(0) + s (0)x + R(x), where R(x) = s (z)x 2 2!

. Since we consider a binary random vector, i.e., h 1 ∈ {0, 1} N 1 , one can write

E P (h 1 |x) s β j h 1 = h 1 s (0) + s (0) β j h 1 + R β j h 1 P h 1 | x = s (0) + s (0) i W 2 ij P (h 1 i = 1 | x) + b 2 j + E P (h 1 |x) R(β j (h 1 )) ,

where β j h 1 := W 2 j h 1 + b 2 j is the incoming signal. From ( 6) and ( 10), for every hidden unit j, it follows that

h 2 j x; W 2 , b 2 = f α 2 s (0) 1 γ 1 i W 2 ij h 1 i (x) + b 2 j + E P (h 1 |x) R β j h 1 .

Since we assume that |f (x)| ≤ 1, the following inequality holds:

h 2 j (x; W 2 , b 2 ) -f α 2 s (0) 1 γ 1 i W 2 ij h 1 i (x) + b 2 j ≤ α 2 E P (h 1 |x) R(β j (h 1 )) ≤ α 2 2 E P (h 1 |x) W 2 j h 1 + b 2 j 2 ,

where we use |s (z)| < 1 for the last inequality. Therefore, it follows that

h 2 j x; W 2 , b 2 -h 2 j x; W 2 , b 2 ≤ γ 1 i W 2 ij + b 2 j γ -1 1 2 2s (0)γ 2 , ∀j, since we set α 2 , W 2 , b 2 ← γ2γ1 s (0) , W 2 γ2 , γ -1 1 γ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 Simplified-SFNN.

Lemma 4 Assume that there exists some positive constant B such that

h -1 i (x) -h -1 i (x) ≤ B, ∀i, x ∈ D,

and the -th hidden layer of NCSFNN is standard deterministic layer as defined in (7). Given parameters { W , b } DNN, choose same ones for NCSFNN. Then, the following inequality holds:

h j (x) -h j (x) ≤ BN -1 W 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 -1 i (x) -h -1 i (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 j h -1 (x) + b j and γ +1 is any positive constant. Then, it follows that Assume that -th layer is first stochastic hidden layer in Simplified-SFNN. Then, from Theorem 1, we have

h +1 k (x) -h +1 k (x) ≤ BN -1 N W max W +1 max + γ N W +1 max + b +1 max γ -1 2 2s (0)γ +1 ,

EQUATION

According to Lemma 4 and 5, the final error generated by the right hand side of ( 11) is bounded by

EQUATION

where τ = L =l+2 N -1 W max . One can note that every error generated by each stochastic layer is bounded by ( 12). Therefore, it follows that h L j (x) -h L j (x) ≤

:stochastic hidden layer

   τ γ N W +1 max + b +1 max γ -1 2 2s (0) γ +1    , ∀j, x ∈ D.

From above inequality, we can conclude that lim γ +1 →∞ ∀ stochastic hidden layer h L j (x) -h L j (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 -1 i (x) = h -1 i (x) + i , ∀i, x.

By definition of standard deterministic layer, it follows that

h j (x) = f i W ij h -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 -1 W max .

This completes the proof of Lemma 4.

D.4 PROOF OF LEMMA 5:

From assumption, there exists some constant -1 i such that -1 i < B and

EQUATION

Let γ = max j,x∈D f W j h -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 j h -1 (x) + b j , 1 = 1 γ f W j h -1 (x) + b j , ∀j, x.

From (13), it follows that

P h j = 1 | x, W , b = 1 γ f W j h -1 (x) + i W ij -1 i + b j , ∀j, x.

Similar to Lemma 4, there exists some constant j such that j < BN -1 W max and

EQUATION

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)x 2 2!

. Since we consider a binary random vector, i.e., h ∈ {0, 1} N , one can write is the incoming signal. From ( 14) and above equation, for every hidden unit k, we have

E P (h |x) [s(β k (h ))] =

h +1 k (x; W +1 , b +1 ) = f   α +1   s (0)   1 γ   j W +1 jk h j (x) + j W +1 jk j   + b +1 k   + E P (h |x) R(β k (h ))     .

Since we assume that |f (x)| < 1, the following inequality holds:

EQUATION

)

where we use |s (z)| < 1 for the last inequality. Therefore, it follows that

h +1 k (x) -h +1 k (x) ≤ BN -1 N W max W +1 max + γ N W +1 max + 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.

:

We do not use the extra SVHN dataset for training.

Figures and Tables:

Figure 1: The generated samples from (a) sigmoid-DNN and (b) SFNN which uses same parameters trained by sigmoid-DNN. One can note that SFNN can model the multiple modes in outupt space y around x = 0.4.

Figure 2: (a) Simplified-SFNN (top) and SFNN (bottom). (b) For first 200 epochs, we train a baseline ReLU-DNN. Then, we train simplified-SFNN initialized by the DNN parameters under transformation (8) with γ 2 = 50. We observe that training ReLU-DNN * directly does not reduce the test error even when network knowledge transferring still holds between the baseline ReLU-DNN and the corresponding ReLU-DNN * . (c) As the value of γ 2 increases, knowledge transferring loss measured as 1

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.

2(b).

Figure 3: Generated samples for predicting the lower half of the MNIST digit given the upper half.The original digits and the corresponding inputs (first). The generated samples from sigmoid-DNN (second), SFNN under the simple transformation (third), and SFNN fine-tuned by Simplified-SFNN (forth). We observed that SFNN fine-tuned by Simplified-SFNN can generate more various samples from same inputs, e.g., 3 and 8, better than SFNN under the simple transformation.

Figure 4: Test errors of WRN * per each training epoch on CIFAR-100.

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 toZagoruyko & Komodakis (2016).D PROOFS OF THEOREMS D.1 PROOF OF THEOREM 1First consider the first hidden layer, i.e., stochastic layer. Let γ 1 = max of hidden units in DNN. If we initialize the parameters α

Figure 5: The overall structures of (a) Lenet-5, (b) NIN, (c) WRN with 16 layers, and (d) WRN with 28 layers. The red feature maps correspond to the stochastic ones. In case of WRN, we introduce one (v = 3) and two (v = 2) stochastic feature maps.

∀k, x ∈ D, where b max = max j b j and W max = max ij W ij . Proof. See Appendix D.4.

+ s (0)β k (h ) + R β k (h ) P (h | x) = s(0) + s (0) k (h ))P (h | x), where β k (h ) = W +1 k h + b +1 k

Classification test error rates [%] on MNIST, where each layer of neural networks contains 800 hidden units. All Simplified-SFNNs are constructed by replacing the first hidden layer of a baseline DNN with stochastic hidden layer. We also consider training DNN and fine-tuning Simplified-

Table content: <table><tr><td>Inference Model</td><td>Training Model</td><td>Network Structure</td><td>without BN &amp; DO</td><td>with BN</td><td>with DO</td></tr><tr><td>sigmoid-DNN</td><td>sigmoid-DNN</td><td>2 hidden layers</td><td>1.54</td><td>1.57</td><td>1.25</td></tr><tr><td>SFNN</td><td>sigmoid-DNN</td><td>2 hidden layers</td><td>1.56</td><td>2.23</td><td>1.27</td></tr><tr><td colspan="2">Simplified-SFNN fine-tuned by Simplified-SFNN</td><td>2 hidden layers</td><td>1.51</td><td>1.5</td><td>1.11</td></tr><tr><td>sigmoid-DNN  *</td><td>fine-tuned by Simplified-SFNN</td><td>2 hidden layers</td><td>1.48 (0.06)</td><td colspan="2">1.48 (0.09) 1.14 (0.11)</td></tr><tr><td>SFNN</td><td>fine-tuned by Simplified-SFNN</td><td>2 hidden layers</td><td>1.51</td><td>1.57</td><td>1.11</td></tr><tr><td>ReLU-DNN</td><td>ReLU-DNN</td><td>2 hidden layers</td><td>1.49</td><td>1.25</td><td>1.12</td></tr><tr><td>SFNN</td><td>ReLU-DNN</td><td>2 hidden layers</td><td>5.73</td><td>3.47</td><td>1.74</td></tr><tr><td colspan="2">Simplified-SFNN fine-tuned by Simplified-SFNN</td><td>2 hidden layers</td><td>1.41</td><td>1.17</td><td>1.06</td></tr><tr><td>ReLU-DNN  *</td><td>fine-tuned by Simplified-SFNN</td><td>2 hidden layers</td><td>1.32 (0.17)</td><td colspan="2">1.16 (0.09) 1.05 (0.07)</td></tr><tr><td>SFNN</td><td>fine-tuned by Simplified-SFNN</td><td>2 hidden layers</td><td>2.63</td><td>1.34</td><td>1.51</td></tr><tr><td>ReLU-DNN</td><td>ReLU-DNN</td><td>3 hidden layers</td><td>1.43</td><td>1.34</td><td>1.24</td></tr><tr><td>SFNN</td><td>ReLU-DNN</td><td>3 hidden layers</td><td>17.83</td><td>4.15</td><td>1.49</td></tr><tr><td colspan="2">Simplified-SFNN fine-tuned by Simplified-SFNN</td><td>3 hidden layers</td><td>1.28</td><td>1.25</td><td>1.04</td></tr><tr><td>ReLU-DNN  *</td><td>fine-tuned by Simplified-SFNN</td><td>3 hidden layers</td><td>1.27 (0.16)</td><td colspan="2">1.24 (0.1) 1.03 (0.21)</td></tr><tr><td>SFNN</td><td>fine-tuned by Simplified-SFNN</td><td>3 hidden layers</td><td>1.56</td><td>1.82</td><td>1.16</td></tr><tr><td>ReLU-DNN</td><td>ReLU-DNN</td><td>4 hidden layers</td><td>1.49</td><td>1.34</td><td>1.30</td></tr><tr><td>SFNN</td><td>ReLU-DNN</td><td>4 hidden layers</td><td>14.64</td><td>3.85</td><td>2.17</td></tr><tr><td colspan="2">Simplified-SFNN fine-tuned by Simplified-SFNN</td><td>4 hidden layers</td><td>1.32</td><td>1.32</td><td>1.25</td></tr><tr><td>ReLU-DNN  *</td><td>fine-tuned by Simplified-SFNN</td><td>4 hidden layers</td><td>1.29 (0.2)</td><td colspan="2">1.29 (0.05) 1.25 (0.05)</td></tr><tr><td>SFNN</td><td>fine-tuned by Simplified-SFNN</td><td>4 hidden layers</td><td>3.44</td><td>1.89</td><td>1.56</td></tr></table>

Test negative log-likelihood (NLL) on MNIST-half and TFD datasets, where each layer of neural networks contains 200 hidden units. All Simplified-SFNNs are constructed by replacing the first hidden layer of a baseline DNN with stochastic hidden layer.

Table content: <table/>

Test error rates [%] on CIFAR-10, CIFAR-100 and SVHN. The error rates for WRN are from our experiments, where original ones reported in(Zagoruyko & Komodakis, 2016) are in the brackets. Results with † are obtained using the horizontal flipping and random cropping augmentation.

Table content: <table><tr><td>Test Error [%]</td><td/><td/><td/><td/></tr><tr><td>0</td><td>50</td><td>100</td><td>150</td><td>200</td></tr><tr><td/><td/><td>Epoch</td><td/><td/></tr></table>

)

Table content: <table><tr><td>Input</td><td colspan="3">6 feature maps (f. maps)</td><td colspan="3">6 Stochastic (Stoc.) f. maps</td><td>16 f. maps</td><td/><td/><td/><td colspan="2">16 f. maps</td><td>120 units</td><td>84 units</td><td>Output</td></tr><tr><td>A</td><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/></tr><tr><td colspan="3">[Convolution (Conv.)]</td><td colspan="2">[Max pool]</td><td colspan="3">[Stochastic (Stoc.) Conv.]</td><td/><td colspan="2">[Max pool]</td><td/><td/><td>[Fully-connected] [Fully-connected]</td></tr><tr><td/><td/><td/><td/><td/><td/><td/><td>(a)</td><td/><td/><td/><td/><td/></tr><tr><td>Input</td><td>192 f. maps</td><td/><td>160 f. maps</td><td>96 f. maps</td><td>96 f. maps</td><td/><td>192 f. maps</td><td colspan="2">192 f. maps</td><td colspan="2">192 f. maps</td><td>192 f. maps</td><td>192 f. maps</td><td>192 Stoc. f. maps</td><td>10 f. maps</td><td>Output</td></tr><tr><td>A</td><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/><td/></tr><tr><td/><td>[Conv.]</td><td colspan="4">[Conv.] [Conv.] [Max pool]</td><td>[Conv.]</td><td colspan="2">[Conv.]</td><td colspan="2">[Conv.]</td><td colspan="2">[Avg pool]</td><td>[Conv.]</td><td>[Conv.] [Stoc. Conv.] [Avg pool]</td></tr><tr><td/><td/><td/><td/><td/><td/><td/><td>(b)</td><td/><td/><td/><td/><td/></tr><tr><td/><td/><td/><td/><td colspan="2">64  *  2 𝑢𝑢-1 , f. maps</td><td/><td/><td/><td/><td/><td/><td/></tr><tr><td/><td/><td/><td>[Conv.]</td><td/><td/><td/><td/><td/><td/><td/><td/><td/></tr><tr><td>Input</td><td>16 f. maps</td><td/><td/><td/><td colspan="2">64  *  2 𝑢𝑢-1 f. maps</td><td/><td/><td colspan="5">64  *  2 𝑢𝑢-1 [Stoc. Conv.] 64  *  2 𝑢𝑢-1 f. maps</td><td>256 f. maps</td><td>Output</td></tr><tr><td>A</td><td>[Conv.]</td><td/><td>[Conv.]</td><td/><td/><td/><td>[Conv.]</td><td/><td colspan="3">Stoc. f. maps</td><td/></tr></table>

Peer review (iclr2017):
This paper builds connections between DNN, simplified stochastic neural network (SFNN) and SFNN and proposes to use DNN as the initialization model for simplified SFNN. The authors evaluated their model on several small tasks with positive results. The connection between different models is interesting. I think the connection between sigmoid DNN and Simplified SFNN is the same as mean-field approximation that has been known for decades. However, the connection between ReLU DNN and simplified SFNN is novel. My main concern is whether the proposed approach is useful when attacking real tasks with large training set. For tasks with small training set I can see that stochastic units would help generalize well.