Hi guys,
I’ve been digging through docs and this forum but I can’t quite figure this seemingly basic thing out–if I want to reparameterize a filter as an indexed function of another filter (let’s just say in the most basic case that I want to make a sparse 5x5 filter out of a 3x3 filter), how do I go about doing that so that this properly ends up in the graph?
In Theano, I would just use set_subtensor, but I’m not entirely clear on how things get put into the graph with e.g. index_fill_ or index_copy_. The end goal is to end up parameterizing filters like this (MDC Blocks),  8. I’m also struggling to figure out exactly how to replicate standard numpy advanced indexing/slicing. Ideally I would just go:
W_base = Parameter(torch.randn(num_out,num_in,3,3))
W_effective = Variable(torch.zeros(num_out,num_in,5,5))
W_effective[:,:,::2,::2] = W_base
And have a 5x5 filter which is effectively a dilated 3x3 filter, and where only the elements that I indexed in that call are parameters that can be updated. Note that I’m not just trying to dilate a filter (the convNd modules already look to have that on lock) but ideally I’d like to be able to arbitrarily parameterize a tensor by indexing.
Any help is appreciated!
Best,
Andy