titu1994 / tf_SIREN

Tensorflow 2.0 implementation of Sinusodial Representation networks (SIREN)
MIT License
149 stars 26 forks source link

Would it be possible to use SIREN on 2D CNN? #4

Closed Lynne-Zheng-Linfang closed 4 years ago

Lynne-Zheng-Linfang commented 4 years ago

Hi, I like SIREN and implemented it on my network. However, the number of network parameters would be huge if use original image without sampling (I flattened the image directly, then use dense layers to construct the network). I am wondering if it is possible to use SIREN on 2D CNN? Thanks a lot.

titu1994 commented 4 years ago

SIREN is a representation network, so it's supposed to learn features, not be dropped into a CNN. However, frameworks do support broadcast so technically, you don't need to flatten your image - you can pass a Dense layer that works on just the RGB per pixel instead of working on all the pixels jointly. The parameter count would not explode in the flattening case but still be larger than CNNs since there is no parameter sharing like in conv kernels.

You need to be careful about about loss though. I would suggest using sum over pixels, and mean over channels, but that will still not be same capacity as a flattened out image. You can try it out quite easily though

Lynne-Zheng-Linfang commented 4 years ago

SIREN is a representation network, so it's supposed to learn features, not be dropped into a CNN. However, frameworks do support broadcast so technically, you don't need to flatten your image - you can pass a Dense layer that works on just the RGB per pixel instead of working on all the pixels jointly. The parameter count would not explode in the flattening case but still be larger than CNNs since there is no parameter sharing like in conv kernels.

You need to be careful about about loss though. I would suggest using sum over pixels, and mean over channels, but that will still not be same capacity as a flattened out image. You can try it out quite easily though

Thanks