bwohlberg / sporco

Sparse Optimisation Research Code
http://brendt.wohlberg.net/software/SPORCO/
BSD 3-Clause "New" or "Revised" License
261 stars 37 forks source link

How to initiate a Dictionary? #12

Closed hminle closed 4 years ago

hminle commented 4 years ago

Hi there,

https://sporco.readthedocs.io/en/latest/examples/cdl/cbpdndl_fista_clr.html In this example, I still cannot understand how we can specify dim of D = (16, 16, 3, 96) How you come up with those numbers?

What if I would like to change it to (32, 32, 3, 128). What should I do?

Thanks

bwohlberg commented 4 years ago

The first two axes of D are the filter dimensions, the third is the number of channels, and the fourth is the number of filters, so D = (16, 16, 3, 96) means that we have 96 filters, with 3 channels each, of size 16 x 16. To change the dictionary size to (32, 32, 3, 128), in the example script you refer to, just change the line

D0 = np.random.randn(16, 16, 3, 96)

to

D0 = np.random.randn(32, 32, 3, 128)

Does that answer your question?

hminle commented 4 years ago

Thank @bwohlberg