Building the RBM network for collaborative filtering

The following function, _network, creates the desired RBM structure for collaborative filtering. First, we define the weights, the biases, and the placeholders for the inputs. The sample_hidden and sample_visible functions are then defined to sample the hidden and the visible activations respectively, based on the probabilities. The hidden units are sampled from Bernoulli distributions with the probabilities provided by the sigmoid function, whereas the visible units pertaining to each movie are sampled from multinomial distribution based on the probabilities provided by the softmax function. The softmax probabilities need not be created since the tf.multinomial function can directly sample ...

Get Intelligent Projects Using Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.