extended Generalized Haar-Walsh Transform

MultiscaleGraphSignalTransforms.GHWT_tf_1d.ghwt_tf_bestbasisMethod

(dvec, BS) = ghwttfbestbasis(dmatrix::Array{Float64,3}, GP::GraphPart; cfspec::Float64 = 1.0, flatten::Any = 1.0)

Implementation of time-frequency adapted GHWT method = eGHWT. Modified from the algorithm in the paper: "A Fast Algorithm for Adapted Time Frequency Tilings" by Christoph M. Thiele and Lars F. Villemoes.

Input Arguments

  • dmatrix::Array{Float64,3}: the matrix of expansion coefficients
  • GP::GraphPart: an input GraphPart object
  • cfspec::Any: the specification of cost functional to be used (default: 1.0, i.e., 1-norm)
  • flatten::Any: the method for flattening vector-valued data to scalar-valued data (default: 1.0, i.e., 1-norm)

Output Arguments

  • dvec::Matrix{Float64}: the vector of expansion coefficients corresponding to the eGHWT best basis
  • BS::BasisSpec: a BasisSpec object which specifies the eGHWT best basis

Copyright 2018 The Regents of the University of California

Implemented by Yiqun Shao (Adviser: Dr. Naoki Saito)

source
MultiscaleGraphSignalTransforms.GHWT_tf_1d.tf_basisrecover_newMethod
tag_tf_b_new = tf_basisrecover_new(tag_tf_b::Array{Dict{Tuple{Int,Int},Bool}},tag_tf_f::Array{Dict{Tuple{Int,Int},Bool}})

One backward iteration of time-frequency adapted GHWT method to recover the best-basis from the `tag_tf`s recorded.

Input Arguments

  • tag_tf_b: The dictionary recording the time-or-frequency information on some iteration 'i' in the main algorithm
  • tag_tf_f: The dictionary recording the time-or-frequency information on some iteration 'i+1' in the main algorithm

Output Arguments

  • tag_tf_b_new: The updated 'tagtfb'. Eventually the 'tag_tf' on iteration 1 will represent the selected best-basis

Copyright 2018 The Regents of the University of California

Implemented by Yiqun Shao (Adviser: Dr. Naoki Saito)

source
MultiscaleGraphSignalTransforms.GHWT_tf_1d.tf_core_newMethod

coeffdictnew,tagtf = tfcorenew(coeffdict::Array{Dict{Tuple{Int,Int},Float64},1})

One forward iteration of time-frequency adapted GHWT method. For each entry in coeffdict_new, we compare two (or one) entries in 'coeffdict' on time-direction and two (or one) entries in 'coeffdict' on frequency-direction. Those two groups reprensent the same subspace. We compare the cost-functional value of them and choose the smaller one as a new entry in 'coeffdict_new'.

Input Arguments

  • coeffdict: The entries of which reprensents the cost functional value of some basis-vectors' coefficients.

Output Arguments

  • coeffdict_new: The entries of which represents the cost functional value of some basis-vectors' coefficients
  • tag_tf: Indicating whether the time-direction (0) or frequency direction (1) was chosen for each entry in coeffdict_new.

Copyright 2018 The Regents of the University of California

Implemented by Yiqun Shao (Adviser: Dr. Naoki Saito)

source
MultiscaleGraphSignalTransforms.GHWT_tf_1d.tf_initMethod

coeffdict = tf_init(dmatrix::Matrix{Float64},GP::GraphPart)

Store the expanding coeffcients from matrix into a list of dictionary (inbuilt hashmap in Julia)

Input Arguments

  • dmatrix: The expanding GHWT coefficients of all levels corresponding to input GP
  • GP::GraphPart: an input GraphPart object

Output Arguments

  • coeffdict: The expanding GHWT coeffcients stored in a list of "dictionary" (inbuilt hashmap in Julia),
  • coeffdict: The entry coeffdict[j][(k,l)] corresponds to the coefficient of basis-vector on level j with region k and tag l.

Copyright 2018 The Regents of the University of California

Implemented by Yiqun Shao (Adviser: Dr. Naoki Saito)

source
MultiscaleGraphSignalTransforms.GHWT_tf_2d.ghwt_tf_bestbasis_2dMethod
Bbasis, infovec = ghwt_tf_bestbasis_2d(dmatrix::Matrix{Float64},GProws::GraphPart,GPcols::GraphPart)

Implementation of 2d time-frequency adapted GHWT method. Modified from the idea in paper "Image compression with adaptive Haar-Walsh tilings" by Maj Lindberg and Lars F. Villemoes.

Input Arguments

  • dmatrix: The ghwt expanding coefficients of matrix on all levels contatenated in a 2d matrix.
  • GProws: Corresponding to the affinity matrix on rows.
  • GPcols: Corresponding to the affinity matrix on cols.

Output Arguments

  • Bbasis: The coefficients of the best-basis.
  • infovec: [infovec[i,1],infovec[i,2]] is the location of Bbasis[i] in dmatrix.

Copyright 2018 The Regents of the University of California

Implemented by Yiqun Shao (Adviser: Dr. Naoki Saito)

source
MultiscaleGraphSignalTransforms.GHWT_tf_2d.ghwt_tf_init_2dMethod
dmatrix = ghwt_tf_init_2d(matrix::Matrix{Float64}, GProws::GraphPart, GPcols::GraphPart)

Partition matrix first to get GProws and GPcols. Then expand matrix
in two directions to get dmatrix

Input Arguments

  • matrix::Matrix{Float64}: an input matrix
  • GProws::GraphPart: partitioning using rows as samples
  • GPcols::GraphPart: partitioning using cols as samples

Output Argument

  • dmatrix::matrix{Float64}: expansion coefficients of matrix
source
MultiscaleGraphSignalTransforms.GHWT_tf_2d.ghwt_tf_init_2dMethod
dmatrix, GProws, GPcols = ghwt_tf_init_2d(matrix::Matrix{Float64})

Partition matrix first to get GProws and GPcols. Then expand matrix
in two directions to get dmatrix

Input Arguments

  • matrix::Matrix{Float64}: an input matrix

Output Argument

  • GProws::GraphPart: partitioning using rows as samples
  • GPcols::GraphPart: partitioning using cols as samples
  • dmatrix::matrix{Float64}: expansion coefficients of matrix
source
MultiscaleGraphSignalTransforms.GHWT_tf_2d.ghwt_tf_synthesis_2dMethod
matrix = ghwt_tf_synthesis_2d(dmatrix::Matrix{Float64}, GProws::GraphPart, GPcols::GraphPart)

Synthesis the matrix from the coefficients of selected basis vectors.

Input Arguments

  • dmatrix: Only selected basis vectors are nonzero with expanding coeffcients.
  • GProws: Corresponding to the affinity matrix on rows.
  • GPcols: Corresponding to the affinity matrix on cols.

Output Arguments

  • matrix: Synthesized matrix

Copyright 2018 The Regents of the University of California

Implemented by Yiqun Shao (Adviser: Dr. Naoki Saito)

source
MultiscaleGraphSignalTransforms.GHWT_tf_2d.ghwt_tf_synthesis_2d_core!Method
ghwt_tf_synthesis_2d_core!(dmatrix::Array{Float64,3},tag::Array{Int,2},rs::Array{Int,2})

Core function of ghwttfsynthesis_2d. Synthesize on column direction

Input Arguments

  • dmatrix: Same size as dmatrix, but only selected basis vectors are nonzero with expanding coeffcients.
  • tag: Tag information in GP.
  • rs: Rs information in GP.

Output Arguments

  • dmatrix: Synthesized on column direction.

Copyright 2018 The Regents of the University of California

Implemented by Yiqun Shao (Adviser: Dr. Naoki Saito)

source
MultiscaleGraphSignalTransforms.GHWT_tf_2d.tf2d_initMethod
tf2d_init(tag::Matrix{Int},tag_r::Matrix{Int})

Storing the relation between the coefficient location in the 2D coefficients matrix of all levels with the (level, tag, region) information

Input Arguments

  • tag: The matrix of the tag information
  • tag_r: The matrix of the region information

Output Arguments

  • tag2ind: tag2ind[(j,k,l)] is the location of the column of coefficients on level j, region k and tag l
  • ind2tag: key and item of dicionary tag2ind interchanged

Copyright 2018 The Regents of the University of California

Implemented by Yiqun Shao (Adviser: Dr. Naoki Saito)

source
MultiscaleGraphSignalTransforms.GHWT_tf_2d.tf_core_2d_colMethod
dmatrix_new,tag2ind_new,ind2tag_new,tag_tf = tf_core_2d_col(dmatrix::Matrix{Float64},tag2ind::Dict{Tuple{Int,Int,Int},Int},ind2tag::Dict{Int,Tuple{Int,Int,Int}},jmax::Integer)

One forward iteration of 2-d time-frequency adapted ghwt on the column direction

Input Arguments

  • dmatrix: The cost-functional values of coeffcients
  • tag2ind: tag2ind[(j,k,l)] is the location of the column of coefficients on level j, region k and tag l
  • ind2tag: key and item of dicionary tag2ind interchanged

Output Arguments

  • dmatrix_new: The cost-functional values of coeffcients
  • tag2ind_new: tag2ind_new[(j,k,l)] is the location of the column of coefficients on level j, region k and tag l
  • ind2tag_new: key and item of dicionary tag2ind interchanged
  • tag_tf: recording the time-or-frequency information

Copyright 2018 The Regents of the University of California

Implemented by Yiqun Shao (Adviser: Dr. Naoki Saito)

source
MultiscaleGraphSignalTransforms.GHWT_tf_2d.tf_core_2d_rowMethod
dmatrix_new,tag2ind_new,ind2tag_new,tag_tf = tf_core_2d_row(dmatrix::Matrix{Float64},tag2ind::Dict{Tuple{Int,Int,Int},Int},ind2tag::Dict{Int,Tuple{Int,Int,Int}},jmax::Integer)

Almost the same as tfcore2dcol. But all the operations on matrix are row-wise. Due to the column-based matrix feature of Julia language. We are currently only using the tfcore2dcol here.

Input Arguments

  • dmatrix: The cost-functional values of coeffcients
  • tag2ind: tag2ind[(j,k,l)] is the location of the column of coefficients on level j, region k and tag l
  • ind2tag: key and item of dicionary tag2ind interchanged

Output Arguments

  • dmatrix_new: The cost-functional values of coeffcients
  • tag2ind_new: tag2ind_new[(j,k,l)] is the location of the row of coefficients on level j, region k and tag l
  • ind2tag_new: key and item of dicionary tag2ind interchanged
  • tag_tf: recording the time-or-frequency information

Copyright 2018 The Regents of the University of California

Implemented by Yiqun Shao (Adviser: Dr. Naoki Saito)

source