Utilities

ContinuousWavelets.getMeanFreqFunction
getMeanFreq(sc::stFlux{1}, δt=1000)

Get a list of the mean frequencies for the filter bank in each layer. The averaging filter is last, and gives the mean frequency of the positive frequency only. Note that δt gives the sampling rate for the input only, and that it decreases at each subsequent layer at the rate implied by the subsampling in sc.

julia> using ScatteringTransform

julia> St = scatteringTransform((1024,1,1),2)
stFlux{2, Nd=1, filters=[15], σ = abs, batchSize = 1, normalize = true}

julia> f1, f2, f3 = getMeanFreq(St);

julia> f1'
1×16 adjoint(::Vector{Float64}) with eltype Float64:
 7.70368  54.4302  78.7967  …  315.712  338.416  18.6697
julia> f2'
1×15 adjoint(::Vector{Float64}) with eltype Float64:
 10.8253  64.1205  89.7788  …  296.729  317.265  22.1889
source
ScatteringTransform.getWaveletsFunction
getWavelets(sc::stFlux; spaceDomain=false) -> wave1, wave2, wave3, ...

Get the wavelets used in each layer. If spaceDomain is true, then it will also convert the filters from the stored positive Fourier representation to a space version.

source
Base.ndimsFunction
ndims(s::scatteringTransform{D})

given a scattering transform s, return the number of layers Depth.

source
ndims(sct::Scattered)

return the input dimension size (also given by sct.k)

source
ndims(r::MaxPool{N,M})
ndims(r::MeanPool{N,M})

return the dimension N of the input signal

source

Internal Utilities

ScatteringTransform.batchOffFunction
batchOff(stack, x, batchSize)

transform x using stack, but where x and stack may have different batch sizes (the final dimension).

source
ScatteringTransform.normalizeFunction
normalize(x, Nd) -> normedX

normalize x over the dimensions Nd through ndims(x)-1. For example, if Nd=2, and x is 4D, then norm(normedX[:,:,:,j], 2) ≈ size(normedX,3).

source
ScatteringTransform.processArgsFunction
processArgs(m, varargs) -> listVargs

Go from arguments given to the scattering transform constructor to those for the wavelet or frame transform. listVargs is a list of length m of one argument from each of vargs, with insufficiently long entries filled in by repeating the last value. For a list of these arguments, see the documentation for stFlux.

Examples

julia> using ContinuousWavelets, ScatteringTransform

julia> varargs = ( :boundary      => PerBoundary(), :frameBound    => [1, 1], :normalization => (Inf, Inf))
(:boundary => PerBoundary(), :frameBound => [1, 1], :normalization => (Inf, Inf))

julia> varargs
(:boundary => PerBoundary(), :frameBound => [1, 1], :normalization => (Inf, Inf))

julia> listVargs = ScatteringTransform.processArgs(3,varargs)
(Base.Pairs{Int64, Pair{Symbol}, Base.OneTo{Int64}, Tuple{Pair{Symbol, ContinuousWavelets.PerBoundary}, Pair{Symbol, Vector{Int64}}, Pair{Symbol, Tuple{Float64, Float64}}}}(1 => (:boundary => PerBoundary()), 2 => (:frameBound => [1, 1]), 3 => (:normalization => (Inf, Inf))), Base.Pairs{Int64, Pair{Symbol}, Base.OneTo{Int64}, Tuple{Pair{Symbol, ContinuousWavelets.PerBoundary}, Pair{Symbol, Vector{Int64}}, Pair{Symbol, Tuple{Float64, Float64}}}}(1 => (:boundary => PerBoundary()), 2 => (:frameBound => [1, 1]), 3 => (:normalization => (Inf, Inf))), Base.Pairs{Int64, Pair{Symbol}, Base.OneTo{Int64}, Tuple{Pair{Symbol, ContinuousWavelets.PerBoundary}, Pair{Symbol, Vector{Int64}}, Pair{Symbol, Tuple{Float64, Float64}}}}(1 => (:boundary => PerBoundary()), 2 => (:frameBound => [1, 1]), 3 => (:normalization => (Inf, Inf))))

julia> listVargs[1]
pairs(::Tuple{Pair{Symbol, ContinuousWavelets.PerBoundary}, Pair{Symbol, Vector{Int64}}, Pair{Symbol, Tuple{Float64, Float64}}}) with 3 entries:
  1 => :boundary=>PerBoundary()
  2 => :frameBound=>[1, 1]
  3 => :normalization=>(Inf, Inf)

julia> listVargs[2]
pairs(::Tuple{Pair{Symbol, ContinuousWavelets.PerBoundary}, Pair{Symbol, Vector{Int64}}, Pair{Symbol, Tuple{Float64, Float64}}}) with 3 entries:
  1 => :boundary=>PerBoundary()
  2 => :frameBound=>[1, 1]
  3 => :normalization=>(Inf, Inf)

julia> listVargs[3]
pairs(::Tuple{Pair{Symbol, ContinuousWavelets.PerBoundary}, Pair{Symbol, Vector{Int64}}, Pair{Symbol, Tuple{Float64, Float64}}}) with 3 entries:
  1 => :boundary=>PerBoundary()
  2 => :frameBound=>[1, 1]
  3 => :normalization=>(Inf, Inf)
source
ScatteringTransform.getParametersFunction
getParameters(st, s)

given a scatteringTransform object and a symbol s representing a possible keyword, e.g. :Q, or , return the value for this transform. It may be in st.settings, or, if it is a default value, it is looked up.

source
ScatteringTransform.extractAddPaddingFunction
extractAddPadding(x, adr, chunkSize, N)

From x, extract the examples adr in the last dimension, and make sure that it has a size of chunkSize, padding if there are too few examples (this is to make sure the batch size matches).

source