Python Module Documentation
- class funct
Description of the class.
- __init__(NORIENT=4,
- KERNELSZ=3,
- all_type='float64',
- gpupos=0,
- TEMPLATE_PATH='data',
- BACKEND='tensorflow',
- JmaxDelta=0,
- isMPI=False,
- mpi_size=1,
- mpi_rank=0):
Parameters
NORIENT=4Number of Wavelet orientation.KERNELSZ=3Size of the kernel used to define the waveletall_type='float64'Internal data format. Selectfloat32to earn memory and speed.gpupos=0Select the default GPU id if several are availble. Note thatfoscatalways use all GPU if several losses are defined while compute synthesis.TEMPLATE_PATH='data'Directory where default foscat information are stored.BACKEND='tensorflow'Select the backend.numpyandpytorchare beta testedonly.JmaxDelta=0Define the delta of the last scale computed compare to the max possible scale considering the nside. For instance, the maximum number of scale usable forscat_covof a nside=16 image is 4.JmaxDelta=2computes only the 2 first scales.isMPI=FalseSet toTrueto use the insideMPIjob.``mpi_size`` andmpi_rankshould be set.mpi_size=1Set thesizeof theMPIrun.mpi_rank=0Set therankof theMPIrun.
- ud_grade(image, jscale)
return an image with a corresponding nside divided by a factor
2^jscalecompare to the inputimage
- up_grade(image, out_nside)
return an image with a corresponding nside =
out_nsideusing bilinear interpolation onimagedata.
- convol(image, axis=0)
convol the
imageby default wavelet defined in__init__. Input dimension is [..,Npix,..], output dimension is [..,Npix,Norient,..]. Npix is the number of pixels of theimage.
- smooth(image, axis=0)
smooth the
imageby default symetric wavelet defined in__init__. Input dimension is [..,Npix,..], output dimension is [..,Mpix,..]. Npix is the number of pixels of theimage.
- fill(im, nullval)
Fill the
imsamples equal tonullvalin such way that thescat_covcomputation as less affected by unknown data. Be aware that a mask should used to get the proper statistic while doing
- moments(list_scat)
Calculate the mean and the standard deviation for a list of
scat_covobjects provided bylist_scat. The return value isscat_mean, scat_std, which are twoscat_covobjects representing the mean and the standard deviation values, respectively.
- eval(image1, image2, mask, norm, Auto, calc_var)
Calculates the scattering correlations for a batch of images. Mean are done over pixels. mean of modulus:
S1 = <|I * Psi_j3|> Normalization : take the log
- power spectrum:
P00 = <|I * Psi_j3|^2> Normalization : take the log
- orig. x modulus:
C01 = < (I * Psi)_j3 x (|I * Psi_j2| * Psi_j3)^* >
Normalization : divide by (P00_j2 * P00_j3)^0.5 modulus x modulus:
C11 = <(|I * psi1| * psi3)(|I * psi2| * psi3)^*>
Normalization : divide by (P00_j1 * P00_j2)^0.5
Parameters
image1: tensor Image on which we compute the scattering coefficients [Nbatch, Npix, 1, 1]
image2: tensor Second image. If not None, we compute cross-scattering covariance coefficients.
mask:
norm: None or str If None no normalization is applied, if ‘auto’ normalize by the reference P00, if ‘self’ normalize by the current P00.
all_cross: False or True
If False compute all the coefficient even the Imaginary part, If True return only the terms computable in the auto case.
Returns
S1, P00, C01, C11 normalized
- clean_norm(self)
Internal method not to be used.
- _compute_C01(j2, conv, vmask, M_dic, MconvPsi_dic, calc_var, return_data)
Internal method not to be used.
- _compute_C11(j1, j2, vmask, M1convPsi_dic, M2convPsi_dic, calc_var, return_data)
Internal method not to be used.
- square(x)
Compute all coefficients (S1, P00, C01, C11, …) attached to the
scat_covx with the square of their values.
- sqrt(x)
Compute all coefficients (S1, P00, C01, C11, …) attached to the
scat_covx with the square root of their values.
- reduce_mean(x)
Compute the mean values of all the coefficients.
- reduce_sum(x)
Compute the sum values of all the coefficients.
- ldiff(sig, x)
Description of the method.
- log(x)
Compute all coefficients (S1, P00, C01, C11, …) attached to the
scat_covx with the logarithm of their values.
- std(list_of_sc)
Do the standard deviation of all the coefficients
- eval_comp_fast(image1, image2, mask, norm, Auto)
Internal method not to be used .
- eval_fast(image1, image2, mask, norm, Auto)
Same method than
evalbut run in Graph Execution mode fastest while doing lot of eval_fast. The first execution could be long.
- backend.bk_real(x)
return the real part of the
xdata.
- backend.bk_imag(x)
return the imaginary part of the
xdata.
- backend.bk_conjugate(x)
return the conjugate value of the
xdata.
- backend.bk_norm(x)
return the complex norm value of the
xdata.
- class scat_cov
Description of the class.
- __init__(s0, p00, c01, c11, s1, c10, backend)
Description of the method.
- numpy(self)
Description of the method.
- constant(self)
Description of the method.
- flatten(self)
Description of the method.
- flattenMask(self)
Description of the method.
- get_S0(self)
Description of the method.
- get_S1(self)
Description of the method.
- get_P00(self)
Description of the method.
- reset_P00(self)
Description of the method.
- get_C01(self)
Description of the method.
- get_C10(self)
Description of the method.
- get_C11(self)
Description of the method.
- get_j_idx(self)
Description of the method.
- get_jc11_idx(self)
Description of the method.
- __add__(other)
Description of the method.
- relu(self)
Description of the method.
- __radd__(other)
Description of the method.
- __truediv__(other)
Description of the method.
- __rtruediv__(other)
Description of the method.
- __rsub__(other)
Description of the method.
- __sub__(other)
Description of the method.
- domult(x, y)
Description of the method.
- dodiv(x, y)
Description of the method.
- domin(x, y)
Description of the method.
- doadd(x, y)
Description of the method.
- __mul__(other)
Description of the method.
- __rmul__(other)
Description of the method.
- interp(nscale, extend, constant)
Description of the method.
- plot(name, hold, color, lw, legend)
Description of the method.
- get_np(x)
Description of the method.
- save(filename)
Description of the method.
- read(filename)
Description of the method.
- std(self)
Description of the method.
- mean(self)
Description of the method.
- initdx(norient)
Description of the method.
- sqrt(self)
Description of the method.
- L1(self)
Description of the method.
- square_comp(self)
Description of the method.
- iso_mean(repeat)
Description of the method.
- fft_ang(nharm)
Description of the method.
- iso_std(repeat)
Description of the method.
- get_nscale(self)
Description of the method.
- get_norient(self)
Description of the method.
- add_data_from_log_slope(y, n, ds)
Description of the method.
- add_data_from_slope(y, n, ds)
Description of the method.
- up_grade(nscale, ds)
Description of the method.