A stochastic Helmholtz machine uses a neural network with bottom-up and top-down connections between layers to convert input vectors into representations in hidden units and then reconstruct approximations of the input from those representations. It contains two connected models that allow information exchange between layers, with all neurons being stochastic binary units that can be in one of two states. The machine is usually trained using an unsupervised learning algorithm like wake-sleep that involves alternating between sleep and wake phases.