## 2 CBN-VAE Model Architecture
### Downsampling-Convolutional RBM  
For the CBN-VAE model, Downsampling-Convolutional RBM (D-CRBM) is an important unit for learning the hidden mathematical features of original sensing data and reducing network parameters. The D-CRBM is Convolutional RBM (CRBM) with downsampling. The structure of CRBM is shown in Figure 1. The basic structure of CRBM is the standard RBM, which is an undirected graph structure consisting of two layers: input layer \(\mathbf{v}\) and hidden layer \(\mathbf{h}\). The difference between CRBM and standard RBM is the method of calculating the neuron states of the input layer and the hidden layer. For standard RBM, the neuron states of the input layer and the hidden layer are obtained by directly multiplying the input and weight matrix. Since the number of weight matrices is 1, the neuron state is unique. In the CRBM, the method of calculating the neuron state of the input layer and the hidden layer is the convolution calculation. The standard RBM uses only one weight matrix to calculate the neuron state, and the CRBM uses multiple convolution kernels to calculate. However, after multiple convolution kernels are calculated, multiple corresponding neuron states are generated, which is contrary to one state result of the standard RBM. Therefore, we need to process the convolution result. We concatenate multiple convolution results into one and use it as the neuron state. This preserves the undirected graph structure of the CRBM while minimizing the loss of convolutional useful information because we retain the results for all convolution kernels. At the same time, the undirected graph feature of CRBM allows the CRBM to perform bidirectional transmission of information, that is, the convolution input can also be calculated from the convolution results, which is not possible with the standard convolutional layer. Compared to the standard convolutional layer from the input and output dimension, for a standard convolution layer with an input size of \(\mathbf{X}_{w}\times\mathbf{X}_{h}\times\mathbf{C}_{i}\) and the convolution kernel size of \(\mathbf{K}_{w}\times\mathbf{K}_{h}\times\mathbf{C}_{i}\times\mathbf{C}_{o}\), the size of the convolution result is \(\mathbf{O}_{w}\times\mathbf{O}_{h}\times\mathbf{C}_{o}\) where \(\mathbf{O}_{w}=\mathbf{X}_{w}-\mathbf{K}_{w}\), \(\mathbf{O}_{h}=\mathbf{X}_{h}-\mathbf{K}_{h}\) and the convolution strides are 1. For the CRBM with the same parameters, the size of the CRBM output is \(\mathbf{O}_{w}^{c}\times\mathbf{O}_{h}\times 1\) where \(\mathbf{O}_{w}^{c}=\mathbf{O}_{w}\times\mathbf{C}_{o}\). The CRBM and the standard convolution have the same output values, but the the output dimensions are different. The downsampling of D-CRBM is implemented by the convolution stride and max-pooling. The structure of D-CRBM is shown in Figure 2. In the D-CRBM, we set the convolution stride to \(\mathbf{K}_{w}\) where \(\mathbf{K}_{w}\) is the width of the convolution kernel. This operation can reduce the redundancy caused by the convolution kernel repeated calculation of the same data. Then we downsample the convolution result by using max-pooling, the pooling size is \(2\times 1\). Take 1-dimensional sensing data (time sequences) as an example. For the D-CRBM with an input size of \(\mathbf{X}_{w}\times 1\times 1\) and the convolution kernel size of \(\mathbf{K}_{w}\times 1\times 1\times\mathbf{C}_{o}\), the size of the convolution result is \(\mathbf{O}_{w}^{d}\times 1\times 1\) where \(\mathbf{O}_{w}^{d}=\mathbf{C}_{o}\times\frac{\mathbf{X}_{w}-\mathbf{K}_{w}}{2 \cdot\mathbf{K}_{w}}\). Compared with the standard convolution which have the same parameters, the D-CRBM gets a reduction in computation of \(2*\mathbf{K}_{w}\) in the layer-wise. After max-pooling, we construct an index matrix to store the position index of the max-pooling results. The index matrix is used to recover network data when reconstructing data. The index matrix is a binarization matrix which consists of 0, 1.