An apparatus to derive a neural network from a deep latent variable model, the apparatus comprising: detection/ observation logic to detect a deep latent variable model, LVM, said deep LVM regarded as a generative probabilistic model, generative model logic to generate a recursive generative model by identifying autonomous sub-structures in the deep LVM by grouping nodes having lowest topological order into a descendant sub-structure, temporarily removing the descendent sub-structure, learning a generative model structure for each of the descendant sub-structures and its ancestor sub-structures, adding a latent layer, and merging into a single structure, wherein learning a generative model structure for each descendent sub-structure comprises performing the steps of generating a recursive generative model based on at least the respective descendant sub-structure and the corresponding exogeneous descendant sub-structures, and wherein learning a generate model structure for each ancestor sub-structure comprises performing the steps of generating a recursive generative model based on at least the respective ancestor sub-structure and the corresponding exogeneous ancestor sub-structures, wherein the learning a generative model structure for each of the descendant sub-structures and its ancestor sub-structures is performed in parallel; and discriminative model logic to convert the generative model into a discriminative model by constructing an inverse graphical model (903, 905, 911) from the generative model, converting the discriminative model into a deep neural network, DNN; training the DNN using labeled data; and applying the DNN to classify data; wherein the discriminative model logic is further to inverse the generative model into multiple inverse models (903, 905), wherein a bidirectional connection is added to connect latent variables having a common parent in each of the multiple inverse models (903, 905) to consolidate the multiple inverse models (903, 905) into a single inverse model, wherein the discriminative model logic is further to convert the single inverse model into the discriminative model by adding a class node serving as a child node to latent leaves, and removing the bidirectional connection. detection/ observation logic to detect a deep latent variable model, LVM, said deep LVM regarded as a generative probabilistic model, generative model logic to generate a recursive generative model by identifying autonomous sub-structures in the deep LVM by grouping nodes having lowest topological order into a descendant sub-structure, temporarily removing the descendent sub-structure, learning a generative model structure for each of the descendant sub-structures and its ancestor sub-structures, adding a latent layer, and merging into a single structure, wherein learning a generative model structure for each descendent sub-structure comprises performing the steps of generating a recursive generative model based on at least the respective descendant sub-structure and the corresponding exogeneous descendant sub-structures, and wherein learning a generate model structure for each ancestor sub-structure comprises performing the steps of generating a recursive generative model based on at least the respective ancestor sub-structure and the corresponding exogeneous ancestor sub-structures, wherein the learning a generative model structure for each of the descendant sub-structures and its ancestor sub-structures is performed in parallel; and discriminative model logic to convert the generative model into a discriminative model by constructing an inverse graphical model (903, 905, 911) from the generative model, converting the discriminative model into a deep neural network, DNN; training the DNN using labeled data; and applying the DNN to classify data; wherein the discriminative model logic is further to inverse the generative model into multiple inverse models (903, 905), wherein a bidirectional connection is added to connect latent variables having a common parent in each of the multiple inverse models (903, 905) to consolidate the multiple inverse models (903, 905) into a single inverse model, wherein the discriminative model logic is further to convert the single inverse model into the discriminative model by adding a class node serving as a child node to latent leaves, and removing the bidirectional connection.