Main Content

gather

Collect scattering network properties into local workspace

Since R2023a

    Description

    sn = gather(sf) collects all the wavelet time scattering network, sf, properties from the GPU device and returns the gathered waveletScattering object sn. All properties of the gathered object are stored in the local workspace.

    example

    Examples

    collapse all

    Refer to GPU Computing Requirements (Parallel Computing Toolbox) to see what GPUs are supported.

    Load the noisy Doppler signal. Create a wavelet scattering network gsf that you can apply to the data.

    load noisdopp
    gsf = waveletScattering;

    Copy the signal to the GPU.

    gnoisdopp = gpuArray(noisdopp);

    Obtain the scattering feature matrix for the scattering network gsf and the data that is on the GPU. Specify the log transformation. Confirm the feature matrix is on the GPU.

    gsmat = featureMatrix(gsf,gnoisdopp);
    isgpuarray(gsmat)
    ans = logical
       1
    
    

    Obtain the scaling and wavelet filters used in the scattering network.

    gfil = filterbank(gsf)
    gfil=3×1 cell array
        {1×1 struct}
        {1×1 struct}
        {1×1 struct}
    
    

    The first element of gfil contains the scaling filter used in the computation of the zeroth order scattering coefficients. Subsequent elements of gfil contain the wavelet filters and scaling filter for the corresponding filter banks of the scattering decomposition. Confirm all the scaling and wavelet filters are on the GPU.

    [isgpuarray(gfil{1}.phift)
    isgpuarray(gfil{2}.phift)
    isgpuarray(gfil{2}.psift)
    isgpuarray(gfil{3}.phift)
    isgpuarray(gfil{3}.psift)]
    ans = 5×1 logical array
    
       1
       1
       1
       1
       1
    
    

    Gather the scattering network. Confirm all the filters in the gathered network sf are in the workspace.

    sf = gather(gsf);
    fil = filterbank(sf);
    [isgpuarray(fil{1}.phift)
    isgpuarray(fil{2}.phift)
    isgpuarray(fil{2}.psift)
    isgpuarray(fil{3}.phift)
    isgpuarray(fil{3}.psift)]
    ans = 5×1 logical array
    
       0
       0
       0
       0
       0
    
    

    Obtain the scattering feature matrix for the scattering network sf and the original signal. Specify the log transformation. Confirm the feature matrix is not on the GPU. Confirm the feature matrix is equal to the matrix obtained using the network gsf.

    smat = featureMatrix(sf,noisdopp);
    isgpuarray(smat)
    ans = logical
       0
    
    
    xgsmat = gather(gsmat);
    max(abs(smat(:)-xgsmat(:)))
    ans = 8.8818e-16
    

    Input Arguments

    collapse all

    Wavelet time scattering network, specified as a waveletScattering object.

    Extended Capabilities

    Version History

    Introduced in R2023a