gather
R2026bSyntax
Description
Examples
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
Wavelet time scattering network, specified as a waveletScattering object.
Extended Capabilities
The gather
function fully supports thread-based environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
The
gather function fully supports GPU arrays.
To run the function on a GPU, specify the input data as a gpuArray (Parallel Computing Toolbox). For more
information, see Run MATLAB Functions on a GPU (Parallel Computing Toolbox).
Version History
Introduced in R2023aYou can use gather in thread-based
environments. For more information, see Run MATLAB Functions in Thread-Based Environment.
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Seleccione un país/idioma
Seleccione un país/idioma para obtener contenido traducido, si está disponible, y ver eventos y ofertas de productos y servicios locales. Según su ubicación geográfica, recomendamos que seleccione: .
También puede seleccionar uno de estos países/idiomas:
Cómo obtener el mejor rendimiento
Seleccione China (en idioma chino o inglés) para obtener el mejor rendimiento. Los sitios web de otros países no están optimizados para ser accedidos desde su ubicación geográfica.
América
- América Latina (Español)
- Canada (English)
- United States (English)
Europa
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)