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 the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.