How to do it...

This recipe covers the steps for setting up Deep belief network (DBM):

  1. Define the number of nodes in each hidden layer as a vector:
RBM_hidden_sizes = c(900, 500 , 300 )
  1. Generate an RBM function leveraging the codes illustrated in the Setting up a Restricted Boltzmann Machine for Bernoulli distribution input recipe with the following input and output parameters mentioned:

Here is the function for setting up up the RBM:

RBM <- function(input_data, num_input, num_output, epochs = 5, alpha = 0.1, batchsize=100){# Placeholder variablesvb <- tf$placeholder(tf$float32, shape = shape(num_input))hb <- tf$placeholder(tf$float32, ...

Get R Deep Learning Cookbook 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.