Research Mistakes Log 2After the project grew larger, adding new features directly to the original code really does introduce more and more bugs. I found two similar bugs in just one day today, which is really frustrating!kernel_size and stride don't correspond one-to-oneIn the previously defined model code, kernelsize and stride of nn.Conv2d corresponded one-to-one. However, in the expanded model, one layer didn't follow the previously written correspondence rules, causing the code that assigns stride based on kernelsize to have issues directly.If I hadn't suddenly written an assert to check the shape today, I probably would never have discovered this in my lifetime.PYTHONif kernel_size == 3: padding = 1 stride = 1 elif kernel_size == 5: padding = 2 stride = 2 else: raise ValueError() Not all convolutions are followed by ReLUIn the previous model, every convolution layer was followed by an nn.ReLU. But to adapt to new resolution requirements, I designed a transfer layer that doesn't have nn.ReLU after it, and its naming convention is the same as previous convolutions. At the same time, during simulation calculations, the previously written judgment rules directly errored out. o( ̄┰ ̄*)ゞDIFF-if quant.startswith('classifier_conv'): +if quant.startswith('classifier_conv') and quant != 'classifier_conv_transfer': x[x < 0] = 0 In summary, both bugs I found today were from migrating original code and adding some things, resulting in incorrect judgment conditions. These problems seem unavoidable unless you design a well-extensible architecture from the start, but how can you anticipate potential problems at the beginning? Research isn't like product development - new ideas come up after a while, so it feels even more impossible to consider everything.
Research Mistakes Log 2
Research Mistakes Log 2
After the project grew larger, adding new features directly to the original code really does introduce more and more bugs. I found two similar bugs in just one day today, which is really frustrating!
kernel_size and stride don't correspond one-to-one
In the previously defined model code, kernelsize and stride of
nn.Conv2dcorresponded one-to-one. However, in the expanded model, one layer didn't follow the previously written correspondence rules, causing the code that assigns stride based on kernelsize to have issues directly.If I hadn't suddenly written an
assertto check the shape today, I probably would never have discovered this in my lifetime.Not all convolutions are followed by ReLU
In the previous model, every convolution layer was followed by an
nn.ReLU. But to adapt to new resolution requirements, I designed a transfer layer that doesn't havenn.ReLUafter it, and its naming convention is the same as previous convolutions. At the same time, during simulation calculations, the previously written judgment rules directly errored out. o( ̄┰ ̄*)ゞIn summary, both bugs I found today were from migrating original code and adding some things, resulting in incorrect judgment conditions. These problems seem unavoidable unless you design a well-extensible architecture from the start, but how can you anticipate potential problems at the beginning? Research isn't like product development - new ideas come up after a while, so it feels even more impossible to consider everything.