walsvid / CoordConv

Pytorch implementation of "An intriguing failing of convolutional neural networks and the CoordConv solution" - https://arxiv.org/abs/1807.03247

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question about generate_data.py

hyunseoki opened this issue · comments

Although it does not affect the final results,
please consider this minor change in your code to reflect the original paper contents

It will be helpful for debugging

paper :

## bias is basically neglected in tensorflow
onehots = np.pad(np.eye(3136).reshape((3136, 56, 56, 1)), ((0,0), (4,4), (4,4), (0,0)), "constant");  
images = tf.nn.conv2d(onehots, np.ones((9, 9, 1, 1)), [1]*4, "SAME")

code as is :

conv_layer = nn.Conv2d(in_channels=1, out_channels=1, kernel_size=(9, 9), padding=4, stride=1)

code to be:

conv_layer = nn.Conv2d(in_channels=1, out_channels=1, kernel_size=(9, 9), padding=4, stride=1, bias=False)

Thanks for your reminder, I will try to update the relevant code.