You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I worked on the hos branch, but there are still some problems to fix and code to optimize.
Module pycs.astro.wl.mass_mapping
Remove for loops wherever possible
Vectorize mass mapping methods: operate on stacks of images rather than single images.
Class massmap2d: it would be better to create a separate class for each mass mapping method, inheriting from a base class implementing a forward or predict method. This way, it would be easier to write code which is shared among all mass mapping methods. E.g., BaseMassmap2d, ProxWiener, ProxMSE, SparseWiener.
Improve intermediate methods such as massmap2d._prepare_data, massmap2d._get_Wfc and massmap2d._noise_realizations: instead of returning many variables, register them as instance attributes or properties for the classes massmap2d or shear_data?
Class and variable names: should respect the Python standards.
Classes shear_data, massmap2d and starlet2d: put attribute declaration within the __init__ methods. Moreover, merge init_massmap and init_starlet into the respective __init__ methods.
Are the attributes nx and ny really necessary for massmap2d? What about starlet2d?
Remove argument ind from _prepare_data (remove np.where wherever possible; useless most of the time)
Improve mask = (Ncv < 1e2).astype(int) (could be placed before)
Bug correction in gamma_to_cf_kappa (raise NotImplementedError, to be done later if necessary)
Optimize kappa_to_gamma, gamma_to_cf_kappa, gamma_to_kappa, H_operator_eb2g and H_adjoint_g2eb: work on complex arrays
Remove redundancy with the above methods
Module pycs.sparsity.sparse2d.starlet
Class MRStarlet: modify methods transform and recons in order them to operate on stacks of images (n-D tensors). Modify the C implementation, or implement them in PyTorch to take advantage of GPU acceleration. As a workaround, I used np.vectorize to achieve the same results, but computational efficiency could be widely improved.
Package pycs
Work with dtype = np.float32 and np.complex64, or dtype = np.float64 and np.complex128? Harmonize code.
Remove np.copy() wherever possible (useless memory usage)
I worked on the
hosbranch, but there are still some problems to fix and code to optimize.Module
pycs.astro.wl.mass_mappingforloops wherever possiblemassmap2d: it would be better to create a separate class for each mass mapping method, inheriting from a base class implementing aforwardorpredictmethod. This way, it would be easier to write code which is shared among all mass mapping methods. E.g.,BaseMassmap2d,ProxWiener,ProxMSE,SparseWiener.massmap2d._prepare_data,massmap2d._get_Wfcandmassmap2d._noise_realizations: instead of returning many variables, register them as instance attributes or properties for the classesmassmap2dorshear_data?shear_data,massmap2dandstarlet2d: put attribute declaration within the__init__methods. Moreover, mergeinit_massmapandinit_starletinto the respective__init__methods.nxandnyreally necessary formassmap2d? What aboutstarlet2d?indfrom_prepare_data(removenp.wherewherever possible; useless most of the time)mask = (Ncv < 1e2).astype(int)(could be placed before)gamma_to_cf_kappa(raiseNotImplementedError, to be done later if necessary)kappa_to_gamma,gamma_to_cf_kappa,gamma_to_kappa,H_operator_eb2gandH_adjoint_g2eb: work on complex arraysModule
pycs.sparsity.sparse2d.starletMRStarlet: modify methodstransformandreconsin order them to operate on stacks of images (n-D tensors). Modify the C implementation, or implement them in PyTorch to take advantage of GPU acceleration. As a workaround, I usednp.vectorizeto achieve the same results, but computational efficiency could be widely improved.Package
pycsdtype = np.float32andnp.complex64, ordtype = np.float64andnp.complex128? Harmonize code.np.copy()wherever possible (useless memory usage)