- Create an input placeholder variable:
x = tf$placeholder(tf$float32, shape=shape(NULL, img_size_flat), name='x')
The NULL value in the placeholder allows us to pass non-deterministic arrays size.
- Reshape the input placeholder x into a four-dimensional tensor:
x_image = tf$reshape(x, shape(-1L, img_size, img_size, num_channels))
- Create an output placeholder variable:
y_true = tf$placeholder(tf$float32, shape=shape(NULL, num_classes), name='y_true')
- Get the (true) classes of the output using argmax:
y_true_cls = tf$argmax(y_true, dimension=1L)