August 2017
Intermediate to advanced
288 pages
8h 6m
English
# Create a new convolution layercreate_conv_layer <- function(input,num_input_channels,filter_size,num_filters,use_pooling=True){# Shape of the filter-weights for the convolution.shape1 = shape(filter_size, filter_size, num_input_channels, num_filters)# Create new weightsweights = weight_variable(shape=shape1)# Create new biasesbiases = bias_variable(shape=shape(num_filters))# Create the TensorFlow operation for convolution.layer = tf$nn$conv2d(input=input,filter=weights,strides=shape(1L, 1L, 1L ,1L),padding="SAME")# Add the biases to the results of the convolution.layer = layer + biases# Use pooling (binary flag) to reduce the image resolutionif(use_pooling){ ...