weight_decay = tf.multiply(tf.nn.l2_loss(W), wd, name="weight_loss")
tf.add_to_collection(LOSSES_COLLECTION, weight_decay)
result = tf.nn.bias_add(
tf.nn.conv2d(input_x, W, [1, stride, stride, 1], padding), b)
// apply nonlinearity
out = activation(result)
// log convolution result pre-activation function
// on a single image, the first of the batch
conv_results = tf.split(
value=result[0], num_or_size_splits=shape[3], axis=2)
grid_side = math.floor(math.sqrt(shape[3]))
After Change
result = tf.nn.conv2d(input_x, W, [1, stride, stride, 1], padding)
if bias_term:
b = bias("b", [shape[3]])
result = tf.nn.bias_add(result, b)
// apply nonlinearity
out = activation(result)
// log convolution result pre-activation function
// on a single image, the first of the batch
conv_results = tf.split(
value=result[0], num_or_size_splits=shape[3], axis=2)
grid_side = math.floor(math.sqrt(shape[3]))