├── Demo_DL_syn.m ├── Demo_denoise_ge.m ├── Demo_denoise_v2.m ├── Demo_target_detection.m ├── README.md ├── data ├── HSIDnet_data.mat ├── jasperRidge_10band.mat └── watercolors_MSI.mat ├── lib ├── LTDL_utilize │ ├── LTDL.m │ ├── LTDL_denoising.m │ ├── LTDL_syth.m │ ├── Parset_LTDL.m │ ├── calc_curve.m │ ├── displayDictionaryElementsAsImage.m │ ├── extract_slices.m │ ├── hosvd.m │ ├── hosvd1.m │ ├── joint_slices.m │ ├── l2ls_learn_basis_dual.m │ ├── matched_atoms.m │ ├── myfkmeans.m │ ├── myscore.m │ ├── mysoft.m │ └── setR.m ├── compete_methods │ ├── 11 │ ├── BM3D │ │ ├── BM3D-SAPCA │ │ │ ├── BM3DSAPCA2009.p │ │ │ ├── README-BM3D-SAPCA.txt │ │ │ ├── demo_BM3DSAPCA.m │ │ │ ├── function_AnisLPAICI8.p │ │ │ ├── function_CreateLPAKernels.m │ │ │ ├── function_LPAKernelMatrixTheta.m │ │ │ ├── function_WOSFilters.p │ │ │ └── function_Window2D.m │ │ ├── BM3D.m │ │ ├── BM3DDEB.m │ │ ├── BM3DSHARP.m │ │ ├── CBM3D.m │ │ ├── CVBM3D.m │ │ ├── ClipComp16b.p │ │ ├── IDDBM3D │ │ │ ├── BM3DDEB_init.m │ │ │ ├── BlockMatch.mexw32 │ │ │ ├── BlockMatch.mexw64 │ │ │ ├── Demo_IDDBM3D.m │ │ │ ├── GroupProcessor.mexw32 │ │ │ ├── GroupProcessor.mexw64 │ │ │ └── IDDBM3D.p │ │ ├── LEGAL_NOTICE.txt │ │ ├── README.txt │ │ ├── VBM3D.m │ │ ├── bm3d_thr.mexa64 │ │ ├── bm3d_thr.mexglx │ │ ├── bm3d_thr.mexmaci │ │ ├── bm3d_thr.mexmaci64 │ │ ├── bm3d_thr.mexw32 │ │ ├── bm3d_thr.mexw64 │ │ ├── bm3d_thr_color.mexa64 │ │ ├── bm3d_thr_color.mexglx │ │ ├── bm3d_thr_color.mexmaci │ │ ├── bm3d_thr_color.mexmaci64 │ │ ├── bm3d_thr_color.mexw32 │ │ ├── bm3d_thr_color.mexw64 │ │ ├── bm3d_thr_colored_noise.mexa64 │ │ ├── bm3d_thr_colored_noise.mexglx │ │ ├── bm3d_thr_colored_noise.mexmaci │ │ ├── bm3d_thr_colored_noise.mexmaci64 │ │ ├── bm3d_thr_colored_noise.mexw32 │ │ ├── bm3d_thr_colored_noise.mexw64 │ │ ├── bm3d_thr_sharpen_var.mexa64 │ │ ├── bm3d_thr_sharpen_var.mexglx │ │ ├── bm3d_thr_sharpen_var.mexmaci │ │ ├── bm3d_thr_sharpen_var.mexmaci64 │ │ ├── bm3d_thr_sharpen_var.mexw32 │ │ ├── bm3d_thr_sharpen_var.mexw64 │ │ ├── bm3d_thr_video.mexa64 │ │ ├── bm3d_thr_video.mexglx │ │ ├── bm3d_thr_video.mexmaci │ │ ├── bm3d_thr_video.mexmaci64 │ │ ├── bm3d_thr_video.mexw32 │ │ ├── bm3d_thr_video.mexw64 │ │ ├── bm3d_thr_video_c.mexw32 │ │ ├── bm3d_thr_video_c.mexw64 │ │ ├── bm3d_wiener.mexa64 │ │ ├── bm3d_wiener.mexglx │ │ ├── bm3d_wiener.mexmaci │ │ ├── bm3d_wiener.mexmaci64 │ │ ├── bm3d_wiener.mexw32 │ │ ├── bm3d_wiener.mexw64 │ │ ├── bm3d_wiener_color.mexa64 │ │ ├── bm3d_wiener_color.mexglx │ │ ├── bm3d_wiener_color.mexmaci │ │ ├── bm3d_wiener_color.mexmaci64 │ │ ├── bm3d_wiener_color.mexw32 │ │ ├── bm3d_wiener_color.mexw64 │ │ ├── bm3d_wiener_colored_noise.mexa64 │ │ ├── bm3d_wiener_colored_noise.mexglx │ │ ├── bm3d_wiener_colored_noise.mexmaci │ │ ├── bm3d_wiener_colored_noise.mexmaci64 │ │ ├── bm3d_wiener_colored_noise.mexw32 │ │ ├── bm3d_wiener_colored_noise.mexw64 │ │ ├── bm3d_wiener_video.mexa64 │ │ ├── bm3d_wiener_video.mexglx │ │ ├── bm3d_wiener_video.mexmaci │ │ ├── bm3d_wiener_video.mexmaci64 │ │ ├── bm3d_wiener_video.mexw32 │ │ ├── bm3d_wiener_video.mexw64 │ │ ├── bm3d_wiener_video_c.mexw32 │ │ └── bm3d_wiener_video_c.mexw64 │ ├── BM4D │ │ ├── Legal_Notice.txt │ │ ├── README.txt │ │ ├── SheppLogan3D.mat │ │ ├── bm4d.m │ │ ├── bm4d_thr_mex.mexa64 │ │ ├── bm4d_thr_mex.mexmaci64 │ │ ├── bm4d_thr_mex.mexw64 │ │ ├── bm4d_thr_rice_mex.mexa64 │ │ ├── bm4d_thr_rice_mex.mexmaci64 │ │ ├── bm4d_thr_rice_mex.mexw64 │ │ ├── bm4d_wie_mex.mexa64 │ │ ├── bm4d_wie_mex.mexmaci64 │ │ ├── bm4d_wie_mex.mexw64 │ │ ├── bm4d_wie_rice_mex.mexa64 │ │ ├── bm4d_wie_rice_mex.mexmaci64 │ │ ├── bm4d_wie_rice_mex.mexw64 │ │ ├── constantsSparseTraj3D.m │ │ ├── dct3.m │ │ ├── demo_denoising.m │ │ ├── demo_reconstruction.m │ │ ├── idct3.m │ │ ├── imsfft2.m │ │ ├── msfft2.m │ │ ├── sampling.m │ │ ├── ssim_index3d.m │ │ ├── t1_icbm_normal_1mm_pn0_rf0.rawb │ │ └── visualizeXsect.m │ ├── HSI-DeNet1 │ │ ├── GenerateData.m │ │ ├── Model │ │ │ ├── Sigma=10_net.mat │ │ │ └── Sigma=20_net.mat │ │ ├── Readme.txt │ │ ├── addLayer.m │ │ ├── backward.m │ │ ├── get_data.m │ │ ├── get_test_ms.m │ │ ├── get_train_initial_HSI.m │ │ ├── main_start_ms.m │ │ ├── src │ │ │ ├── +solver │ │ │ │ ├── adadelta.m │ │ │ │ ├── adagrad.m │ │ │ │ ├── adam.m │ │ │ │ ├── rmsprop.m │ │ │ │ └── sgd.m │ │ │ ├── Cal_PSNRSSIM.m │ │ │ ├── PBlending.m │ │ │ ├── PoissonJacobi.m │ │ │ ├── cnn_train_dag_GAN.m │ │ │ ├── cnn_train_dag_ms.m │ │ │ ├── cnn_train_dag_stackgrad.m │ │ │ ├── cnn_train_dag_weightedL2.m │ │ │ ├── get_BN_dag.m │ │ │ ├── get_Block_CBR.m │ │ │ ├── get_Block_CBR_V1.m │ │ │ ├── get_Block_DCBR.m │ │ │ ├── get_Bnorm_dag.m │ │ │ ├── get_Concat_dag.m │ │ │ ├── get_Conv_BN_ReLU_dag.m │ │ │ ├── get_Conv_dag.m │ │ │ ├── get_DecConv_dag.m │ │ │ ├── get_ReLU_dag.m │ │ │ ├── get_Res_Block_CBRCBS.m │ │ │ ├── get_Sigmoid_dag.m │ │ │ ├── get_Sum_dag.m │ │ │ ├── get_img2list.m │ │ │ ├── get_img2re_crop_img.m │ │ │ ├── image_adjust.m │ │ │ ├── imgrad.m │ │ │ ├── learning_rate_policy.m │ │ │ ├── matlab │ │ │ │ ├── +dagnn │ │ │ │ │ ├── @DagNN │ │ │ │ │ │ ├── backward.m │ │ │ │ │ │ └── forward.m │ │ │ │ │ ├── Reshape.m │ │ │ │ │ ├── Tanh.m │ │ │ │ │ └── vllab_dag_loss.m │ │ │ │ └── vl_nnreshape.m │ │ │ ├── modcrop.m │ │ │ ├── utilities │ │ │ │ ├── ErrRelGlobAdimSyn.m │ │ │ │ ├── SpectAngMapper.m │ │ │ │ ├── cal_ssim.m │ │ │ │ ├── csnr.m │ │ │ │ ├── data_augmentation.m │ │ │ │ ├── modcrop.m │ │ │ │ ├── normalized.m │ │ │ │ ├── patches_generation.m │ │ │ │ └── shave.m │ │ │ ├── visulization.m │ │ │ ├── vl_argparse.m │ │ │ ├── writeBMP.m │ │ │ └── writeGIF.m │ │ ├── test_sigma20.m │ │ ├── utilities │ │ │ ├── ErrRelGlobAdimSyn.m │ │ │ ├── FeatureSIM.m │ │ │ ├── MSIQA.m │ │ │ ├── PSNR3D.m │ │ │ ├── SpectAngMapper.m │ │ │ ├── data_augmentation.m │ │ │ ├── modcrop.m │ │ │ ├── normalized.m │ │ │ ├── patches_generation.m │ │ │ ├── shave.m │ │ │ └── ssim_index.m │ │ ├── vllab_nn_L1_loss.m │ │ └── vllab_nn_L2_loss.m │ ├── KBRreg │ │ ├── Block_matching3D.m │ │ ├── ClosedS.m │ │ ├── ClosedWL1.m │ │ ├── ClosedWNNM.m │ │ ├── Im2Patch3D.m │ │ ├── KBR_DeNoising.m │ │ ├── KBRreg.m │ │ ├── NeighborIndex.m │ │ ├── ParSet.m │ │ ├── Patch2Im3D.m │ │ ├── Pro2WNNM.m │ │ ├── my_tensor_toolbox │ │ │ ├── CreateImageSeq.m │ │ │ ├── CreateMovie.m │ │ │ ├── Fold.m │ │ │ ├── ImgSeq2Video.m │ │ │ ├── MySVD.m │ │ │ ├── MySVDs.m │ │ │ ├── MySVDtau.m │ │ │ ├── Pro2TraceNorm.m │ │ │ ├── Pro2TraceNorm_my.m │ │ │ ├── SingularValue.m │ │ │ ├── TensorTimes.m │ │ │ ├── Truncate.m │ │ │ ├── Unfold.m │ │ │ ├── WindowBig.m │ │ │ └── normalized.m │ │ ├── my_ttm.m │ │ ├── normalized.m │ │ └── tensorSVD.m │ ├── LLRT │ │ ├── Block_matching.m │ │ ├── ClosedWNNM.m │ │ ├── Cub2Patch.m │ │ ├── ImUpdata.m │ │ ├── LLRT_DeNoising.m │ │ ├── NLPatEstimation.m │ │ ├── NeighborIndex.m │ │ ├── ParSet_Color.m │ │ ├── ParSet_LLRT.m │ │ ├── Patch2Cub.m │ │ ├── Proc_cls_idx.m │ │ ├── WNNM.m │ │ └── soft_L1_shrink.m │ ├── LRTA.m │ ├── MStSVD │ │ ├── Demo.m │ │ ├── mex │ │ │ ├── CPU_search.mexw64 │ │ │ ├── GPU_search.mexw64 │ │ │ └── MS_tSVD.mexw64 │ │ ├── mex_tSVD.m │ │ ├── my_ttm2.m │ │ └── t_svd_lib │ │ │ ├── NL_d_svd.m │ │ │ ├── NL_t_svd.m │ │ │ ├── Wiener_NL_d_svd.m │ │ │ ├── Wiener_NL_t_svd.m │ │ │ ├── d_svd.m │ │ │ ├── fast_NL_d_HOSVD.m │ │ │ ├── fast_NL_d_svd.m │ │ │ ├── fast_NL_t_HOSVD.m │ │ │ ├── fast_NL_t_svd.m │ │ │ ├── fast_NL_t_svd2.m │ │ │ ├── fast_my_tenmat.m │ │ │ ├── fast_t_NLPCA.m │ │ │ ├── ffd.m │ │ │ ├── iffd.m │ │ │ ├── mat_ten.m │ │ │ ├── my_tenmat.m │ │ │ ├── my_ttm.m │ │ │ ├── my_ttm2.m │ │ │ ├── search_cube.m │ │ │ ├── search_cube_new.m │ │ │ ├── search_cube_new_j.m │ │ │ ├── superfast_NL_t_svd.m │ │ │ ├── t_product.m │ │ │ ├── t_svd.m │ │ │ ├── test_t_d_svd.m │ │ │ ├── test_time.m │ │ │ ├── tproduce.m │ │ │ └── tran.m │ ├── NLM3D.m │ ├── PARAFAC.m │ ├── ksvdbox │ │ ├── Contents.m │ │ ├── faq.txt │ │ ├── images │ │ │ ├── barbara.png │ │ │ ├── boat.png │ │ │ ├── house.png │ │ │ ├── lena.png │ │ │ └── peppers.png │ │ ├── ksvd.m │ │ ├── ksvddemo.m │ │ ├── ksvddenoise.m │ │ ├── ksvddenoisedemo.m │ │ ├── ksvdver.m │ │ ├── odct2dict.m │ │ ├── odct3dict.m │ │ ├── odctdict.m │ │ ├── odctndict.m │ │ ├── ompbox │ │ │ ├── Contents.m │ │ │ ├── faq.txt │ │ │ ├── omp.m │ │ │ ├── omp2.m │ │ │ ├── ompdemo.m │ │ │ ├── ompspeedtest.m │ │ │ ├── ompver.m │ │ │ ├── private │ │ │ │ ├── make.m │ │ │ │ ├── myblas.c │ │ │ │ ├── myblas.h │ │ │ │ ├── omp2mex.c │ │ │ │ ├── omp2mex.m │ │ │ │ ├── omp2mex.mexw32 │ │ │ │ ├── omp2mex.mexw64 │ │ │ │ ├── ompcore.c │ │ │ │ ├── ompcore.h │ │ │ │ ├── ompmex.c │ │ │ │ ├── ompmex.m │ │ │ │ ├── ompmex.mexw32 │ │ │ │ ├── ompmex.mexw64 │ │ │ │ ├── ompprof.c │ │ │ │ ├── ompprof.h │ │ │ │ ├── omputils.c │ │ │ │ ├── omputils.h │ │ │ │ └── printf.m │ │ │ └── readme.txt │ │ ├── ompdenoise.m │ │ ├── ompdenoise1.m │ │ ├── ompdenoise2.m │ │ ├── ompdenoise3.m │ │ ├── private │ │ │ ├── add_dc.m │ │ │ ├── addtocols.c │ │ │ ├── addtocols.m │ │ │ ├── addtocols.mexw32 │ │ │ ├── addtocols.mexw64 │ │ │ ├── col2imsum.m │ │ │ ├── collincomb.c │ │ │ ├── collincomb.m │ │ │ ├── collincomb.mexw32 │ │ │ ├── collincomb.mexw64 │ │ │ ├── countcover.m │ │ │ ├── dictdist.m │ │ │ ├── imnormalize.m │ │ │ ├── iswhole.m │ │ │ ├── make.m │ │ │ ├── mexutils.c │ │ │ ├── mexutils.h │ │ │ ├── normcols.m │ │ │ ├── printf.m │ │ │ ├── reggrid.m │ │ │ ├── remove_dc.m │ │ │ ├── rowlincomb.c │ │ │ ├── rowlincomb.m │ │ │ ├── rowlincomb.mexw32 │ │ │ ├── rowlincomb.mexw64 │ │ │ ├── sampgrid.m │ │ │ ├── secs2hms.m │ │ │ ├── spdiag.m │ │ │ ├── sprow.c │ │ │ ├── sprow.m │ │ │ ├── sprow.mexw32 │ │ │ ├── sprow.mexw64 │ │ │ ├── timerclear.m │ │ │ ├── timereta.m │ │ │ └── timerinit.m │ │ ├── readme.txt │ │ └── showdict.m │ ├── naonlm3d │ │ ├── MABONLM3D.c │ │ ├── MABONLM3D.mexw32 │ │ ├── MABONLM3D.mexw64 │ │ ├── MBONLM3D.c │ │ ├── MBONLM3D.mexw32 │ │ ├── MBONLM3D.mexw64 │ │ ├── README.txt │ │ ├── Wave3D │ │ │ ├── FSfarras.m │ │ │ ├── afb3D.m │ │ │ ├── cshift3D.m │ │ │ ├── dwt3D.m │ │ │ ├── dwt3D_plots.m │ │ │ ├── farras.m │ │ │ ├── idwt3D.m │ │ │ ├── mixingsubband.m │ │ │ ├── pm4.m │ │ │ ├── pm4inv.m │ │ │ └── sfb3D.m │ │ ├── t1_icbm_normal_1mm_pn0_rf0.rawb │ │ ├── test3D_Gaussian_homo_T1.m │ │ ├── test3D_Gaussian_variable_T1.m │ │ ├── test3D_Rician_homo_T1.m │ │ └── test3D_Rician_variable_T1.m │ └── tensor_dl │ │ ├── TensorDL.m │ │ ├── dependency │ │ ├── fkmeans │ │ │ ├── fkmeans.m │ │ │ ├── kmeans.m │ │ │ └── license.txt │ │ ├── kmeans │ │ │ ├── kmeans.m │ │ │ └── license.txt │ │ └── poblano_toolbox │ │ │ ├── COPYRIGHT.txt │ │ │ ├── Contents.m │ │ │ ├── INSTALL.txt │ │ │ ├── LICENSE.txt │ │ │ ├── cstep.m │ │ │ ├── cvsrch.m │ │ │ ├── example1.m │ │ │ ├── example2.m │ │ │ ├── example2_extract.m │ │ │ ├── example2_init.m │ │ │ ├── gradientcheck.m │ │ │ ├── hessvec_fd.m │ │ │ ├── info.xml │ │ │ ├── install_poblano.m │ │ │ ├── lbfgs.m │ │ │ ├── ncg.m │ │ │ ├── poblano_linesearch.m │ │ │ ├── poblano_out.m │ │ │ ├── poblano_params.m │ │ │ └── tn.m │ │ └── utils │ │ ├── DimDetectAIC.m │ │ ├── DimDetectMDL.m │ │ ├── ExtractBlocks.m │ │ ├── JointBlocks.m │ │ └── TuckerALS.m ├── findFMeasure.m ├── hyperspectralToolbox │ ├── contents.m │ ├── fnnls.m │ ├── hyperAce.m │ ├── hyperAmsd.m │ ├── hyperAtgp.m │ ├── hyperCem.m │ ├── hyperConvert2Colormap.m │ ├── hyperConvert2d.m │ ├── hyperConvert3d.m │ ├── hyperConvexHullRemoval.m │ ├── hyperCorr.m │ ├── hyperCov.m │ ├── hyperDemo.m │ ├── hyperDemo_ASD_reader.m │ ├── hyperDemo_RIT_data.m │ ├── hyperDemo_detectors.m │ ├── hyperDemo_mams_RIT_data.m │ ├── hyperDestreak.m │ ├── hyperFcls.m │ ├── hyperFclsMatlab.m │ ├── hyperFileFind.m │ ├── hyperGetEnviSignature.m │ ├── hyperGetHymapWavelengthsNm.m │ ├── hyperGlrt.m │ ├── hyperHfcVd.m │ ├── hyperHud.m │ ├── hyperIcaComponentScores.m │ ├── hyperIcaEea.m │ ├── hyperImagesc.m │ ├── hyperImshow.m │ ├── hyperMatchedFilter.m │ ├── hyperMax2d.m │ ├── hyperMnf.m │ ├── hyperNapc.m │ ├── hyperNnls.m │ ├── hyperNormXCorr.m │ ├── hyperNormalize.m │ ├── hyperOrthorectify.m │ ├── hyperOsp.m │ ├── hyperPct.m │ ├── hyperPlmf.m │ ├── hyperPpi.m │ ├── hyperReadAsd.m │ ├── hyperReadAvirisRfl.m │ ├── hyperReadAvirisSpc.m │ ├── hyperReadSpecpr.m │ ├── hyperResample.m │ ├── hyperRmf.m │ ├── hyperRoc.m │ ├── hyperRxDetector.m │ ├── hyperSam.m │ ├── hyperSaveFigure.m │ ├── hyperSid.m │ ├── hyperSignedAce.m │ ├── hyperUcls.m │ ├── hyperVca.m │ ├── hyperWhiten.m │ └── results │ │ ├── ace detector.png │ │ ├── amsd detector.png │ │ ├── cem detector.png │ │ ├── hud detector.png │ │ ├── mf detector.png │ │ ├── osp detector.png │ │ ├── rx detector.png │ │ └── signed ace detector.png ├── myPlotROC.m ├── quality_assess │ ├── ErrRelGlobAdimSyn.m │ ├── FeatureSIM.m │ ├── MSIQA.m │ ├── PSNR3D.m │ ├── SpectAngMapper.m │ └── ssim_index.m ├── show_BS.m ├── tensor_toolbox │ ├── @ktensor │ │ ├── Contents.m │ │ ├── arrange.m │ │ ├── datadisp.m │ │ ├── disp.m │ │ ├── display.m │ │ ├── double.m │ │ ├── end.m │ │ ├── extract.m │ │ ├── fixsigns.m │ │ ├── full.m │ │ ├── innerprod.m │ │ ├── isequal.m │ │ ├── ktensor.m │ │ ├── minus.m │ │ ├── mtimes.m │ │ ├── mttkrp.m │ │ ├── ncomponents.m │ │ ├── ndims.m │ │ ├── norm.m │ │ ├── normalize.m │ │ ├── nvecs.m │ │ ├── permute.m │ │ ├── plus.m │ │ ├── redistribute.m │ │ ├── score.m │ │ ├── size.m │ │ ├── subsasgn.m │ │ ├── subsref.m │ │ ├── times.m │ │ ├── tocell.m │ │ ├── ttm.m │ │ ├── ttv.m │ │ ├── uminus.m │ │ └── uplus.m │ ├── @sptenmat │ │ ├── Contents.m │ │ ├── aatx.m │ │ ├── disp.m │ │ ├── display.m │ │ ├── double.m │ │ ├── end.m │ │ ├── full.m │ │ ├── nnz.m │ │ ├── norm.m │ │ ├── size.m │ │ ├── sptenmat.m │ │ ├── subsasgn.m │ │ ├── subsref.m │ │ ├── tsize.m │ │ ├── uminus.m │ │ └── uplus.m │ ├── @sptensor │ │ ├── Contents.m │ │ ├── and.m │ │ ├── collapse.m │ │ ├── contract.m │ │ ├── ctranspose.m │ │ ├── disp.m │ │ ├── display.m │ │ ├── divide.m │ │ ├── double.m │ │ ├── elemfun.m │ │ ├── end.m │ │ ├── eq.m │ │ ├── find.m │ │ ├── full.m │ │ ├── ge.m │ │ ├── gt.m │ │ ├── innerprod.m │ │ ├── isequal.m │ │ ├── ldivide.m │ │ ├── le.m │ │ ├── lt.m │ │ ├── minus.m │ │ ├── mldivide.m │ │ ├── mrdivide.m │ │ ├── mtimes.m │ │ ├── mttkrp.m │ │ ├── ndims.m │ │ ├── ne.m │ │ ├── nnz.m │ │ ├── norm.m │ │ ├── not.m │ │ ├── nvecs.m │ │ ├── ones.m │ │ ├── or.m │ │ ├── permute.m │ │ ├── plus.m │ │ ├── private │ │ │ ├── allsubs.m │ │ │ ├── extract.m │ │ │ ├── irenumber.m │ │ │ ├── renumber.m │ │ │ └── subdims.m │ │ ├── rdivide.m │ │ ├── reshape.m │ │ ├── scale.m │ │ ├── size.m │ │ ├── spmatrix.m │ │ ├── sptensor.m │ │ ├── squeeze.m │ │ ├── subsasgn.m │ │ ├── subsref.m │ │ ├── times.m │ │ ├── transpose.m │ │ ├── ttm.m │ │ ├── ttt.m │ │ ├── ttv.m │ │ ├── uminus.m │ │ ├── uplus.m │ │ └── xor.m │ ├── @tenmat │ │ ├── Contents.m │ │ ├── ctranspose.m │ │ ├── disp.m │ │ ├── display.m │ │ ├── double.m │ │ ├── end.m │ │ ├── minus.m │ │ ├── mtimes.m │ │ ├── norm.m │ │ ├── plus.m │ │ ├── size.m │ │ ├── subsasgn.m │ │ ├── subsref.m │ │ ├── tenmat.m │ │ ├── tsize.m │ │ ├── uminus.m │ │ └── uplus.m │ ├── @tensor │ │ ├── Contents.m │ │ ├── and.m │ │ ├── collapse.m │ │ ├── contract.m │ │ ├── ctranspose.m │ │ ├── disp.m │ │ ├── display.m │ │ ├── double.m │ │ ├── end.m │ │ ├── eq.m │ │ ├── find.m │ │ ├── full.m │ │ ├── ge.m │ │ ├── gt.m │ │ ├── innerprod.m │ │ ├── isequal.m │ │ ├── issymmetric.m │ │ ├── ldivide.m │ │ ├── le.m │ │ ├── lt.m │ │ ├── minus.m │ │ ├── mldivide.m │ │ ├── mrdivide.m │ │ ├── mtimes.m │ │ ├── mttkrp.m │ │ ├── my_nvecs.m │ │ ├── ndims.m │ │ ├── ne.m │ │ ├── nnz.m │ │ ├── norm.m │ │ ├── not.m │ │ ├── nvecs.m │ │ ├── or.m │ │ ├── permute.m │ │ ├── plus.m │ │ ├── power.m │ │ ├── rdivide.m │ │ ├── reshape.m │ │ ├── scale.m │ │ ├── size.m │ │ ├── squeeze.m │ │ ├── subsasgn.m │ │ ├── subsref.m │ │ ├── symmetrize.m │ │ ├── tenfun.m │ │ ├── tensor.m │ │ ├── times.m │ │ ├── transpose.m │ │ ├── ttm.m │ │ ├── ttsv.m │ │ ├── ttt.m │ │ ├── ttv.m │ │ ├── uminus.m │ │ ├── uplus.m │ │ └── xor.m │ ├── @ttensor │ │ ├── Contents.m │ │ ├── disp.m │ │ ├── display.m │ │ ├── double.m │ │ ├── end.m │ │ ├── full.m │ │ ├── innerprod.m │ │ ├── isequal.m │ │ ├── mtimes.m │ │ ├── mttkrp.m │ │ ├── ndims.m │ │ ├── norm.m │ │ ├── nvecs.m │ │ ├── permute.m │ │ ├── size.m │ │ ├── subsasgn.m │ │ ├── subsref.m │ │ ├── ttensor.m │ │ ├── ttm.m │ │ ├── ttv.m │ │ ├── uminus.m │ │ └── uplus.m │ ├── COPYRIGHT.txt │ ├── Contents.m │ ├── INSTALL.txt │ ├── LICENSE.txt │ ├── RELEASE_NOTES.txt │ ├── algorithms │ │ ├── Contents.m │ │ ├── cp_als.m │ │ ├── cp_fg.m │ │ ├── cp_fun.m │ │ ├── cp_nmu.m │ │ ├── cp_opt.m │ │ ├── cp_vec_to_fac.m │ │ ├── cp_wfg.m │ │ ├── cp_wfg_sparse.m │ │ ├── cp_wfg_sparse_setup.m │ │ ├── cp_wfun.m │ │ ├── cp_wopt.m │ │ ├── fac_to_vec.m │ │ ├── parafac_als.m │ │ └── tucker_als.m │ ├── cp_als.m │ ├── cp_apr.m │ ├── cp_nmu.m │ ├── cp_opt.m │ ├── cp_wopt.m │ ├── create_guess.m │ ├── create_problem.m │ ├── doc │ │ ├── A1_tensor_doc.m │ │ ├── A2_sptensor_doc.m │ │ ├── B1_tenmat_doc.m │ │ ├── B2_sptenmat_doc.m │ │ ├── C_ttensor_doc.m │ │ ├── D_ktensor_doc.m │ │ ├── M1_multiply_doc.m │ │ ├── M2_identities_doc_future.m │ │ ├── N_nvecs_doc.m │ │ ├── Q_collapse_scale_doc.m │ │ ├── S_test_problems_doc.m │ │ ├── T1_algorithms_doc.m │ │ ├── T2_opt_algorithms_doc.m │ │ ├── T3_wopt_algorithms_doc.m │ │ ├── T4_cpapr_doc.m │ │ ├── T_algorithms_doc.m │ │ ├── V_SSHOPM_doc.m │ │ ├── html │ │ │ ├── A1_tensor_doc.html │ │ │ ├── A2_sptensor_doc.html │ │ │ ├── B1_tenmat_doc.html │ │ │ ├── B2_sptenmat_doc.html │ │ │ ├── C_ttensor_doc.html │ │ │ ├── C_ttensor_doc_eq15566.png │ │ │ ├── D_ktensor_doc.html │ │ │ ├── D_ktensor_doc_eq09466.png │ │ │ ├── D_ktensor_doc_eq51104.png │ │ │ ├── D_ktensor_doc_eq64665.png │ │ │ ├── D_ktensor_doc_eq81501.png │ │ │ ├── M1_multiply_doc.html │ │ │ ├── N_nvecs_doc.html │ │ │ ├── Q_collapse_scale_doc.html │ │ │ ├── S_test_problems_doc.html │ │ │ ├── T1_algorithms_doc.html │ │ │ ├── T2_opt_algorithms_doc.html │ │ │ ├── T3_wopt_algorithms_doc.html │ │ │ ├── T4_cpapr_doc.html │ │ │ ├── T_algorithms_doc.html │ │ │ ├── V_SSHOPM_doc.html │ │ │ ├── V_SSHOPM_doc.png │ │ │ ├── V_SSHOPM_doc_01.png │ │ │ └── V_SSHOPM_doc_02.png │ │ └── images │ │ │ ├── Workspace.png │ │ │ ├── banner-background.jpg │ │ │ └── logo.gif │ ├── export_data.m │ ├── helpindex.xml │ ├── helptoc.xml │ ├── import_data.m │ ├── info.xml │ ├── khatrirao.m │ ├── met │ │ ├── Contents.m │ │ ├── ttm_me.m │ │ ├── ttm_me_mem.m │ │ ├── ttm_me_partition.m │ │ ├── tucker_me.m │ │ └── tucker_me_test.m │ ├── parafac_als.m │ ├── sptendiag.m │ ├── sptenrand.m │ ├── sshopm.m │ ├── sshopmc.m │ ├── tendiag.m │ ├── teneye.m │ ├── tenones.m │ ├── tenrand.m │ ├── tensor_toolbox_product_page.html │ ├── tenzeros.m │ ├── tt_RandOrthMat.m │ ├── tt_assignment_type.m │ ├── tt_ccong.m │ ├── tt_combinator.m │ ├── tt_cp_fg.m │ ├── tt_cp_fun.m │ ├── tt_cp_vec_to_fac.m │ ├── tt_cp_wfg.m │ ├── tt_cp_wfg_sparse.m │ ├── tt_cp_wfg_sparse_setup.m │ ├── tt_cp_wfun.m │ ├── tt_create_missing_data_pattern.m │ ├── tt_dimscheck.m │ ├── tt_fac_to_vec.m │ ├── tt_ind2sub.m │ ├── tt_intvec2str.m │ ├── tt_loglikelihood.m │ ├── tt_matrix2cellstr.m │ ├── tt_size2str.m │ ├── tt_sizecheck.m │ ├── tt_sub2ind.m │ ├── tt_subscheck.m │ ├── tt_subsubsref.m │ ├── tt_valscheck.m │ └── tucker_als.m ├── tensorlab │ ├── Contents.m │ ├── btd_core.m │ ├── btd_minf.m │ ├── btd_nls.m │ ├── btd_rnd.m │ ├── btdgen.m │ ├── btdres.m │ ├── ccpd_core.m │ ├── ccpd_minf.m │ ├── ccpd_nls.m │ ├── contract.m │ ├── cpd.m │ ├── cpd3_sd.m │ ├── cpd3_sgsd.m │ ├── cpd_aels.m │ ├── cpd_als.m │ ├── cpd_core.m │ ├── cpd_crb.m │ ├── cpd_els.m │ ├── cpd_eps.m │ ├── cpd_gevd.m │ ├── cpd_lsb.m │ ├── cpd_minf.m │ ├── cpd_nls.m │ ├── cpd_rbs.m │ ├── cpd_rnd.m │ ├── cpderr.m │ ├── cpdgen.m │ ├── cpdres.m │ ├── cum3.m │ ├── cum4.m │ ├── dcov.m │ ├── decimate.m │ ├── dedecimate.m │ ├── dehankelize.m │ ├── deloewnerize.m │ ├── deriv.m │ ├── desegmentize.m │ ├── detectstructure.m │ ├── dotk.m │ ├── fixedAngleVect.m │ ├── fmt.m │ ├── frob.m │ ├── frobbtdres.m │ ├── frobcpdres.m │ ├── frobll1res.m │ ├── froblmlrares.m │ ├── ful.m │ ├── gap.m │ ├── genpolybasis.m │ ├── getorder.m │ ├── getsize.m │ ├── getstructure.m │ ├── gevd_bal.m │ ├── hankelize.m │ ├── inprod.m │ ├── isvalidtensor.m │ ├── kmeans.m │ ├── kr.m │ ├── kron.m │ ├── license_tensorlab.txt │ ├── ll1.m │ ├── ll1_core.m │ ├── ll1_gevd.m │ ├── ll1_minf.m │ ├── ll1_nls.m │ ├── ll1_rnd.m │ ├── ll1convert.m │ ├── ll1gen.m │ ├── ll1res.m │ ├── lmlra.m │ ├── lmlra3_dgn.m │ ├── lmlra3_rtr.m │ ├── lmlra_aca.m │ ├── lmlra_core.m │ ├── lmlra_hooi.m │ ├── lmlra_minf.m │ ├── lmlra_nls.m │ ├── lmlra_rnd.m │ ├── lmlraerr.m │ ├── lmlragen.m │ ├── lmlrares.m │ ├── loewnerize.m │ ├── ls_mt.m │ ├── mat2tens.m │ ├── minf_lbfgs.m │ ├── minf_lbfgsdl.m │ ├── minf_ncg.m │ ├── minf_sr1cgs.m │ ├── mlrank.m │ ├── mlrankest.m │ ├── mlsvd.m │ ├── mlsvd_rsi.m │ ├── mlsvds.m │ ├── mpcg.m │ ├── mtkronprod.m │ ├── mtkrprod.m │ ├── nls_gncgs.m │ ├── nls_gndl.m │ ├── nls_lm.m │ ├── nlsb_gndl.m │ ├── noisy.m │ ├── outprod.m │ ├── polymin.m │ ├── polymin2.m │ ├── polysol2.m │ ├── polyval2.m │ ├── rankest.m │ ├── ratmin.m │ ├── ratmin2.m │ ├── scov.m │ ├── sdf_check.m │ ├── sdf_core.m │ ├── sdf_minf.m │ ├── sdf_nls.m │ ├── segmentize.m │ ├── slice3.m │ ├── spy3.m │ ├── stcum4.m │ ├── struct_LL1.m │ ├── struct_abs.m │ ├── struct_band.m │ ├── struct_cauchy.m │ ├── struct_cell2mat.m │ ├── struct_conj.m │ ├── struct_const.m │ ├── struct_ctranspose.m │ ├── struct_diag.m │ ├── struct_exp.m │ ├── struct_fd.m │ ├── struct_gram.m │ ├── struct_hankel.m │ ├── struct_inv.m │ ├── struct_invsqrtm.m │ ├── struct_invtransp.m │ ├── struct_kr.m │ ├── struct_kron.m │ ├── struct_log.m │ ├── struct_matvec.m │ ├── struct_nonneg.m │ ├── struct_nop.m │ ├── struct_normalize.m │ ├── struct_orth.m │ ├── struct_plus.m │ ├── struct_poly.m │ ├── struct_power.m │ ├── struct_prod.m │ ├── struct_rational.m │ ├── struct_rbf.m │ ├── struct_select.m │ ├── struct_sigmoid.m │ ├── struct_sqrt.m │ ├── struct_sum.m │ ├── struct_times.m │ ├── struct_toeplitz.m │ ├── struct_transpose.m │ ├── struct_tridiag.m │ ├── struct_tril.m │ ├── struct_triu.m │ ├── struct_vander.m │ ├── sumk.m │ ├── surf3.m │ ├── tens2mat.m │ ├── tens2vec.m │ ├── tmprod.m │ ├── transform_poly.m │ ├── ttgen.m │ ├── userguide3.pdf │ ├── vec2tens.m │ ├── visualize.m │ ├── voxel3.m │ └── xcum4.m └── tight_subplot.m └── result ├── pre_jasperRidge_10band.mat ├── pre_modeldrivenVSdatadriven.png ├── pre_synthetic_data_test_once.png └── pre_watercolors_MSI.png /Demo_DL_syn.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/Demo_DL_syn.m -------------------------------------------------------------------------------- /data/HSIDnet_data.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/data/HSIDnet_data.mat -------------------------------------------------------------------------------- /data/jasperRidge_10band.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/data/jasperRidge_10band.mat -------------------------------------------------------------------------------- /data/watercolors_MSI.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/data/watercolors_MSI.mat -------------------------------------------------------------------------------- /lib/LTDL_utilize/LTDL.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/LTDL_utilize/LTDL.m -------------------------------------------------------------------------------- /lib/LTDL_utilize/Parset_LTDL.m: -------------------------------------------------------------------------------- 1 | function par = Parset_LTDL(msi_sz) 2 | %if you want to test the LTDL on cropped MSIs, please tune the redundancy 3 | %ratio of dictionaries between 1.2-1.5, 4 | par.fatratio_D = [1.5,1.5]; %the redundancy ratio of dictionaries 5 | par.nu = 1.05; 6 | par.cS = 2; 7 | par.cR = 1000; %1000 8 | par.delta = 0.2; 9 | par.numDenoise = 2; 10 | par.block_sz = [7 7]; 11 | par.overlap_sz = [5 5]; 12 | par.block_num = ceil((msi_sz(1:2) - par.overlap_sz)./(par.block_sz - par.overlap_sz)); 13 | par.remnum = rem(msi_sz(1:2) - par.overlap_sz,par.block_sz - par.overlap_sz); 14 | % parameters for the algorithm 15 | par.epsilon = 1e-4; 16 | par.max_iter = 30; 17 | par.rho = 1; 18 | end -------------------------------------------------------------------------------- /lib/LTDL_utilize/hosvd1.m: -------------------------------------------------------------------------------- 1 | function T = hosvd1(X,R) 2 | %HOSVD Compute sequentially-truncated higher-order SVD (Tucker). 3 | 4 | %% Read paramters 5 | d = ndims(X); 6 | dimorder = 1:d; 7 | 8 | %% Main loop 9 | 10 | U = cell(d,1); % Allocate space for factor matrices 11 | 12 | for k = dimorder 13 | Xk = tens2mat(X,k); 14 | [U{k},~,~] = svd(Xk*Xk'); 15 | U{k} = U{k}(:,1:R(k)); 16 | end 17 | G = tmprod(X,U,dimorder,'H'); 18 | 19 | %% Final result 20 | T = tmprod(G,U,dimorder); -------------------------------------------------------------------------------- /lib/LTDL_utilize/matched_atoms.m: -------------------------------------------------------------------------------- 1 | function [num] = matched_atoms(D,D0,err_atom) 2 | sizD = size(D); 3 | num = 0; 4 | nu = sizD(2); 5 | for j = 1:sizD(2) 6 | da = D(:,j)/(D(:,j)'*D(:,j)); 7 | err_da = ones(nu,1) - abs(D0'*da); % calculate the error 8 | %err_da = acos(abs(D0'*da)./(da'*da)); % calculate the angle 9 | [min_da, p] = min(err_da); 10 | if min_da < err_atom %pi/9 11 | D0(:,p) = []; 12 | num = num + 1; 13 | nu = nu - 1; 14 | end 15 | end 16 | end -------------------------------------------------------------------------------- /lib/LTDL_utilize/mysoft.m: -------------------------------------------------------------------------------- 1 | function [X] = mysoft(B,lamda,p) 2 | B = double(B); 3 | X = sign(B).*max(abs(B)-lamda*abs(B).^(p-1),0); 4 | %X = tensor(X,dims); 5 | end 6 | -------------------------------------------------------------------------------- /lib/LTDL_utilize/setR.m: -------------------------------------------------------------------------------- 1 | function [R] = setR(All_group,nclusters) 2 | R = zeros(3,nclusters); 3 | % for msi denoising with Gaussian noises 4 | for k = 1:nclusters 5 | X = All_group{k}; 6 | R(:,k) = myscore(X); 7 | end 8 | end -------------------------------------------------------------------------------- /lib/compete_methods/11: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/BM3D-SAPCA/BM3DSAPCA2009.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/BM3D-SAPCA/BM3DSAPCA2009.p -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/BM3D-SAPCA/function_AnisLPAICI8.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/BM3D-SAPCA/function_AnisLPAICI8.p -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/BM3D-SAPCA/function_WOSFilters.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/BM3D-SAPCA/function_WOSFilters.p -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/BM3DDEB.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/BM3DDEB.m -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/BM3DSHARP.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/BM3DSHARP.m -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/CVBM3D.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/CVBM3D.m -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/ClipComp16b.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/ClipComp16b.p -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/IDDBM3D/BM3DDEB_init.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/IDDBM3D/BM3DDEB_init.m -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/IDDBM3D/BlockMatch.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/IDDBM3D/BlockMatch.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/IDDBM3D/BlockMatch.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/IDDBM3D/BlockMatch.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/IDDBM3D/GroupProcessor.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/IDDBM3D/GroupProcessor.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/IDDBM3D/GroupProcessor.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/IDDBM3D/GroupProcessor.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/IDDBM3D/IDDBM3D.p: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/IDDBM3D/IDDBM3D.p -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/LEGAL_NOTICE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/LEGAL_NOTICE.txt -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/VBM3D.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/VBM3D.m -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr.mexa64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr.mexglx -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr.mexmaci: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr.mexmaci -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr.mexmaci64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_color.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_color.mexa64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_color.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_color.mexglx -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_color.mexmaci: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_color.mexmaci -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_color.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_color.mexmaci64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_color.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_color.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_color.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_color.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_colored_noise.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_colored_noise.mexa64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_colored_noise.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_colored_noise.mexglx -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_colored_noise.mexmaci: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_colored_noise.mexmaci -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_colored_noise.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_colored_noise.mexmaci64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_colored_noise.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_colored_noise.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_colored_noise.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_colored_noise.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_sharpen_var.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_sharpen_var.mexa64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_sharpen_var.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_sharpen_var.mexglx -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_sharpen_var.mexmaci: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_sharpen_var.mexmaci -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_sharpen_var.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_sharpen_var.mexmaci64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_sharpen_var.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_sharpen_var.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_sharpen_var.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_sharpen_var.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_video.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_video.mexa64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_video.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_video.mexglx -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_video.mexmaci: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_video.mexmaci -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_video.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_video.mexmaci64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_video.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_video.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_video.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_video.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_video_c.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_video_c.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_thr_video_c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_thr_video_c.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener.mexa64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener.mexglx -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener.mexmaci: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener.mexmaci -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener.mexmaci64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_color.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_color.mexa64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_color.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_color.mexglx -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_color.mexmaci: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_color.mexmaci -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_color.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_color.mexmaci64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_color.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_color.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_color.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_color.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_colored_noise.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_colored_noise.mexa64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_colored_noise.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_colored_noise.mexglx -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_colored_noise.mexmaci: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_colored_noise.mexmaci -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_colored_noise.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_colored_noise.mexmaci64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_colored_noise.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_colored_noise.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_colored_noise.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_colored_noise.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_video.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_video.mexa64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_video.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_video.mexglx -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_video.mexmaci: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_video.mexmaci -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_video.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_video.mexmaci64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_video.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_video.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_video.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_video.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_video_c.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_video_c.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/BM3D/bm3d_wiener_video_c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM3D/bm3d_wiener_video_c.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/SheppLogan3D.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM4D/SheppLogan3D.mat -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/bm4d_thr_mex.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM4D/bm4d_thr_mex.mexa64 -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/bm4d_thr_mex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM4D/bm4d_thr_mex.mexmaci64 -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/bm4d_thr_mex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM4D/bm4d_thr_mex.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/bm4d_thr_rice_mex.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM4D/bm4d_thr_rice_mex.mexa64 -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/bm4d_thr_rice_mex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM4D/bm4d_thr_rice_mex.mexmaci64 -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/bm4d_thr_rice_mex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM4D/bm4d_thr_rice_mex.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/bm4d_wie_mex.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM4D/bm4d_wie_mex.mexa64 -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/bm4d_wie_mex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM4D/bm4d_wie_mex.mexmaci64 -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/bm4d_wie_mex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM4D/bm4d_wie_mex.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/bm4d_wie_rice_mex.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM4D/bm4d_wie_rice_mex.mexa64 -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/bm4d_wie_rice_mex.mexmaci64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM4D/bm4d_wie_rice_mex.mexmaci64 -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/bm4d_wie_rice_mex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM4D/bm4d_wie_rice_mex.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/constantsSparseTraj3D.m: -------------------------------------------------------------------------------- 1 | 2 | % constants 3 | RADIAL = 1; 4 | SPIRAL = 2; 5 | LOG_SPIRAL = 3; 6 | LIM_ANGLE = 4; 7 | SPHERICAL = 5; 8 | COMPLETE = 6; 9 | RAND_LINES = 7; 10 | RAND_PTS = 8; 11 | LOW_PASS = 9; 12 | HELICAL = 10; 13 | TRAJ = {'RADIAL', 'SPIRAL', 'LOG_SPIRAL', 'LIM_ANGLE', 'SPHERICAL', 'COMPLETE'}; 14 | 15 | BRAINWEB = 1; 16 | SHEPPLOGAN = 2; 17 | DATA = {'BRAINWEB','SHEPP-LOGAN'}; 18 | 19 | REAL = 1; 20 | COMPLEX = 2; 21 | OBS = {'REAL','COMPLEX'}; 22 | 23 | NONE = 0; 24 | TEXT = 1; 25 | IMAGE = 2; 26 | -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/dct3.m: -------------------------------------------------------------------------------- 1 | function [ out ] = dct3( in ) 2 | % assuming input to be a 3-D volume of size NxMxP 3 | 4 | M1 = dctmtx(size(in,1)); 5 | M2 = dctmtx(size(in,2)); 6 | M3 = dctmtx(size(in,3)); 7 | 8 | out = zeros(size(in)); 9 | for i=1:size(in,3) 10 | out(:,:,i) = M1 * in(:,:,i) * M2'; 11 | end 12 | 13 | for i=1:size(in,1) 14 | for j=1:size(in,2) 15 | out(i,j,:) = squeeze(out(i,j,:))' * M3'; 16 | end 17 | end 18 | 19 | end 20 | -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/idct3.m: -------------------------------------------------------------------------------- 1 | function [ out ] = idct3( in ) 2 | % assuming input to be a 3-D volume of size NxMxP 3 | 4 | M1 = dctmtx(size(in,1)); 5 | M2 = dctmtx(size(in,2)); 6 | M3 = dctmtx(size(in,3)); 7 | 8 | out = zeros(size(in)); 9 | for i=1:size(in,3) 10 | out(:,:,i) = M1' * in(:,:,i) * M2; 11 | end 12 | 13 | for i=1:size(in,1) 14 | for j=1:size(in,2) 15 | out(i,j,:) = squeeze(out(i,j,:))' * M3; 16 | end 17 | end 18 | 19 | end 20 | -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/imsfft2.m: -------------------------------------------------------------------------------- 1 | function [ phantom ] = imsfft2( theta ) 2 | phantom = zeros(size(theta)); 3 | for i=1:size(theta,3) 4 | phantom(:,:,i) = ifft2(theta(:,:,i)); 5 | end 6 | end 7 | -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/msfft2.m: -------------------------------------------------------------------------------- 1 | function [ theta ] = msfft2( phantom ) 2 | theta = zeros(size(phantom)); 3 | for i=1:size(phantom,3) 4 | theta(:,:,i) = fft2(phantom(:,:,i)); 5 | end 6 | end 7 | 8 | -------------------------------------------------------------------------------- /lib/compete_methods/BM4D/t1_icbm_normal_1mm_pn0_rf0.rawb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/BM4D/t1_icbm_normal_1mm_pn0_rf0.rawb -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/Model/Sigma=10_net.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/HSI-DeNet1/Model/Sigma=10_net.mat -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/Model/Sigma=20_net.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/HSI-DeNet1/Model/Sigma=20_net.mat -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/backward.m: -------------------------------------------------------------------------------- 1 | function backward(obj, derOutputs) 2 | 3 | obj.holdOn = 0; 4 | 5 | % set output derivatives 6 | derOutputsNames = derOutputs(1:2:end); 7 | v = obj.getVarIndex(derOutputsNames) ; 8 | if isnan(v) 9 | error('Invalid `derOutputs`, variables {%s} do not exist in the network.', ... 10 | strjoin(derOutputsNames(isnan(v)), ', ')); 11 | end 12 | [obj.vars(v).der] = deal(derOutputs{2:2:end}) ; 13 | derOutputs = [] ; 14 | 15 | obj.numPendingVarRefs = zeros(1, numel(obj.vars)) ; 16 | obj.numPendingParamRefs = zeros(1, numel(obj.params)) ; 17 | for l = fliplr(obj.executionOrder) 18 | 19 | time = tic ; 20 | obj.layers(l).block.backwardAdvanced(obj.layers(l)) ; 21 | obj.layers(l).backwardTime = toc(time) ; 22 | 23 | end 24 | 25 | 26 | end 27 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/get_data.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/HSI-DeNet1/get_data.m -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/main_start_ms.m: -------------------------------------------------------------------------------- 1 | 2 | addpath(genpath('src\')); 3 | opts.idx_gpus = 1; % 0: cpu 1: gpu 4 | 5 | %% 1) Train dcgan 6 | opts.train.matconvnet_path = 'D:\matlab\bin\matconvnet-1.0-beta25\matlab\vl_setupnn.m'; 7 | opts.train.idx_gpus = opts.idx_gpus; 8 | 9 | get_train_initial_HSI(opts.train) 10 | fprintf('Train .... Done \n') 11 | 12 | 13 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 14 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 15 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/+solver/adam.m: -------------------------------------------------------------------------------- 1 | function [w, state] = adam(w, state, grad, opts, lr) 2 | %ADAM 3 | % Example Adam. 4 | % Copyright (C) 2016 Sung-Ho Bae 5 | % All rights reserved. 6 | % 7 | % This file is part of the VLFeat library and is made available under 8 | % the terms of the BSD license (see the COPYING file). 9 | 10 | if nargin == 0 % Return the default solver options 11 | w = struct('beta1', 0.5, 'beta2', 0.999, 'epsilon', 1e-8); 12 | return; 13 | end 14 | 15 | 16 | if isempty(state) 17 | state.m = single(0); 18 | state.v = single(0); 19 | state.t = single(0); 20 | end 21 | 22 | beta1 = opts.beta1; 23 | beta2 = opts.beta2; 24 | epsilon = opts.epsilon ; 25 | 26 | grad = gather(grad); 27 | 28 | state.m = beta1.*state.m +(1-beta1).*grad; 29 | state.v = beta2.*state.v +(1-beta2).*grad.*grad; 30 | state.t = state.t + 1; 31 | 32 | m_hat = state.m./(1-beta1.^state.t); 33 | v_hat = state.v./(1-beta2.^state.t); 34 | 35 | w = w -lr.*m_hat./( sqrt(v_hat)+epsilon); 36 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/PBlending.m: -------------------------------------------------------------------------------- 1 | function Y = PBlending(source, target, mask) 2 | 3 | for i=1:size(mask,3) 4 | tmask = mask(:,:,i); 5 | mask(:,:,i) = bwmorph(tmask,'thin'); 6 | end 7 | 8 | [Lh, Lv] = imgrad(target); 9 | [Gh, Gv] = imgrad(source); 10 | 11 | X = target; 12 | 13 | Fh = Lh; 14 | Fv = Lv; 15 | 16 | for i=1:size(mask,1) 17 | for j=1:size(mask,2) 18 | if(mask(i,j,1)==1) 19 | X(i,j,:) = source(i,j,:); 20 | Fh(i,j,:) = Gh(i,j,:); 21 | Fv(i,j,:) = Gv(i,j,:); 22 | end 23 | end 24 | end 25 | 26 | Y = PoissonJacobi(X, Fh, Fv, mask); -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/cnn_train_dag_weightedL2.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/HSI-DeNet1/src/cnn_train_dag_weightedL2.m -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/get_BN_dag.m: -------------------------------------------------------------------------------- 1 | function [ net ] = get_BN_dag(net, i, input, output, param) 2 | %GET_CONV_DAG Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | net.addLayer(sprintf('bn%d',i), dagnn.BatchNorm('numChannels', param.depth, 'epsilon', param.epsilon), input, output,{sprintf('g%d',i), sprintf('b%d',i), sprintf('m%d',i)}); 6 | 7 | return; -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/get_Block_CBR.m: -------------------------------------------------------------------------------- 1 | function [net, i] = get_Block_CBR( net, i, f_in, f_out, k, d, s, relu_param) 2 | %GET_BLOCK_CBR Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | conv_param = struct('f', [k k f_in f_out], 'pad', 1, 'dilated', d, 'stride', s, 'bias', false); 6 | % conv_param = struct('f', [k k f_in f_out], 'pad', 1, 'dilated', d, 'stride', s, 'bias', true); 7 | bn_param = struct('depth', f_out, 'epsilon', 1e-5); 8 | 9 | i = i+1; net = get_Conv_dag(net, i, sprintf('x%d',i-1), sprintf('x%d',i), conv_param); 10 | i = i+1; net.addLayer(sprintf('bn%d',i), dagnn.BatchNorm('numChannels', bn_param.depth, 'epsilon', bn_param.epsilon), sprintf('x%d',i-1), sprintf('x%d',i),{sprintf('g%d',i), sprintf('b%d',i), sprintf('m%d',i)}); 11 | i = i+1; net = get_ReLU_dag( net, i, sprintf('x%d',i-1), sprintf('x%d',i), relu_param); 12 | 13 | end 14 | 15 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/get_Block_DCBR.m: -------------------------------------------------------------------------------- 1 | function [net, i] = get_Block_DCBR( net, i, f_in, f_out, p, s, relu_param) 2 | %GET_BLOCK_CBR Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | conv_param = struct('f', [4 4 f_in f_out], 'pad', p,'stride', s, 'bias', false); 6 | bn_param = struct('depth', f_out, 'epsilon', 1e-5); 7 | 8 | i = i+1; net = get_DecConv_dag(net, i, sprintf('x%d',i-1), sprintf('x%d',i), conv_param); 9 | i = i+1; net.addLayer(sprintf('bn%d',i), dagnn.BatchNorm('numChannels', bn_param.depth, 'epsilon', bn_param.epsilon), sprintf('x%d',i-1), sprintf('x%d',i),{sprintf('g%d',i), sprintf('b%d',i), sprintf('m%d',i)}); 10 | i = i+1; net = get_ReLU_dag( net, i, sprintf('x%d',i-1), sprintf('x%d',i), relu_param); 11 | 12 | end 13 | 14 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/get_Bnorm_dag.m: -------------------------------------------------------------------------------- 1 | function net = get_Bnorm_dag(net, i, nCh, input, output ) 2 | %GET_BNORM_DAG Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | net.addLayer(sprintf('bn%d',i), dagnn.BatchNorm('numChannels',nCh), input, output,{sprintf('g%d',i), sprintf('b%d',i), sprintf('m%d',i)}); 6 | pidx = net.getParamIndex({sprintf('g%d',i), sprintf('b%d',i), sprintf('m%d',i)}); 7 | net.params(pidx(1)).weightDecay = 0; 8 | net.params(pidx(2)).weightDecay = 0; 9 | net.params(pidx(3)).learningRate = 0.1; 10 | net.params(pidx(3)).trainMethod = 'average'; 11 | 12 | end 13 | 14 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/get_Concat_dag.m: -------------------------------------------------------------------------------- 1 | function [ net ] = get_Concat_dag(net, i, input, output) 2 | %GET_DECCONV_DAG Summary of this function goes here 3 | % Detailed explanation goes here 4 | net.addLayer(sprintf('concat%d',i), dagnn.Concat(),input, output); 5 | 6 | end 7 | 8 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/get_Conv_dag.m: -------------------------------------------------------------------------------- 1 | function [ net ] = get_Conv_dag(net, i, input, output, param) 2 | %GET_CONV_DAG Summary of this function goes here 3 | % Detailed explanation goes here 4 | f = param.f; 5 | pad = param.pad; 6 | stride = param.stride; 7 | bias = param.bias; 8 | 9 | % padUpDown = (f(1)-1)/2; 10 | % padLeftRight = (f(2)-1)/2; 11 | if( bias == true) 12 | net.addLayer(sprintf('conv%d',i), dagnn.Conv('size',f, 'pad',pad, 'stride',stride, 'hasBias',bias), input, output, {sprintf('w%d',i),sprintf('b%d',i)}); 13 | else 14 | net.addLayer(sprintf('conv%d',i), dagnn.Conv('size',f, 'pad',pad,'stride',stride, 'hasBias',bias), input, output, {sprintf('w%d',i)}); 15 | end 16 | 17 | % pidx = net.getParamIndex({sprintf('w%d',i),sprintf('b%d',i)}); 18 | % net.params(pidx(1)).trainMethod = 'adam'; 19 | % net.params(pidx(2)).trainMethod = 'adam'; 20 | 21 | return; -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/get_DecConv_dag.m: -------------------------------------------------------------------------------- 1 | function [ net ] = get_DecConv_dag(net, i, input, output, param) 2 | %GET_DECCONV_DAG Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | f = param.f; 6 | f(3) = param.f(4); 7 | f(4) = param.f(3); 8 | 9 | pad = param.pad; 10 | stride = param.stride; 11 | bias = param.bias; 12 | if bias == true 13 | net.addLayer(sprintf('deconv%d',i), dagnn.ConvTranspose('size',f, 'upsample',stride, 'crop',pad, 'hasBias', bias),input, output, {sprintf('w%d',i),sprintf('b%d',i)}); 14 | else 15 | net.addLayer(sprintf('deconv%d',i), dagnn.ConvTranspose('size',f, 'upsample',stride, 'crop',pad, 'hasBias', bias),input, output, {sprintf('w%d',i)}); 16 | end 17 | 18 | 19 | end 20 | 21 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/get_ReLU_dag.m: -------------------------------------------------------------------------------- 1 | function [ net ] = get_ReLU_dag(net, i, input, output, param) 2 | %GET_RELU Summary of this function goes here 3 | % Detailed explanation goes here 4 | net.addLayer(sprintf('Relu%d',i), dagnn.ReLU('leak', param), input, output); 5 | 6 | end 7 | 8 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/get_Sigmoid_dag.m: -------------------------------------------------------------------------------- 1 | function [ net ] = get_Sigmoid_dag(net, i, input, output) 2 | %GET_RELU Summary of this function goes here 3 | % Detailed explanation goes here 4 | net.addLayer(sprintf('Sigmoid%d',i), dagnn.Sigmoid, input, output); 5 | 6 | end -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/get_Sum_dag.m: -------------------------------------------------------------------------------- 1 | function [ net ] = get_Sum_dag(net, i, input, output) 2 | %GET_DECCONV_DAG Summary of this function goes here 3 | % Detailed explanation goes here 4 | net.addLayer(sprintf('concat%d',i), dagnn.Sum(),input, output); 5 | 6 | end 7 | 8 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/image_adjust.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/HSI-DeNet1/src/image_adjust.m -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/matlab/+dagnn/@DagNN/backward.m: -------------------------------------------------------------------------------- 1 | function backward(obj, derOutputs) 2 | 3 | obj.holdOn = 0; 4 | 5 | % set output derivatives 6 | derOutputsNames = derOutputs(1:2:end); 7 | v = obj.getVarIndex(derOutputsNames) ; 8 | if isnan(v) 9 | error('Invalid `derOutputs`, variables {%s} do not exist in the network.', ... 10 | strjoin(derOutputsNames(isnan(v)), ', ')); 11 | end 12 | [obj.vars(v).der] = deal(derOutputs{2:2:end}) ; 13 | derOutputs = [] ; 14 | 15 | obj.numPendingVarRefs = zeros(1, numel(obj.vars)) ; 16 | obj.numPendingParamRefs = zeros(1, numel(obj.params)) ; 17 | for l = fliplr(obj.executionOrder) 18 | 19 | time = tic ; 20 | obj.layers(l).block.backwardAdvanced(obj.layers(l)) ; 21 | obj.layers(l).backwardTime = toc(time) ; 22 | 23 | end 24 | 25 | 26 | end 27 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/matlab/+dagnn/@DagNN/forward.m: -------------------------------------------------------------------------------- 1 | function forward(obj, inputs) 2 | 3 | obj.computingDerivative = 1; 4 | 5 | if ~iscell(inputs), error('INPUTS is not a cell array.') ; end 6 | 7 | % ------------------------------------------------------------------------- 8 | % Forward pass 9 | % ------------------------------------------------------------------------- 10 | 11 | % set the input values 12 | v = obj.getVarIndex(inputs(1:2:end)) ; 13 | if any(isnan(v)) 14 | broken = find(isnan(v)) ; 15 | error('No variable of name ''%s'' could be found in the DAG.', inputs{2*broken(1)-1}) ; 16 | end 17 | [obj.vars(v).value] = deal(inputs{2:2:end}) ; 18 | inputs = [] ; 19 | 20 | obj.numPendingVarRefs = [obj.vars.fanout] ; 21 | % obj.numPendingVarRefs(end-2:end) = 0; 22 | % obj.numPendingVarRefs(end) = 0; 23 | 24 | for l = obj.executionOrder 25 | time = tic ; 26 | obj.layers(l).block.forwardAdvanced(obj.layers(l)) ; 27 | obj.layers(l).forwardTime = toc(time) ; 28 | end 29 | 30 | end 31 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/matlab/+dagnn/Tanh.m: -------------------------------------------------------------------------------- 1 | classdef Tanh < dagnn.ElementWise 2 | methods 3 | function outputs = forward(obj, inputs, params) 4 | expPlusPart = exp(2*inputs{1}); 5 | outputs{1} = (expPlusPart-1)./(expPlusPart+1); 6 | end 7 | 8 | function [derInputs, derParams] = backward(obj, inputs, params, derOutputs) 9 | expPlusPart = exp(2*inputs{1}); 10 | expMinusPart = exp(-2*inputs{1}); 11 | derInputs{1} = derOutputs{1}.*4./(expPlusPart+expMinusPart+2); 12 | derParams = {} ; 13 | end 14 | end 15 | end 16 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/modcrop.m: -------------------------------------------------------------------------------- 1 | function imgs = modcrop(imgs, modulo) 2 | if size(imgs,3)==1 3 | sz = size(imgs); 4 | sz = sz - mod(sz, modulo); 5 | imgs = imgs(1:sz(1), 1:sz(2)); 6 | else 7 | tmpsz = size(imgs); 8 | sz = tmpsz(1:2); 9 | sz = sz - mod(sz, modulo); 10 | imgs = imgs(1:sz(1), 1:sz(2),:); 11 | end 12 | 13 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/utilities/ErrRelGlobAdimSyn.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/HSI-DeNet1/src/utilities/ErrRelGlobAdimSyn.m -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/utilities/csnr.m: -------------------------------------------------------------------------------- 1 | function s=csnr(A,B,row,col) 2 | 3 | [n,m,ch]=size(A); 4 | summa = 0; 5 | if ch==1 6 | e=A-B; 7 | e=e(row+1:n-row,col+1:m-col); 8 | me=mean(mean(e.^2)); 9 | s=10*log10(255^2/me); 10 | else 11 | for i=1:ch 12 | e=A-B; 13 | e=e(row+1:n-row,col+1:m-col,i); 14 | mse = mean(mean(e.^2)); 15 | s = 10*log10(255^2/mse); 16 | summa = summa + s; 17 | end 18 | s = summa/ch; 19 | end 20 | 21 | 22 | return; -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/utilities/modcrop.m: -------------------------------------------------------------------------------- 1 | function imgs = modcrop(imgs, modulo) 2 | if size(imgs,3)==1 3 | sz = size(imgs); 4 | sz = sz - mod(sz, modulo); 5 | imgs = imgs(1:sz(1), 1:sz(2)); 6 | else 7 | tmpsz = size(imgs); 8 | sz = tmpsz(1:2); 9 | sz = sz - mod(sz, modulo); 10 | imgs = imgs(1:sz(1), 1:sz(2),:); 11 | end 12 | 13 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/utilities/normalized.m: -------------------------------------------------------------------------------- 1 | function Y = normalized(X) 2 | maxX = max(X(:)); 3 | minX = min(X(:)); 4 | Y = (X-minX)/(maxX-minX); 5 | end -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/utilities/shave.m: -------------------------------------------------------------------------------- 1 | function I = shave(I, border) 2 | I = I(1+border(1):end-border(1), ... 3 | 1+border(2):end-border(2), :, :); 4 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/writeBMP.m: -------------------------------------------------------------------------------- 1 | function [ ] = writeBMP(filePath, singleIm1 ) 2 | %WRITEGIF Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | singleIm1(singleIm1<0) = 0; 6 | singleIm1(singleIm1>1) = 1; 7 | im1 = uint8(255*singleIm1); 8 | 9 | imwrite(im1,filePath); 10 | 11 | 12 | return; 13 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/src/writeGIF.m: -------------------------------------------------------------------------------- 1 | function [ ] = writeGIF(filePath, singleIm1, singleIm2, delayTime ) 2 | %WRITEGIF Summary of this function goes here 3 | % Detailed explanation goes here 4 | % h = [0 -1 0; -1 4 -1; 0 -1 0]; 5 | % singleIm1 = Laplacian_u(singleIm1, h); 6 | % singleIm1 = singleIm1 + 0.5; 7 | 8 | singleIm1 = gather(singleIm1); 9 | singleIm2 = gather(singleIm2); 10 | 11 | singleIm1(singleIm1<0) = 0; 12 | singleIm1(singleIm1>1) = 1; 13 | im1 = uint8(255*singleIm1); 14 | 15 | 16 | 17 | [A,map] = rgb2ind(im1,256); 18 | imwrite(A,map,filePath,'gif','LoopCount',Inf,'DelayTime',delayTime); 19 | 20 | % singleIm2 = singleIm2 + 0.5; 21 | singleIm2(singleIm2<0) = 0; 22 | singleIm2(singleIm2>1) = 1; 23 | im2 = uint8(255*singleIm2); 24 | 25 | 26 | [A,map] = rgb2ind(im2,256); 27 | imwrite(A,map,filePath, 'gif', 'WriteMode', 'append', 'DelayTime',delayTime); 28 | 29 | 30 | return; 31 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/utilities/ErrRelGlobAdimSyn.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/HSI-DeNet1/utilities/ErrRelGlobAdimSyn.m -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/utilities/MSIQA.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/HSI-DeNet1/utilities/MSIQA.m -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/utilities/PSNR3D.m: -------------------------------------------------------------------------------- 1 | function [psnr] = PSNR3D(imagery1,imagery2) 2 | [m, n, k] = size(imagery1); 3 | [mm, nn, kk] = size(imagery2); 4 | m = min(m, mm); 5 | n = min(n, nn); 6 | k = min(k, kk); 7 | imagery1 = imagery1(1:m, 1:n, 1:k); 8 | imagery2 = imagery2(1:m, 1:n, 1:k); 9 | psnr = 0; 10 | for i = 1:k 11 | psnr = psnr + 10*log10(255^2/mse(imagery1(:, :, i) - imagery2(:, :, i))); 12 | end 13 | psnr = psnr/k; 14 | end -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/utilities/modcrop.m: -------------------------------------------------------------------------------- 1 | function imgs = modcrop(imgs, modulo) 2 | if size(imgs,3)==1 3 | sz = size(imgs); 4 | sz = sz - mod(sz, modulo); 5 | imgs = imgs(1:sz(1), 1:sz(2)); 6 | else 7 | tmpsz = size(imgs); 8 | sz = tmpsz(1:2); 9 | sz = sz - mod(sz, modulo); 10 | imgs = imgs(1:sz(1), 1:sz(2),:); 11 | end 12 | 13 | -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/utilities/normalized.m: -------------------------------------------------------------------------------- 1 | function Y = normalized(X) 2 | maxX = max(X(:)); 3 | minX = min(X(:)); 4 | Y = (X-minX)/(maxX-minX); 5 | end -------------------------------------------------------------------------------- /lib/compete_methods/HSI-DeNet1/utilities/shave.m: -------------------------------------------------------------------------------- 1 | function I = shave(I, border) 2 | I = I(1+border(1):end-border(1), ... 3 | 1+border(2):end-border(2), :, :); 4 | -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/Block_matching3D.m: -------------------------------------------------------------------------------- 1 | function [Init_Index] = Block_matching3D(V_pat, par, Neighbor_arr,Num_arr,SelfIndex_arr) 2 | % Block matching for full band patches; 3 | L = length(Num_arr); 4 | Init_Index = zeros(par.patnum,L); 5 | sizeV = size(V_pat); 6 | for i = 1 : L 7 | Patch = V_pat(:,:,SelfIndex_arr(i)); 8 | Patch = Patch(:); 9 | Neighbors = Unfold(V_pat(:,:,Neighbor_arr(1:Num_arr(i),i)),[sizeV(1:2),Num_arr(i)],3)'; 10 | Dist = sum((repmat(Patch,1,Num_arr(i))-Neighbors).^2); 11 | [~, index] = sort(Dist); 12 | Init_Index(:,i) =Neighbor_arr(index(1:par.patnum),i); 13 | end 14 | -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/ClosedS.m: -------------------------------------------------------------------------------- 1 | function [SigmaNew, n] = ClosedS(Sigma, tau) 2 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3 | % min: 1/2*||Z-X||^2 + ||X||_tr 4 | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | 6 | % [S, V, D, Sigma2] = MySVDtau(Z, tau); 7 | % V = max(diag(V) - tau, 0); 8 | % n = sum(V > 0); 9 | % X = S(:, 1:n) * diag(V(1:n)) * D(:, 1:n)'; 10 | 11 | 12 | % [SigmaNew,n] = ClosedWNNM(Sigma,tau,tol); 13 | 14 | temp = (Sigma-eps).^2-4*(tau-eps*Sigma); 15 | 16 | ind = temp>0; 17 | n = sum(ind(:)); 18 | % absY = absY.*ind; 19 | SigmaNew = (Sigma-eps+sqrt(temp))/2.*ind; 20 | % return;(absY-oureps+sqrt(temp))/2.*ind; 21 | % else 22 | % [X, n, SigmaNew, wNorm] = Pro2WNNM(Z', tau); 23 | % X = X'; 24 | % return; 25 | end 26 | 27 | -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/ClosedWL1.m: -------------------------------------------------------------------------------- 1 | function X=ClosedWL1(Y,C,oureps) 2 | % solving the following problem 3 | % sum(log(SigmaY+oureps))+1/2*||Y-X||_F^2 4 | % where oureps is a small constant 5 | absY = abs(Y); 6 | signY = sign(Y); 7 | temp = (absY-oureps).^2-4*(C-oureps*absY); 8 | ind = temp>0; 9 | % svp = sum(ind(:)); 10 | % absY = absY.*ind; 11 | absY = (absY-oureps+sqrt(temp))/2.*ind; 12 | X = absY.*signY; 13 | end -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/ClosedWNNM.m: -------------------------------------------------------------------------------- 1 | function [SigmaX,svp]=ClosedWNNM(SigmaY,C,oureps) 2 | % solving the following problem 3 | % sum(log(SigmaY+oureps))+1/2*||Y-X||_F^2 4 | % where oureps is a small constant 5 | 6 | temp = (SigmaY-oureps).^2-4*(C-oureps*SigmaY); 7 | ind = find (temp>0); 8 | svp = length(ind); 9 | SigmaX = max(SigmaY(ind)-oureps+sqrt(temp(ind)),0)/2; 10 | end -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/Im2Patch3D.m: -------------------------------------------------------------------------------- 1 | 2 | function [Y] = Im2Patch3D( Video, par) 3 | % get full band patches 4 | patsize = par.patsize; 5 | if isfield(par,'Pstep') 6 | step = par.Pstep; 7 | else 8 | step = 1; 9 | end 10 | TotalPatNum = (floor((size(Video,1)-patsize)/step)+1)*(floor((size(Video,2)-patsize)/step)+1); %Total Patch Number in the image 11 | Y = zeros(patsize*patsize, size(Video,3), TotalPatNum); %Patches in the original noisy image 12 | k = 0; 13 | 14 | for i = 1:patsize 15 | for j = 1:patsize 16 | k = k+1; 17 | tempPatch = Video(i:step:end-patsize+i,j:step:end-patsize+j,:); 18 | Y(k,:,:) = Unfold(tempPatch, size(tempPatch), 3); 19 | end 20 | end %Estimated Local Noise Level -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/my_tensor_toolbox/CreateImageSeq.m: -------------------------------------------------------------------------------- 1 | function CreateImageSeq(inData, filePath, format) 2 | [height, width, layer] = size(inData{1}); 3 | for n = 1:layer 4 | Img(:,:,1) = inData{1}(:,:,n); 5 | Img(:,:,2) = inData{2}(:,:,n); 6 | Img(:,:,3) = inData{3}(:,:,n); 7 | fileName = [filePath, int2str(n), format]; 8 | imwrite(Img, fileName); 9 | end -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/my_tensor_toolbox/CreateMovie.m: -------------------------------------------------------------------------------- 1 | function CreateMovie(T, fileName) 2 | [height, width, layer] = size(T{1}); 3 | aviobj = avifile(fileName, 'fps', 30, 'compression', 'None'); 4 | for i = 1:layer 5 | img(:,:,1) = T{1}(:,:,i); 6 | img(:,:,2) = T{2}(:,:,i); 7 | img(:,:,3) = T{3}(:,:,i); 8 | aviobj = addframe(aviobj, img); 9 | end 10 | aviobj = close(aviobj); 11 | -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/my_tensor_toolbox/Fold.m: -------------------------------------------------------------------------------- 1 | function [X] = Fold(X, dim, i) 2 | dim = circshift(dim, [1-i, 1-i]); 3 | X = shiftdim(reshape(X, dim), length(dim)+1-i); -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/my_tensor_toolbox/ImgSeq2Video.m: -------------------------------------------------------------------------------- 1 | function ImgSeq2Video(preFileName, formatFile, nS, nE, isColor) 2 | % transform the image sequence into the .mat format 3 | if isColor == 0 4 | for i = nS:nE 5 | fileName = [preFileName, int2str(i), formatFile]; 6 | data(:,:,i-nS+1) = double(imread(fileName)); 7 | end 8 | save(['preFileName', 'gray.mat'], 'data'); 9 | end 10 | 11 | if isColor == 1 12 | for i = nS:nE 13 | fileName = [preFileName, int2str(i), formatFile]; 14 | I = double(imread(fileName)); 15 | dataR(:,:,i-nS+1) = I(:,:,1); 16 | dataG(:,:,i-nS+1) = I(:,:,2); 17 | dataB(:,:,i-nS+1) = I(:,:,3); 18 | end 19 | save([preFileName, 'R.mat'], 'dataR'); 20 | save([preFileName, 'G.mat'], 'dataG'); 21 | save([preFileName, 'B.mat'], 'dataB'); 22 | end -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/my_tensor_toolbox/MySVD.m: -------------------------------------------------------------------------------- 1 | function [S, V, D, Sigma2] = MySVD(A) 2 | [m, n] = size(A); 3 | if 2*m < n 4 | AAT = A*A'; 5 | [S, Sigma2, D] = svd(AAT); 6 | Sigma2 = diag(Sigma2); 7 | V = sqrt(Sigma2); 8 | tol = max(size(A)) * eps(max(V)); 9 | R = sum(V > tol); 10 | V = V(1:R); 11 | S = S(:,1:R); 12 | D = A'*S*diag(1./V); 13 | V = diag(V); 14 | return; 15 | end 16 | if m > 2*n 17 | [S, V, D, Sigma2] = MySVD(A'); 18 | mid = D; 19 | D = S; 20 | S = mid; 21 | return; 22 | end 23 | [S,V,D] = svd(A); 24 | Sigma2 = diag(V).^2; -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/my_tensor_toolbox/MySVDs.m: -------------------------------------------------------------------------------- 1 | function [S, V, D] = MySVDs(A, R) 2 | [m, n] = size(A); 3 | if 10*m < n 4 | AAT = A*A'; 5 | [S, V, D] = svd(AAT); 6 | V = diag(V) .^ 0.5; 7 | tol = max(size(A)) * eps(max(V)); 8 | R = min([R, sum(V > tol)]); 9 | V = V(1:R); 10 | S = S(:,1:R); 11 | D = A'*S*diag(1./V); 12 | V = diag(V); 13 | return; 14 | end 15 | if m > 10*n 16 | [S, V, D] = MySVD(A'); 17 | mid = D; 18 | D = S; 19 | S = mid; 20 | return; 21 | end 22 | [S,V,D] = svd(A); 23 | S = S(:, 1:R); 24 | V = V(1:R, 1:R); 25 | D = D(:, 1:R); -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/my_tensor_toolbox/MySVDtau.m: -------------------------------------------------------------------------------- 1 | function [S, V, D, Sigma2] = MySVDtau(A, tau) 2 | [m, n] = size(A); 3 | if 2*m < n 4 | AAT = A*A'; 5 | [S, Sigma2, D] = svd(AAT); 6 | Sigma2 = diag(Sigma2); 7 | V = sqrt(Sigma2); 8 | tol = max(size(A)) * eps(max(V)); 9 | R = sum(V > max(tol, tau)); 10 | V = V(1:R); 11 | S = S(:,1:R); 12 | D = A'*S*diag(1./V); 13 | V = diag(V); 14 | return; 15 | end 16 | if m > 2*n 17 | [S, V, D, Sigma2] = MySVDtau(A', tau); 18 | mid = D; 19 | D = S; 20 | S = mid; 21 | return; 22 | end 23 | [S,V,D] = svd(A); 24 | Sigma2 = diag(V).^2; 25 | R = sum(diag(V) > tau); 26 | S = S(:, 1:R); 27 | V = V(1:R, 1:R); 28 | D = D(:, 1:R); -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/my_tensor_toolbox/Pro2TraceNorm.m: -------------------------------------------------------------------------------- 1 | function [X, n, Sigma] = Pro2TraceNorm(Z, tau) 2 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 3 | % min: 1/2*||Z-X||^2 + ||X||_tr 4 | % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 5 | 6 | % [S, V, D, Sigma2] = MySVDtau(Z, tau); 7 | % V = max(diag(V) - tau, 0); 8 | % n = sum(V > 0); 9 | % X = S(:, 1:n) * diag(V(1:n)) * D(:, 1:n)'; 10 | 11 | %% new 12 | [m, n] = size(Z); 13 | if 2*m < n 14 | AAT = Z*Z'; 15 | [S, Sigma2, D] = svd(AAT); 16 | Sigma2 = diag(Sigma2); 17 | V = sqrt(Sigma2); 18 | Sigma = V; %return the singular values 19 | tol = max(size(Z)) * eps(max(V)); 20 | n = sum(V > max(tol, tau)); 21 | mid = max(V(1:n)-tau, 0) ./ V(1:n) ; 22 | X = S(:, 1:n) * diag(mid) * S(:, 1:n)' * Z; 23 | return; 24 | end 25 | if m > 2*n 26 | [X, n, Sigma] = Pro2TraceNorm(Z', tau); 27 | X = X'; 28 | return; 29 | end 30 | 31 | 32 | -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/my_tensor_toolbox/SingularValue.m: -------------------------------------------------------------------------------- 1 | function V = SingularValue(A) 2 | [m, n] = size(A); 3 | if 2*m < n 4 | AAT = A*A'; 5 | [S, V, D] = svd(AAT); 6 | V = sqrt(diag(V)); 7 | return; 8 | end 9 | if m > 2*n 10 | AAT = A'*A; 11 | [S, V, D] = svd(AAT); 12 | V = sqrt(diag(V)); 13 | return; 14 | end 15 | [S,V,D] = svd(A); 16 | V = diag(V); -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/my_tensor_toolbox/TensorTimes.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/KBRreg/my_tensor_toolbox/TensorTimes.m -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/my_tensor_toolbox/Truncate.m: -------------------------------------------------------------------------------- 1 | function [X, Sigma2] = Truncate(Z, tau) 2 | % [Y, n, Sigma2] = Pro2TraceNorm(Z, tau); 3 | % X = Z-Y; 4 | 5 | %% new 6 | [m, n] = size(Z); 7 | if 2*m < n 8 | AAT = Z*Z'; 9 | [S, Sigma2, D] = svd(AAT); 10 | Sigma2 = diag(Sigma2); 11 | V = sqrt(Sigma2); 12 | tol = max(size(Z)) * eps(max(V)); 13 | n = sum(V > max(tol, tau)); 14 | mid = max(V(1:n)-tau, 0) ./ V(1:n) ; 15 | X = (eye(m)-S(:, 1:n) * diag(mid) * S(:, 1:n)') * Z; 16 | return; 17 | end 18 | if m > 2*n 19 | [X, Sigma2] = Truncate(Z', tau); 20 | X = X'; 21 | return; 22 | end 23 | [S,V,D] = svd(Z, 0); 24 | Sigma2 = diag(V).^2; 25 | n = sum(diag(V) > tau); 26 | X = Z - S(:, 1:n) * diag(diag(V(1:n,1:n))-tau) * D(:, 1:n)'; -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/my_tensor_toolbox/Unfold.m: -------------------------------------------------------------------------------- 1 | function [X] = Unfold( X, dim, i ) 2 | X = reshape(shiftdim(X,i-1), dim(i), []); -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/my_tensor_toolbox/normalized.m: -------------------------------------------------------------------------------- 1 | function Y = normalized(X) 2 | maxX = max(X(:)); 3 | minX = min(X(:)); 4 | Y = (X-minX)/(maxX-minX); 5 | end -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/my_ttm.m: -------------------------------------------------------------------------------- 1 | function X = my_ttm(X,V,dims,sizeOld,sizeNew,Ndim) 2 | % tensor times matrix 3 | for n = dims(1:end) 4 | order = [n,1:n-1,n+1:Ndim]; 5 | temp = reshape(permute(X,order), sizeOld(n), []); 6 | temp = V{n}*temp; 7 | sizeOld(n) = sizeNew(n); 8 | X = ipermute(reshape(temp, [sizeOld(n),sizeOld(1:n-1),sizeOld(n+1:Ndim)]),order); 9 | end 10 | 11 | -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/normalized.m: -------------------------------------------------------------------------------- 1 | function Y = normalized(X) 2 | maxX = max(X(:)); 3 | minX = min(X(:)); 4 | Y = (X-minX)/(maxX-minX); 5 | end -------------------------------------------------------------------------------- /lib/compete_methods/KBRreg/tensorSVD.m: -------------------------------------------------------------------------------- 1 | 2 | function [Core, U] = tensorSVD(D,rank) 3 | % performing Higth order SVD 4 | dim = length(size(D)); 5 | sizeD = size(D); 6 | U = cell(dim,1); 7 | Core = D; 8 | if nargin<2 9 | rank = sizeD; 10 | end 11 | for i = 1:dim 12 | UnfoD = Unfold( double(D), sizeD, i); 13 | if size(UnfoD,1)0); 4 | svp=length(ind); 5 | SigmaX=max(SigmaY(ind)-oureps+sqrt(temp(ind)),0)/2; 6 | 7 | end -------------------------------------------------------------------------------- /lib/compete_methods/LLRT/NLPatEstimation.m: -------------------------------------------------------------------------------- 1 | function [ EPat, W ] = NLPatEstimation( NL_mat, Self_arr, Sigma_arr, CurPat, Par) 2 | EPat = zeros(size(CurPat)); 3 | W = zeros(size(CurPat)); 4 | for i = 1 : length(Self_arr) % For each keypatch group 5 | Temp = CurPat(:, NL_mat(1:Par.patnum,i)); % Non-local similar patches to the keypatch 6 | M_Temp = repmat(mean( Temp, 2 ),1,Par.patnum); 7 | Temp = Temp - M_Temp; 8 | E_Temp = WNNM(Temp, Par.c1, Sigma_arr(Self_arr(i))) + M_Temp; % WNNM Estimation 9 | EPat(:,NL_mat(1:Par.patnum,i)) = EPat(:,NL_mat(1:Par.patnum,i)) + E_Temp; 10 | W(:,NL_mat(1:Par.patnum,i)) = W(:,NL_mat(1:Par.patnum,i)) + ones(size(CurPat,1),size(NL_mat(1:Par.patnum,i),1)); 11 | end 12 | end 13 | 14 | -------------------------------------------------------------------------------- /lib/compete_methods/LLRT/Patch2Cub.m: -------------------------------------------------------------------------------- 1 | function [E_Img,W_Img] = Patch2Cub( ImPat, WPat, PatSize, ImageH, ImageW,ImageB ) 2 | TempR = ImageH-PatSize+1; 3 | TempC = ImageW-PatSize+1; 4 | TempOffsetR = 1:TempR; 5 | TempOffsetC = 1:TempC; 6 | 7 | E_Img = zeros(ImageH,ImageW,ImageB); 8 | W_Img = zeros(ImageH,ImageW,ImageB); 9 | k = 0; 10 | for o = 1:ImageB 11 | for i = 1:PatSize 12 | for j = 1:PatSize 13 | k = k+1; 14 | E_Img(TempOffsetR-1+i,TempOffsetC-1+j,o) = E_Img(TempOffsetR-1+i,TempOffsetC-1+j,o) + reshape( ImPat(k,:)', [TempR TempC]); 15 | W_Img(TempOffsetR-1+i,TempOffsetC-1+j,o) = W_Img(TempOffsetR-1+i,TempOffsetC-1+j,o) + reshape( WPat(k,:)', [TempR TempC]); 16 | end 17 | end 18 | end 19 | 20 | -------------------------------------------------------------------------------- /lib/compete_methods/LLRT/Proc_cls_idx.m: -------------------------------------------------------------------------------- 1 | function [s_idx, seg] = Proc_cls_idx( cls_idx ) 2 | 3 | [idx s_idx] = sort(cls_idx); 4 | 5 | idx2 = idx(1:end-1) - idx(2:end); 6 | seq = find(idx2); 7 | 8 | seg = [0; seq; length(cls_idx)]; -------------------------------------------------------------------------------- /lib/compete_methods/LLRT/WNNM.m: -------------------------------------------------------------------------------- 1 | 2 | function [X] = WNNM( Y, C, NSig) 3 | [U,SigmaY,V] = svd(full(Y),'econ'); 4 | PatNum = size(Y,2); 5 | TempC = C*sqrt(PatNum)*2*NSig^2; 6 | [SigmaX,svp] = ClosedWNNM(SigmaY,TempC,eps); 7 | X = U(:,1:svp)*diag(SigmaX)*V(:,1:svp)'; 8 | return; 9 | -------------------------------------------------------------------------------- /lib/compete_methods/LLRT/soft_L1_shrink.m: -------------------------------------------------------------------------------- 1 | function [dx] = soft_L1_shrink(dx,Thresh) 2 | %SHRINK2 Vectorial shrinkage (soft-threholding) 3 | % [dxnew,dynew] = SHRINK2(dx,dy,Thresh) 4 | 5 | s = abs( dx ); 6 | % s = max(s - Thresh,0)./max(1e-12,s); 7 | % dx = s.*dx; 8 | dx = max(s - Thresh,0).*sign(dx); 9 | -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/mex/CPU_search.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/MStSVD/mex/CPU_search.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/mex/GPU_search.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/MStSVD/mex/GPU_search.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/mex/MS_tSVD.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/MStSVD/mex/MS_tSVD.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/my_ttm2.m: -------------------------------------------------------------------------------- 1 | function [ A_U ] = my_ttm( A,U,n,tflag ) 2 | %MY_TTM Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | N = ndims(A); 6 | sz = size(A); 7 | order = [n,1:n-1,n+1:N]; 8 | % newdata = permute(A,order); 9 | % newdata = reshape(newdata,sz(n),prod(sz([1:n-1,n+1:N]))); 10 | newdata = my_tenmat(A,n); 11 | if tflag == 't' 12 | newdata = U'*newdata; 13 | p = size(U,2); 14 | else 15 | newdata = U*newdata; 16 | p = size(U,1); 17 | end 18 | 19 | newsz = [p,sz(1:n-1),sz(n+1:N)]; 20 | if(n == 1) 21 | A_U = reshape(newdata,[newsz 1 1]); 22 | else 23 | newdata = reshape(newdata,[newsz 1 1]); 24 | A_U = ipermute(newdata,order); 25 | end 26 | 27 | 28 | 29 | end 30 | 31 | -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/Wiener_NL_d_svd.m: -------------------------------------------------------------------------------- 1 | function [ U,C_A,C_B,V ] = Wiener_NL_d_svd(A,B,M) 2 | %t_hosvd compute the hosvd-like t_SVD 3 | % input A must be a cell 4-order tensor that contains N tensors, where N 4 | % represents the number of similar pictures. 5 | [~,~,D]=size(A(:,:,:,1));U = zeros(D,D,D);V = U; 6 | 7 | A = ffd(A,M);B = ffd(B,M); 8 | 9 | for k=1:D 10 | [U(:,:,k),V(:,:,k)]=tucker(A,k); 11 | end 12 | 13 | C_A = A; 14 | C_B = B; 15 | for k = 1:D 16 | Ak = A(:,:,k,:);Bk = B(:,:,k,:); 17 | Uk = U(:,:,k);Vk = V(:,:,k); 18 | CAk1 = my_ttm(Ak,Uk,1,'t');CAk2 = my_ttm(CAk1,Vk,2,'t'); 19 | CBk1 = my_ttm(Bk,Uk,1,'t');CBk2 = my_ttm(CBk1,Vk,2,'t'); 20 | C_A(:,:,k,:) = CAk2; C_B(:,:,k,:) = CBk2; 21 | end 22 | 23 | end 24 | 25 | 26 | function[U,V]=tucker(A,k) 27 | 28 | A_f = A(:,:,k,:); 29 | A1 = my_tenmat(A_f,1);[U,~] = eig(A1*A1'); 30 | A2 = my_tenmat(A_f,2);[V,~] = eig(A2*A2'); 31 | 32 | end -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/Wiener_NL_t_svd.m: -------------------------------------------------------------------------------- 1 | function [ U,C_A,C_B,V ] = Wiener_NL_t_svd(A,B) 2 | %t_hosvd compute the hosvd-like t_SVD 3 | % input A must be a cell 4-order tensor that contains N tensors, where N 4 | % represents the number of similar pictures. 5 | [~,~,D]=size(A(:,:,:,1));U = zeros(D,D,D);V = U; 6 | real_count = floor(D/2)+1; 7 | 8 | 9 | A_f = fft(A,[],3);A = A_f; 10 | B_f = fft(B,[],3);B = B_f; 11 | 12 | for k=1:real_count 13 | [U(:,:,k),V(:,:,k)]=tucker(A,k); 14 | end 15 | 16 | C_A = A; 17 | C_B = B; 18 | for k = 1:real_count 19 | Ak = A(:,:,k,:);Bk = B(:,:,k,:); 20 | Uk = U(:,:,k);Vk = V(:,:,k); 21 | CAk1 = my_ttm(Ak,Uk,1,'t');CAk2 = my_ttm(CAk1,Vk,2,'t'); 22 | CBk1 = my_ttm(Bk,Uk,1,'t');CBk2 = my_ttm(CBk1,Vk,2,'t'); 23 | C_A(:,:,k,:) = CAk2; C_B(:,:,k,:) = CBk2; 24 | end 25 | 26 | end 27 | 28 | 29 | function[U,V]=tucker(A,k) 30 | 31 | A_f = A(:,:,k,:); 32 | A1 = my_tenmat(A_f,1);[U,~] = eig(A1*A1'); 33 | A2 = my_tenmat(A_f,2);[V,~] = eig(A2*A2'); 34 | 35 | end -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/d_svd.m: -------------------------------------------------------------------------------- 1 | function [ U,S,V ] = d_svd( A ) 2 | 3 | [A_d] = L_D(A); 4 | 5 | for i = 1:D 6 | [U_d(:,:,i),S_d(:,:,i),V_d(:,:,i)] = svd(A_d(:,:,i)); 7 | end 8 | U = invL_D(U_d);S = invL_D(S_d);V = invL_D(V_d); 9 | end 10 | 11 | -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/fast_NL_d_svd.m: -------------------------------------------------------------------------------- 1 | function [ U,S,V ] = fast_NL_d_svd(A,M) 2 | %t_hosvd compute the hosvd-like t_SVD 3 | 4 | [~,~,D]=size(A(:,:,:,1)); 5 | A = ffd(A,M); 6 | for k=1:D 7 | [U(:,:,k),V(:,:,k)]=d_tucker(A,k); 8 | end 9 | 10 | S = A; 11 | for k = 1:D 12 | Ak = A(:,:,k,:);Uk = U(:,:,k);Vk = V(:,:,k); 13 | Sk1 = my_ttm(Ak,Uk,1,'t');Sk2 = my_ttm(Sk1,Vk,2,'t'); 14 | S(:,:,k,:) = Sk2; 15 | end 16 | 17 | 18 | end 19 | 20 | 21 | function[U,V]=d_tucker(A,k) 22 | 23 | A_d = A(:,:,k,:); 24 | A1 = my_tenmat(A_d,1);[U,~] = eig(A1*A1'); 25 | A2 = my_tenmat(A_d,2);[V,~] = eig(A2*A2'); 26 | 27 | end -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/fast_t_NLPCA.m: -------------------------------------------------------------------------------- 1 | function [ U,S,V ] = fast_t_NLPCA(A) 2 | %t_hosvd compute the hosvd-like t_SVD 3 | % input A must be a cell 4-order tensor that contains N tensors, where N 4 | % represents the number of similar pictures. 5 | [~,~,D]=size(A(:,:,:,1)); 6 | real_count = floor(D/2)+1; 7 | 8 | 9 | A_f = fft(A,[],3);A = A_f; 10 | 11 | for k=1:real_count 12 | [U(:,:,k),V(:,:,k)]=NL_PCA(A,k); 13 | end 14 | 15 | S = A; 16 | for k = 1:real_count 17 | Ak = A(:,:,k,:);Uk = U(:,:,k);Vk = V(:,:,k); 18 | S(:,:,k,:) = my_ttm2(Ak,Uk,Vk,'t'); 19 | end 20 | 21 | end 22 | 23 | 24 | function[U,V]=NL_PCA(A,k) 25 | 26 | Ak = A(:,:,k,:); 27 | Ak_mat = my_tenmat(Ak,ndims(Ak)); 28 | [U,~,V] = svd(Ak_mat); 29 | 30 | end -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/ffd.m: -------------------------------------------------------------------------------- 1 | function [ A_d ] = ffd( A,M ) 2 | %L_D Summary of this function goes here 3 | % Detailed explanation goes here 4 | % [~,~,D] = size(A); 5 | % C = dct(eye(D)); 6 | % Z = diag(ones(D-1,1),1); 7 | % one_D = ones(D); 8 | % I = diag(one_D(:,1)); 9 | % W = diag(C(:,1)); 10 | % M = inv(W)*C*(I+Z); 11 | % M = rand(4,4); 12 | 13 | A_d = my_ttm(A,M,3,'nt'); 14 | 15 | end 16 | 17 | -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/iffd.m: -------------------------------------------------------------------------------- 1 | function [ A ] = iffd(A_d,inv_M) 2 | %L_D Summary of this function goes here 3 | % Detailed explanation goes here 4 | % [~,~,D] = size(A_d); 5 | % C = dct(eye(D)); 6 | % Z = diag(ones(D-1,1),1); 7 | % one_D = ones(D); 8 | % I = diag(one_D(:,1)); 9 | % W = diag(C(:,1)); 10 | % M = inv(W)*C*(I+Z); 11 | 12 | A = my_ttm(A_d,inv_M,3,'nt'); 13 | 14 | end 15 | 16 | -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/mat_ten.m: -------------------------------------------------------------------------------- 1 | function [ A_t ] = mat_ten( A_mat,n,sz ) 2 | %MAT_TEN Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | N = numel(sz); 6 | order = [n,1:n-1,n+1:N]; 7 | newsz = [sz(n),sz(1:n-1),sz(n+1:N)]; 8 | if(n == 1) 9 | A_t = reshape(A_mat,[newsz 1 1]); 10 | else 11 | A_t = reshape(A_mat,[newsz 1 1]); 12 | A_t = ipermute(A_t,order); 13 | end 14 | 15 | end 16 | 17 | -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/my_tenmat.m: -------------------------------------------------------------------------------- 1 | function [ mat_A ] = my_tenmat( A,n ) 2 | %MY_TENMAR Summary of this function goes here 3 | % Detailed explanation goes here 4 | % size_A = size(A);N = size_A(end); 5 | % mat_A = reshape(permute(A,[4 1 2 3]), N,prod(size_A(1:end-1))); 6 | N = ndims(A); 7 | sz = size(A); 8 | if(n==1) 9 | mat_A = reshape(A(:),sz(n),prod(sz([1:n-1,n+1:N]))); 10 | elseif(n==N) 11 | mat_A = reshape(A(:),prod(sz([1:n-1,n+1:N])),sz(n))'; 12 | else 13 | order = [n,1:n-1,n+1:N]; 14 | newdata = permute(A,order); 15 | mat_A = reshape(newdata,sz(n),prod(sz([1:n-1,n+1:N]))); 16 | end 17 | 18 | end 19 | 20 | -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/my_ttm.m: -------------------------------------------------------------------------------- 1 | function [ A_U ] = my_ttm( A,U,n,tflag ) 2 | %MY_TTM Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | N = ndims(A); 6 | sz = size(A); 7 | order = [n,1:n-1,n+1:N]; 8 | % newdata = permute(A,order); 9 | % newdata = reshape(newdata,sz(n),prod(sz([1:n-1,n+1:N]))); 10 | newdata = my_tenmat(A,n); 11 | if tflag == 't' 12 | newdata = U'*newdata; 13 | p = size(U,2); 14 | else 15 | newdata = U*newdata; 16 | p = size(U,1); 17 | end 18 | 19 | newsz = [p,sz(1:n-1),sz(n+1:N)]; 20 | if(n == 1) 21 | A_U = reshape(newdata,[newsz 1 1]); 22 | else 23 | newdata = reshape(newdata,[newsz 1 1]); 24 | A_U = ipermute(newdata,order); 25 | end 26 | 27 | 28 | 29 | end 30 | 31 | -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/my_ttm2.m: -------------------------------------------------------------------------------- 1 | function [ A_UV ] = my_ttm2( A,U,V,tflag ) 2 | %MY_TTM Summary of this function goes here 3 | % Detailed explanation goes here 4 | n = ndims(A); 5 | N = ndims(A); 6 | sz = size(A); 7 | order = [n,1:n-1,n+1:N]; 8 | newdata = double(permute(A,order)); 9 | newdata = reshape(newdata,sz(n),prod(sz([1:n-1,n+1:N]))); 10 | if tflag == 't' 11 | newdata = U'*newdata*V; 12 | p = size(U,2); 13 | else 14 | newdata = U*newdata*V'; 15 | p = size(U,1); 16 | end 17 | newsz = [p,sz(1:n-1),sz(n+1:N)]; 18 | newdata = reshape(newdata,[newsz 1 1]); 19 | A_UV = ipermute(newdata,order); 20 | end 21 | 22 | -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/search_cube.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/MStSVD/t_svd_lib/search_cube.m -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/search_cube_new.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/MStSVD/t_svd_lib/search_cube_new.m -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/search_cube_new_j.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/MStSVD/t_svd_lib/search_cube_new_j.m -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/t_product.m: -------------------------------------------------------------------------------- 1 | function [A]=t_product(U,S,V) 2 | size_S=size(S);N_pictures=size_S(end); length_S = length(size_S); 3 | 4 | if(length_S==4) 5 | D=size_S(end-1); 6 | elseif(length_S==3) 7 | D=size_S(end); 8 | end 9 | % A=zeros(size_S); 10 | U_f=fft(U,[],3);V_f=fft(V,[],3); 11 | 12 | 13 | for k=1:N_pictures 14 | S_f=fft(S(:,:,:,k),[],3); 15 | for i=1:D 16 | size(S_f(:,:,i)) 17 | A(:,:,i,k)=U_f(:,:,i)*S_f(:,:,i)*V_f(:,:,i)'; 18 | end 19 | A(:,:,:,k)=ifft(A(:,:,:,k),[],3); 20 | end 21 | 22 | end -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/test_t_d_svd.m: -------------------------------------------------------------------------------- 1 | A = rand(4,4,4); 2 | tic 3 | A_d = ffd(A); 4 | toc 5 | 6 | tic 7 | A_f = fft(A); 8 | toc 9 | 10 | -------------------------------------------------------------------------------- /lib/compete_methods/MStSVD/t_svd_lib/tproduce.m: -------------------------------------------------------------------------------- 1 | function C=tproduce(A,B) 2 | % Computes the tensor-product of two P dimensional tensors (A & B) 3 | % All dimensions of the inputed tensor except for the 2nd must be the same. 4 | % The algorithm follows from paper by ... 5 | % 6 | % INPUTS: 7 | % 8 | % A - n1 x n2 x n3 .... nP tensor 9 | % B - n2 x n4 x n3 .... nP tensor 10 | % 11 | % OUTPUTS: 12 | % 13 | % C - n1 x n4 x n3 .... nP tensor 14 | % 15 | % Original author : Misha Kilmer, Ning Hao 16 | % Edited by : G. Ely, S. Aeron, Z. Zhang, ECE, Tufts Univ. 03/16/2015 17 | 18 | 19 | sa = size(A); 20 | sb = size(B); 21 | 22 | faces = length(sa); 23 | 24 | nfaces = prod(sb(3:end)); 25 | 26 | for i = 3:faces 27 | A = fft(A,[],i); 28 | B = fft(B,[],i); 29 | end 30 | sc = sa; 31 | sc(2) = sb(2); 32 | C = zeros(sc); 33 | for i = 1:nfaces 34 | C(:,:,i) = A(:,:,i)*B(:,:,i); 35 | end 36 | for i = 3:faces 37 | C = ifft(C,[],i); 38 | end 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /lib/compete_methods/NLM3D.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/NLM3D.m -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/images/barbara.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/images/barbara.png -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/images/boat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/images/boat.png -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/images/house.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/images/house.png -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/images/lena.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/images/lena.png -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/images/peppers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/images/peppers.png -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/odctdict.m: -------------------------------------------------------------------------------- 1 | function D = odctdict(n,L) 2 | %ODCTDICT Overcomplete DCT dictionary. 3 | % D = ODCTDICT(N,L) returns the overcomplete DCT dictionary of size NxL 4 | % for signals of length N. 5 | % 6 | % See also ODCT2DICT, ODCT3DICT, ODCTNDICT. 7 | 8 | % Ron Rubinstein 9 | % Computer Science Department 10 | % Technion, Haifa 32000 Israel 11 | % ronrubin@cs 12 | % 13 | % April 2009 14 | 15 | 16 | D = zeros(n,L); 17 | D(:,1) = 1/sqrt(n); 18 | for k = 2:L 19 | v = cos((0:n-1)*pi*(k-1)/L)'; 20 | v = v-mean(v); 21 | D(:,k) = v/norm(v); 22 | end 23 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/ompbox/Contents.m: -------------------------------------------------------------------------------- 1 | %OMPBox - Implementation of Batch-OMP and OMP-Cholesky. 2 | % 3 | %Ron Rubinstein, Computer Science Department 4 | %Technion -- Israel Institute of Technology 5 | %ronrubin@cs.technion.ac.il 6 | % 7 | % 8 | %Orthogonal Matching Pursuit. 9 | % omp - Sparsity-constrained Orthogonal Matching Pursuit. 10 | % omp2 - Error-constrained Orthogonal Matching Pursuit. 11 | % 12 | %Demonstrations. 13 | % ompdemo - Demonstration of the OMP toolbox. 14 | % ompspeedtest - Test the speed of the OMP functions. 15 | % 16 | %Miscellaneous. 17 | % ompver - OMPBox version information. 18 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/ompbox/private/make.m: -------------------------------------------------------------------------------- 1 | function make 2 | %MAKE Build the OMPBox package. 3 | % MAKE compiles all OMPBox MEX functions, using Matlab's default MEX 4 | % compiler. If the MEX compiler has not been set-up before, please run 5 | % 6 | % mex -setup 7 | % 8 | % before using this MAKE file. 9 | 10 | % Ron Rubinstein 11 | % Computer Science Department 12 | % Technion, Haifa 32000 Israel 13 | % ronrubin@cs 14 | % 15 | % April 2009 16 | 17 | 18 | % detect platform 19 | 20 | compstr = computer; 21 | is64bit = strcmp(compstr(end-1:end),'64'); 22 | 23 | 24 | % compilation parameters 25 | 26 | compile_params = cell(0); 27 | if (is64bit) 28 | compile_params{1} = '-largeArrayDims'; 29 | end 30 | 31 | 32 | % Compile files % 33 | 34 | ompsources = {'ompcore.c','omputils.c','myblas.c','ompprof.c'}; 35 | 36 | disp('Compiling ompmex...'); 37 | mex('ompmex.c', ompsources{:},compile_params{:}); 38 | 39 | disp('Compiling omp2mex...'); 40 | mex('omp2mex.c',ompsources{:},compile_params{:}); 41 | 42 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/ompbox/private/omp2mex.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/ompbox/private/omp2mex.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/ompbox/private/omp2mex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/ompbox/private/omp2mex.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/ompbox/private/ompmex.m: -------------------------------------------------------------------------------- 1 | %This is the Matlab interface to the OMP MEX implementation. 2 | %The function is not for independent use, only through omp.m. 3 | 4 | 5 | %OMPMEX Matlab interface to the OMP MEX implementation. 6 | % GAMMA = OMPMEX(D,X,DtX,G,L,SPARSE_G,MSGDELTA,PROFILE) invokes the OMP 7 | % MEX function according to the specified parameters. Not all the 8 | % parameters are required. Those among D, X, DtX and G which are not 9 | % specified should be passed as []. 10 | % 11 | % L - the target sparsity. 12 | % SPARSE_G - returns a sparse GAMMA when nonzero, full GAMMA when zero. 13 | % MSGDELTA - the delay in secs between messages. Zero means no messages. 14 | % PROFILE - nonzero means that profiling information should be printed. 15 | 16 | 17 | % Ron Rubinstein 18 | % Computer Science Department 19 | % Technion, Haifa 32000 Israel 20 | % ronrubin@cs 21 | % 22 | % April 2009 23 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/ompbox/private/ompmex.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/ompbox/private/ompmex.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/ompbox/private/ompmex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/ompbox/private/ompmex.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/ompbox/private/printf.m: -------------------------------------------------------------------------------- 1 | function str = printf(varargin) 2 | %PRINTF Print formatted text to screen. 3 | % PRINTF(FMT,VAL1,VAL2,...) formats the data in VAL1,VAL2,... according to 4 | % the format string FMT, and prints the result to the screen. 5 | % 6 | % The call to PRINTF(FMT,VAL1,VAL2,...) simply invokes the call 7 | % DISP(SPRINTF(FMT,VAL1,VAL2,...)). For a complete description of the 8 | % format string options see function SPRINTF. 9 | % 10 | % STR = PRINTF(...) also returns the formatted string. 11 | 12 | 13 | % Ron Rubinstein 14 | % Computer Science Department 15 | % Technion, Haifa 32000 Israel 16 | % ronrubin@cs 17 | % 18 | % April 2008 19 | 20 | 21 | if (nargout>0) 22 | str = sprintf(varargin{:}); 23 | disp(str); 24 | else 25 | disp(sprintf(varargin{:})); 26 | end 27 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/add_dc.m: -------------------------------------------------------------------------------- 1 | function x = add_dc(y,dc,columns) 2 | %ADD_DC Add DC channel to signals. 3 | % X = ADD_DC(Y,DC) adds the specified DC value to the (possibly 4 | % multi-dimensional) signal Y, returning the result as X. DC should be a 5 | % scalar value. 6 | % 7 | % X = ADD_DC(Y,DC,'columns') where Y is a 2D matrix and DC is an array of 8 | % length size(Y,2), treats the columns of Y as individual 1D signals, 9 | % adding to each one the corresponding DC value from the DC array. X is 10 | % the same size as Y and contains the resulting signals. 11 | % 12 | % See also REMOVE_DC. 13 | 14 | % Ron Rubinstein 15 | % Computer Science Department 16 | % Technion, Haifa 32000 Israel 17 | % ronrubin@cs 18 | % 19 | % April 2009 20 | 21 | 22 | if (nargin==3 && strcmpi(columns,'columns')), columns = 1; 23 | else columns = 0; 24 | end 25 | 26 | if (columns) 27 | x = addtocols(y,dc); 28 | else 29 | x = y + dc; 30 | end 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/addtocols.m: -------------------------------------------------------------------------------- 1 | %ADDTOCOLS Add values to the columns of a matrix. 2 | % Y=ADDTOCOLS(X,V) adds to each column of the MxN matrix X the 3 | % corresponding value from the N-element vector V. 4 | % 5 | % See also NORMCOLS. 6 | 7 | 8 | % Ron Rubinstein 9 | % Computer Science Department 10 | % Technion, Haifa 32000 Israel 11 | % ronrubin@cs 12 | % 13 | % June 2005 14 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/addtocols.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/private/addtocols.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/addtocols.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/private/addtocols.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/collincomb.m: -------------------------------------------------------------------------------- 1 | %COLLINCOMB Linear combination of matrix columns. 2 | % Y = COLLINCOMB(A,COLS,X) computes a linear combination of the columns of 3 | % the matrix A. The column indices are specified in the vector COLS, and 4 | % the correspoinding coefficients are specified in the vector X. The 5 | % vectors COLS and X must be of the same length. 6 | % 7 | % The call Y = COLLINCOMB(A,COLS,X) is essentially equivalent to 8 | % 9 | % Y = A(:,COLS)*X . 10 | % 11 | % However, it is implemented much more efficiently. 12 | % 13 | % Y = COLLINCOMB(A,ROWS,COLS,X) only works on the rows of A specified 14 | % in ROWS, returning a vector of length equal to ROWS. This call is 15 | % essentially equivalent to the command 16 | % 17 | % Y = A(ROWS,COLS)*X . 18 | % 19 | % See also ROWLINCOMB. 20 | 21 | 22 | % Ron Rubinstein 23 | % Computer Science Department 24 | % Technion, Haifa 32000 Israel 25 | % ronrubin@cs 26 | % 27 | % April 2009 28 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/collincomb.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/private/collincomb.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/collincomb.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/private/collincomb.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/imnormalize.m: -------------------------------------------------------------------------------- 1 | function y = imnormalize(x) 2 | %IMNORMALIZE Normalize image values. 3 | % Y = IMNORMALIZE(X) linearly transforms the intensity values of the image 4 | % X to tightly cover the range [0,1]. If X has more than one channel, the 5 | % channels are handled as one and normalized using the same transform. 6 | 7 | 8 | % Ron Rubinstein 9 | % Computer Science Department 10 | % Technion, Haifa 32000 Israel 11 | % ronrubin@cs 12 | % 13 | % May 2004 14 | 15 | 16 | maxval = max(x(:)); 17 | minval = min(x(:)); 18 | 19 | y = (x-minval) / (maxval-minval); 20 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/iswhole.m: -------------------------------------------------------------------------------- 1 | function z = iswhole(x,epsilon) 2 | %ISWHOLE Determine whole numbers with finite precision. 3 | % Z = ISWHOLE(X,EPSILON) returns a matrix the same size as X, containing 4 | % 1's where X is whole up to precision EPSILON, and 0's elsewhere. 5 | % 6 | % Z = ISWHOLE(X) uses the default value of EPSILON=1e-6. 7 | 8 | 9 | % Ron Rubinstein 10 | % Computer Science Department 11 | % Technion, Haifa 32000 Israel 12 | % ronrubin@cs 13 | % 14 | % May 2005 15 | 16 | if (nargin<2), epsilon = 1e-6; end 17 | z = abs(round(x)-x) < epsilon; 18 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/normcols.m: -------------------------------------------------------------------------------- 1 | function y = normcols(x) 2 | %NORMCOLS Normalize matrix columns. 3 | % Y = NORMCOLS(X) normalizes the columns of X to unit length, returning 4 | % the result as Y. 5 | % 6 | % See also ADDTOCOLS. 7 | 8 | 9 | % Ron Rubinstein 10 | % Computer Science Department 11 | % Technion, Haifa 32000 Israel 12 | % ronrubin@cs 13 | % 14 | % April 2009 15 | 16 | 17 | y = x*spdiag(1./sqrt(sum(x.*x))); 18 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/printf.m: -------------------------------------------------------------------------------- 1 | function str = printf(varargin) 2 | %PRINTF Print formatted text to screen. 3 | % PRINTF(FMT,VAL1,VAL2,...) formats the data in VAL1,VAL2,... according to 4 | % the format string FMT, and prints the result to the screen. 5 | % 6 | % The call to PRINTF(FMT,VAL1,VAL2,...) simply invokes the call 7 | % DISP(SPRINTF(FMT,VAL1,VAL2,...)). For a complete description of the 8 | % format string options see function SPRINTF. 9 | % 10 | % STR = PRINTF(...) also returns the formatted string. 11 | 12 | 13 | % Ron Rubinstein 14 | % Computer Science Department 15 | % Technion, Haifa 32000 Israel 16 | % ronrubin@cs 17 | % 18 | % April 2008 19 | 20 | 21 | if (nargout>0) 22 | str = sprintf(varargin{:}); 23 | disp(str); 24 | else 25 | disp(sprintf(varargin{:})); 26 | end 27 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/rowlincomb.m: -------------------------------------------------------------------------------- 1 | %ROWLINCOMB Linear combination of matrix rows. 2 | % Y = ROWLINCOMB(X,A,ROWS) computes a linear combination of the rows of 3 | % the matrix A. The row indices are specified in the vector ROWS, and the 4 | % correspoinding coefficients are specified in the vector X. The vectors 5 | % ROWS and X must be of the same length. The call Y = ROWLINCOMB(X,A,ROWS) 6 | % is essentially equivalent to the command 7 | % 8 | % Y = X'*A(ROWS,:) . 9 | % 10 | % However, it is implemented much more efficiently. 11 | % 12 | % Y = ROWLINCOMB(X,A,ROWS,COLS) only works on the columns of A specified 13 | % in COLS, returning a vector of length equal to COLS. This call is 14 | % essentially equivalent to the command 15 | % 16 | % Y = X'*A(ROWS,COLS) . 17 | % 18 | % See also COLLINCOMB. 19 | 20 | 21 | % Ron Rubinstein 22 | % Computer Science Department 23 | % Technion, Haifa 32000 Israel 24 | % ronrubin@cs 25 | % 26 | % April 2009 27 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/rowlincomb.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/private/rowlincomb.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/rowlincomb.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/private/rowlincomb.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/secs2hms.m: -------------------------------------------------------------------------------- 1 | function [h,m,s] = secs2hms(t) 2 | %SECS2HMS Convert seconds to hours, minutes and seconds. 3 | % [H,M,S] = SECS2HMS(T) converts the specified number of seconds T to 4 | % hours, minutes and seconds. H and M are whole numbers, and S is real. 5 | % 6 | % Example: Estimate the remaining time of a loop 7 | % 8 | % n = 10; tic; 9 | % for i = 1:n 10 | % pause(1); 11 | % [h,m,s] = secs2hms( (n-i)*toc/i ); 12 | % printf('estimated remaining time: %02d:%02d:%05.2f',h,m,s); 13 | % end 14 | 15 | 16 | % Ron Rubinstein 17 | % Computer Science Department 18 | % Technion, Haifa 32000 Israel 19 | % ronrubin@cs 20 | % 21 | % April 2008 22 | 23 | 24 | s = t; 25 | h = fix(s/3600); 26 | s = rem(s,3600); 27 | m = fix(s/60); 28 | s = rem(s,60); 29 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/spdiag.m: -------------------------------------------------------------------------------- 1 | function Y = spdiag(V,K) 2 | %SPDIAG Sparse diagonal matrices. 3 | % SPDIAG(V,K) when V is a vector with N components is a sparse square 4 | % matrix of order N+ABS(K) with the elements of V on the K-th diagonal. 5 | % K = 0 is the main diagonal, K > 0 is above the main diagonal and K < 0 6 | % is below the main diagonal. 7 | % 8 | % SPDIAG(V) is the same as SPDIAG(V,0) and puts V on the main diagonal. 9 | % 10 | % See also DIAG, SPDIAGS. 11 | 12 | 13 | % Ron Rubinstein 14 | % Computer Science Department 15 | % Technion, Haifa 32000 Israel 16 | % ronrubin@cs 17 | % 18 | % June 2008 19 | 20 | 21 | if (nargin<2) 22 | K = 0; 23 | end 24 | 25 | n = length(V) + abs(K); 26 | 27 | if (K>0) 28 | i = 1:length(V); 29 | j = K+1:n; 30 | elseif (K<0) 31 | i = -K+1:n; 32 | j = 1:length(V); 33 | else 34 | i = 1:n; 35 | j = 1:n; 36 | end 37 | 38 | Y = sparse(i,j,V(:),n,n); -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/sprow.m: -------------------------------------------------------------------------------- 1 | %SPROW Extract row of sparse matrix. 2 | % X = SPROW(A,J) where A is a sparse matrix, returns the nonzero values in 3 | % the row A(J,:). 4 | % 5 | % [X,ID] = SPROW(A,J) also returns the column indices of the nonzeros. 6 | % 7 | % Note that the call [X,ID] = SPROW(A,J) is equivalent (but more efficient 8 | % than) the Matlab code 9 | % 10 | % IDS = find(A(J,:)); 11 | % X = A(J,IDS); 12 | 13 | 14 | % Ron Rubinstein 15 | % Computer Science Department 16 | % Technion, Haifa 32000 Israel 17 | % ronrubin@cs 18 | % 19 | % August 2009 20 | -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/sprow.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/private/sprow.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/ksvdbox/private/sprow.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/ksvdbox/private/sprow.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/naonlm3d/MABONLM3D.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/naonlm3d/MABONLM3D.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/naonlm3d/MABONLM3D.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/naonlm3d/MABONLM3D.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/naonlm3d/MBONLM3D.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/naonlm3d/MBONLM3D.c -------------------------------------------------------------------------------- /lib/compete_methods/naonlm3d/MBONLM3D.mexw32: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/naonlm3d/MBONLM3D.mexw32 -------------------------------------------------------------------------------- /lib/compete_methods/naonlm3d/MBONLM3D.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/naonlm3d/MBONLM3D.mexw64 -------------------------------------------------------------------------------- /lib/compete_methods/naonlm3d/Wave3D/cshift3D.m: -------------------------------------------------------------------------------- 1 | function y = cshift3D(x, m, d) 2 | 3 | % 3D Circular Shift 4 | % 5 | % USAGE: 6 | % y = cshift3D(x, m, d) 7 | % INPUT: 8 | % x - N1 by N2 by N3 array 9 | % m - amount of shift 10 | % d - dimension of shift (d = 1,2,3) 11 | % OUTPUT: 12 | % y - array x will be shifed by m samples down 13 | % along dimension d 14 | % 15 | % WAVELET SOFTWARE AT POLYTECHNIC UNIVERSITY, BROOKLYN, NY 16 | % http://taco.poly.edu/WaveletSoftware/ 17 | 18 | [N1, N2, N3] = size(x); 19 | switch d 20 | case 1 21 | n = 0:N1-1; 22 | n = mod(n-m, N1); 23 | y = x(n+1,:,:); 24 | case 2 25 | n = 0:N2-1; 26 | n = mod(n-m, N2); 27 | y = x(:,n+1,:); 28 | case 3 29 | n = 0:N3-1; 30 | n = mod(n-m, N3); 31 | y = x(:,:,n+1); 32 | end 33 | 34 | -------------------------------------------------------------------------------- /lib/compete_methods/naonlm3d/Wave3D/dwt3D.m: -------------------------------------------------------------------------------- 1 | function w = dwt3D(x, J, af) 2 | 3 | % 3-D Discrete Wavelet Transform 4 | % 5 | % USAGE: 6 | % w = dwt3D(x, stages, af) 7 | % INPUT: 8 | % x - N1 by N2 by N3 matrix 9 | % 1) Ni all even 10 | % 2) min(Ni) >= 2^(J-1)*length(af) 11 | % J - number of stages 12 | % af - analysis filters 13 | % OUTPUT: 14 | % w - cell array of wavelet coefficients 15 | % EXAMPLE: 16 | % [af, sf] = farras; 17 | % x = rand(128,64,64); 18 | % w = dwt3D(x,3,af); 19 | % y = idwt3D(w,3,sf); 20 | % err = x-y; 21 | % max(max(max(abs(err)))) 22 | % 23 | % WAVELET SOFTWARE AT POLYTECHNIC UNIVERSITY, BROOKLYN, NY 24 | % http://taco.poly.edu/WaveletSoftware/ 25 | 26 | for k = 1:J 27 | [x w{k}] = afb3D(x, af, af, af); 28 | end 29 | w{J+1} = x; 30 | 31 | -------------------------------------------------------------------------------- /lib/compete_methods/naonlm3d/Wave3D/dwt3D_plots.m: -------------------------------------------------------------------------------- 1 | % dwt3D_plots 2 | % DISPLAY 3D WAVELETS OF DWT3D.M 3 | 4 | [af, sf] = farras; 5 | J = 4; 6 | L = 3*2^(J+1); 7 | N = L/2^J; 8 | x = zeros(L,L,L); 9 | w = dwt3D(x,J,af); 10 | w{J}{7}(N/2,N/2,N/2) = 1; 11 | y = idwt3D(w,J,sf); 12 | figure(1) 13 | clf 14 | v = 1:L; 15 | S = 0.017; 16 | p1 = patch(isosurface(v,v,v,y,S)); 17 | isonormals(v,v,v,y,p1); 18 | set(p1,'FaceColor','red','EdgeColor','none'); 19 | hold on 20 | p2 = patch(isosurface(v,v,v,y,-S)); 21 | isonormals(v,v,v,y,p2); 22 | set(p2,'FaceColor','blue','EdgeColor','none'); 23 | hold off 24 | daspect([1 1 1]); 25 | view(-30,30); 26 | camlight; 27 | lighting phong 28 | grid 29 | axis([32 48 32 48 32 48]) 30 | set(gca,'fontsize',7) 31 | title('3-D WAVELET ISOSURFACE (SEPARABLE TRANSFORM)') 32 | set(gcf,'paperposition',[0.5 0.5 0 0]+[0 0 4 3]) 33 | print -djpeg95 dwt3D_plots 34 | -------------------------------------------------------------------------------- /lib/compete_methods/naonlm3d/Wave3D/idwt3D.m: -------------------------------------------------------------------------------- 1 | function y = idwt3D(w, J, sf) 2 | 3 | % Inverse 3-D Discrete Wavelet Transform 4 | % 5 | % USAGE: 6 | % y = idwt3D(w, J, sf) 7 | % INPUT: 8 | % w - wavelet coefficient 9 | % J - number of stages 10 | % sf - synthesis filters 11 | % OUTPUT: 12 | % y - output array 13 | % See: dwt3D 14 | % 15 | % WAVELET SOFTWARE AT POLYTECHNIC UNIVERSITY, BROOKLYN, NY 16 | % http://taco.poly.edu/WaveletSoftware/ 17 | 18 | y = w{J+1}; 19 | for k = J:-1:1 20 | y = sfb3D(y, w{k}, sf, sf, sf); 21 | end 22 | 23 | -------------------------------------------------------------------------------- /lib/compete_methods/naonlm3d/Wave3D/pm4.m: -------------------------------------------------------------------------------- 1 | function [u, v, q, r] = pm4(a, b, c, d) 2 | 3 | % [u, v, q, r] = pm4(a, b, c, d); 4 | % u = (a + b - c - d)/2; 5 | % v = (a - b + c + d)/2; 6 | % q = (a + b - c + d)/2; 7 | % r = (a + b + c - d)/2; 8 | 9 | u = (a - b - c - d)/2; 10 | v = (a - b + c + d)/2; 11 | q = (a + b - c + d)/2; 12 | r = (a + b + c - d)/2; 13 | -------------------------------------------------------------------------------- /lib/compete_methods/naonlm3d/Wave3D/pm4inv.m: -------------------------------------------------------------------------------- 1 | function [u, v, q, r] = pm4inv(a, b, c, d) 2 | 3 | % [u, v, q, r] = pm4(a, b, c, d); 4 | % u = (a + b - c - d)/2; 5 | % v = (a - b + c + d)/2; 6 | % q = (a + b - c + d)/2; 7 | % r = (a + b + c - d)/2; 8 | 9 | u = ( a + b + c + d)/2; 10 | v = (-a - b + c + d)/2; 11 | q = (-a + b - c + d)/2; 12 | r = (-a + b + c - d)/2; 13 | -------------------------------------------------------------------------------- /lib/compete_methods/naonlm3d/t1_icbm_normal_1mm_pn0_rf0.rawb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/compete_methods/naonlm3d/t1_icbm_normal_1mm_pn0_rf0.rawb -------------------------------------------------------------------------------- /lib/compete_methods/tensor_dl/dependency/poblano_toolbox/INSTALL.txt: -------------------------------------------------------------------------------- 1 | To install the Poblano Toolbox for MATLAB: 2 | 3 | 1. Unpack the compressed file. In a linux environment, for example, this can 4 | be done from the command line via: 5 | 6 | unzip poblano_toolbox_1.0.zip 7 | 8 | *or* 9 | 10 | gunzip -c poblano_toolbox_1.0.tgz | tar xvf - 11 | 12 | This should create a directory named *poblano_toolbox_1.0*. 13 | 14 | 2. Rename the root directory from *poblano_toolbox_1.0* to *poblano_toolbox*. 15 | 16 | 3. Start MATLAB. 17 | 18 | 4. Within MATLAB, cd to the *poblano_toolbox* directory and execute the 19 | following commands: 20 | 21 | addpath(pwd) %<-- Add the Poblano toolbox to the MATLAB path 22 | savepath %<-- Save for future MATLAB sessions 23 | 24 | OR enter the following command: 25 | 26 | install_poblano -------------------------------------------------------------------------------- /lib/compete_methods/tensor_dl/dependency/poblano_toolbox/example1.m: -------------------------------------------------------------------------------- 1 | function [f,g]=example1(x,a) 2 | %EXAMPLE1 Example function for Poblano Toolbox routines. 3 | % 4 | % [F,G] = EXAMPLE1(X) computes F = sin(X(N)) + ... sin(X(N)) and G, the 5 | % gradient of F at X, where N is the number of variables in X. 6 | % 7 | % [F,G] = EXAMPLE1(X,A) computes F = sin(A*X(1)) + ... + sin(A*X(N)) and G, 8 | % the gradient of F at X. 9 | % 10 | %MATLAB Poblano Toolbox. 11 | %Copyright 2009, Sandia Corporation. 12 | 13 | if (nargin < 2), a = 1; end 14 | f = sum(sin(a*x)); 15 | g = a*cos(a*x); 16 | 17 | -------------------------------------------------------------------------------- /lib/compete_methods/tensor_dl/dependency/poblano_toolbox/info.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | R2008a 7 | Poblano 8 | toolbox 9 | $toolbox/matlab/icons/unknownicon.gif 10 | doc 11 | 12 | 13 | 14 | 15 | doc poblano_toolbox/ 16 | $toolbox/matlab/icons/webicon.gif 17 | 18 | 19 | 20 | web https://software.sandia.gov/trac/poblano 21 | $toolbox/matlab/icons/webicon.gif 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /lib/compete_methods/tensor_dl/dependency/poblano_toolbox/install_poblano.m: -------------------------------------------------------------------------------- 1 | %INSTALL_POBLANO Script to install Poblano path. 2 | % 3 | %MATLAB Poblano Toolbox. 4 | %Copyright 2009, Sandia Corporation. 5 | 6 | addpath(pwd) 7 | savepath 8 | 9 | 10 | -------------------------------------------------------------------------------- /lib/findFMeasure.m: -------------------------------------------------------------------------------- 1 | function [fmax, S, bestTH] = findFMeasure(E, S0) 2 | fmax = 0; 3 | Vth = linspace(min(abs(E(:))), max(abs(E(:))), 5000); 4 | for idx = 1:length(Vth) 5 | th = Vth(idx); 6 | Stmp = abs(E) > th; 7 | [pre, rec] = countPR(S0, Stmp); 8 | ftmp = 2*rec*pre/(pre+rec); 9 | if ~isnan(ftmp) && ftmp > fmax 10 | fmax = ftmp; 11 | S = Stmp; 12 | bestTH = th; 13 | end 14 | end 15 | 16 | if fmax == 0 17 | S = Stmp; 18 | bestTH = 0; 19 | end 20 | end 21 | 22 | function [pre, rec] = countPR(S0, Stmp) 23 | CS = (S0.*Stmp); 24 | pre = sum(CS(:))/sum(Stmp(:)); 25 | rec = sum(CS(:))/sum(S0(:)); 26 | end -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/contents.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/contents.m -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperAmsd.m: -------------------------------------------------------------------------------- 1 | function [results] = hyperAmsd(M, B, target) 2 | % HYPERAMSD Adaptive matched subspace detector (AMSD) algorithm 3 | % Performs the adaptive matched subspace detector (AMSD) algorithm for 4 | % target detection 5 | % 6 | % Usage 7 | % [results] = hyperAmsd(M, U, target) 8 | % Inputs 9 | % M - 2d matrix of HSI data (p x N) 10 | % B - 2d matrix of background endmebers (p x q) 11 | % target - target of interest (p x 1) 12 | % Outputs 13 | % results - vector of detector output (N x 1) 14 | % 15 | % References 16 | % Joshua Broadwater, Reuven Meth, Rama Chellappa. "A Hybrid Algorithms 17 | % for Subpixel Detection in Hyperspectral Imagery." IGARSS 004. Vol 3. 18 | % September 2004. 19 | 20 | [p, N] = size(M); 21 | I = eye(p); 22 | 23 | E = [B target]; 24 | P_B = I - (B * pinv(B)); 25 | P_Z = I - (E * pinv(E)); 26 | 27 | results = zeros(N, 1); 28 | tmp = P_B - P_Z; 29 | for k=1:N 30 | x = M(:,k); 31 | % Equation 16 32 | results(k) = (x.'*tmp*x) / (x.'*P_Z*x); 33 | end -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperAtgp.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/hyperAtgp.m -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperConvert2Colormap.m: -------------------------------------------------------------------------------- 1 | function [imgOut] = hyperConvert2Colormap(imgIn, cmap) 2 | %HYPERCONVERT2COLORMap Converts a matrix to a specified colormap 3 | % Converts a matrix into the specified colormap values. Useful 4 | % for writing float data to a color image (e.g. .png) file. 5 | % 6 | % Usage 7 | % [imgOut] = hyperConvert2Colormap(imgIn, cmap) 8 | % Inputs 9 | % imgIn - input matrix, must be 2D 10 | % cmap - (optional) Colormap to use. If not specified, jet is used. 11 | % Outputs 12 | % imgOut - 3D matrix containing corresponding jet colormap values 13 | 14 | if (ndims(imgIn) ~= 2) 15 | fprintf('Need a two dimensional image.'); 16 | return; 17 | end 18 | if (nargin == 1) 19 | tmpJet = jet; 20 | end 21 | tmpJet = cmap; 22 | s = size(tmpJet, 1); 23 | imgIn = hyperNormalize(imgIn); 24 | [h, w] = size(imgIn); 25 | imgOut = zeros(h, w, 3); 26 | for j=1:h 27 | for i=1:w 28 | v = tmpJet(round(imgIn(j, i)*(s-1))+1, :); 29 | imgOut(j, i, :) = v; 30 | end 31 | end -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperConvert2d.m: -------------------------------------------------------------------------------- 1 | function [M] = hyperConvert2d(M) 2 | % HYPERCONVERT2D Converts an HSI cube to a 2D matrix 3 | % Converts a 3D HSI cube (m x n x p) to a 2D matrix of points (p X N) 4 | % where N = mn 5 | % 6 | % Usage 7 | % [M] = hyperConvert2d(M) 8 | % Inputs 9 | % M - 3D HSI cube (m x n x p) 10 | % Outputs 11 | % M - 2D data matrix (p x N) 12 | 13 | if (ndims(M)>3 || ndims(M)<2) 14 | error('Input image must be m x n x p or m x n'); 15 | end 16 | if (ndims(M) == 2) 17 | numBands = 1; 18 | [h, w] = size(M); 19 | else 20 | [h, w, numBands] = size(M); 21 | end 22 | 23 | M = reshape(M, w*h, numBands).'; 24 | 25 | return; -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperConvert3d.m: -------------------------------------------------------------------------------- 1 | function [img] = hyperConvert3d(img, h, w, numBands) 2 | % HYPERCONVERT2D Converts an 2D matrix to a 3D data cube 3 | % Converts a 2D matrix (p x N) to a 3D data cube (m x n x p) 4 | % where N = m * n 5 | % 6 | % Usage 7 | % [M] = hyperConvert3d(M) 8 | % Inputs 9 | % M - 2D data matrix (p x N) 10 | % Outputs 11 | % M - 3D data cube (m x n x p) 12 | 13 | 14 | if (ndims(img) ~= 2) 15 | error('Input image must be p x N.'); 16 | end 17 | 18 | [numBands, N] = size(img); 19 | 20 | if (1 == N) 21 | img = reshape(img, h, w); 22 | else 23 | img = reshape(img.', h, w, numBands); 24 | end 25 | 26 | return; -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperCorr.m: -------------------------------------------------------------------------------- 1 | function [R] = hyperCorr(M) 2 | % HYPERCORR Computes the sample autocorrelation matrix 3 | % hyperCorr compute the sample autocorrelation matrix of a 2D matrix. 4 | % 5 | % Usage 6 | % [R] = hyperCorr(M) 7 | % 8 | % Inputs 9 | % M - 2D matrix 10 | % Outputs 11 | % R - Sample autocorrelation matrix 12 | 13 | 14 | [p, N] = size(M); 15 | 16 | R = (M*M.')/N; 17 | -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperCov.m: -------------------------------------------------------------------------------- 1 | function [C] = hyperCov(M) 2 | % HYPERCOV Computes the covariance matrix 3 | % hyperCorr compute the sample covariance matrix of a 2D matrix. 4 | % 5 | % Usage 6 | % [C] = hyperCorr(M) 7 | % 8 | % Inputs 9 | % M - 2D matrix 10 | % Outputs 11 | % C - Sample covariance matrix 12 | 13 | [p, N] = size(M); 14 | % Remove mean from data 15 | u = mean(M.').'; 16 | for k=1:N 17 | M(:,k) = M(:,k) - u; 18 | end 19 | 20 | C = (M*M.')/(N-1); 21 | -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperGetEnviSignature.m: -------------------------------------------------------------------------------- 1 | function [refl, lambdaNm] = hyperGetEnviSignature(filename) 2 | % HYPERGETENVISIGNATURE Reads an ENVI hyperspectral reflectance signature 3 | % hyperGetEnviSignature reads the RIT Target Detection Blind Test 4 | % signature files. 5 | % 6 | % Usage 7 | % [refl, lambdaNm] = hyperGetEnviSignature(filename) 8 | % 9 | % Input 10 | % filename - Filename of signature. 11 | % Output 12 | % refl - Reflectance values [0, 1]. 13 | % lambdaNm - corresponding wavelengths in nanometers 14 | 15 | fid = fopen(filename); 16 | 17 | for k=1:3 18 | dummy = fgetl(fid); 19 | end 20 | 21 | num = 1; 22 | while 1 23 | tmp = fgetl(fid); 24 | if (tmp == -1), break, end; 25 | v = sscanf(tmp, '%f'); 26 | refl(num) = v(2); 27 | lambdaNm(num) = v(1); 28 | num = num + 1; 29 | end 30 | 31 | refl = refl / 100; -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperGlrt.m: -------------------------------------------------------------------------------- 1 | function [results] = hyperGlrt(M, t) 2 | % HYPERGLRT Performs the generalized liklihood test ratio algorithm 3 | % Performs the generalized liklihood test ratio algorithm for target 4 | % detection. 5 | % 6 | % Usage 7 | % [results] = hyperGlrt(M, U, target) 8 | % Inputs 9 | % M - 2d matrix of HSI data (p x N) 10 | % t - target of interest (p x 1) 11 | % Outputs 12 | % results - vector of detector output (N x 1) 13 | % 14 | % References 15 | % T F AyouB, "Modified GLRT Signal Detection Algorithm," IEEE 16 | % Transactions on Aerospace and Electronic Systems, Vol 36, No 3, July 17 | % 2000. 18 | 19 | [p, N] = size(M); 20 | 21 | % Remove mean from data 22 | u = mean(M.').'; 23 | M = M - repmat(u, 1, N); 24 | t = t - u; 25 | 26 | R = inv(hyperCov(M)); 27 | 28 | results = zeros(1, N); 29 | for k=1:N 30 | x = M(:,k); 31 | results(k) = ((t'*R*x)^2) / ((t'*R*t)*(1 + x'*R*x)); 32 | end -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperHfcVd.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/hyperHfcVd.m -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperIcaComponentScores.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/hyperIcaComponentScores.m -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperIcaEea.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/hyperIcaEea.m -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperImagesc.m: -------------------------------------------------------------------------------- 1 | function [rgb] = hyperImagesc(img, bands) 2 | %UNTITLED1 Summary of this function goes here 3 | % Usage: plotAvirisRgb(img, bands) 4 | 5 | [h, w, p] = size(img); 6 | 7 | if (nargin == 1) 8 | bands = [1 round(p/2) p]; 9 | end 10 | blue = img(:,:,bands(1)); 11 | green = img(:,:,bands(2)); 12 | red = img(:,:,bands(3)); 13 | 14 | rgb = zeros(size(img, 1), size(img, 2), 3); 15 | rgb(:,:,1) = hyperNormalize(red); 16 | rgb(:,:,2) = hyperNormalize(green); 17 | rgb(:,:,3) = hyperNormalize(blue); 18 | 19 | rgb = decorrstretch(rgb); 20 | red = rgb(:,:,1); 21 | green = rgb(:,:,2); 22 | blue = rgb(:,:,3); 23 | rgb(:,:,1) = adapthisteq(red); 24 | rgb(:,:,2) = adapthisteq(green); 25 | rgb(:,:,3) = adapthisteq(blue); 26 | 27 | imshow(rgb); axis image; 28 | -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperImshow.m: -------------------------------------------------------------------------------- 1 | function [rgb] = hyperImshow( img, bands ) 2 | %UNTITLED1 Summary of this function goes here 3 | % Detailed explanation goes here 4 | 5 | 6 | [h, w, p] = size(img); 7 | 8 | if (nargin == 1) 9 | bands = [p round(p/2) 1]; 10 | end 11 | red = img(:,:,bands(1)); 12 | green = img(:,:,bands(2)); 13 | blue = img(:,:,bands(3)); 14 | 15 | rgb = zeros(size(img, 1), size(img, 2), 3); 16 | rgb(:,:,1) = adapthisteq(red); 17 | rgb(:,:,2) = adapthisteq(green); 18 | rgb(:,:,3) = adapthisteq(blue); 19 | 20 | imshow(rgb); axis image; 21 | 22 | 23 | 24 | % tmp = zeros(100, 614, 3); 25 | % tmp(:,:,1) = histeq((img(:,:, [36]))); 26 | % tmp(:,:,2) = histeq((img(:,:, [24]))); 27 | % tmp(:,:,3) = histeq((img(:,:, [12]))); 28 | % image(tmp); -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperMax2d.m: -------------------------------------------------------------------------------- 1 | function [x, y, val] = hyperMax2d(mat) 2 | % HYPERMAX2D Finds the max value and position in a matrix 3 | % 4 | % Usage 5 | % [x, y, val] = hyperMax2d(mat) 6 | % Inputs 7 | % mat - Input matrix 8 | % Outputs 9 | % x - X position of maximum value 10 | % y - Y position of maximum value 11 | % val - Maximum value in matrix 12 | 13 | [dum, y] = max(mat); 14 | [val, y] = max(dum); 15 | [dum, x] = max(mat(:,y)); -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperMnf.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/hyperMnf.m -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperNormXCorr.m: -------------------------------------------------------------------------------- 1 | function [ result ] = hyperNormXCorr( a, b ) 2 | % HYPERNORMXCORR Computes the normalized cross correlation 3 | % hyperNormXCorr computes the normalized cross correlation between two 4 | % vectors. The value returned is in [-1. 1] 5 | % 6 | % Usage 7 | % [ result ] = hyperNormXCorr( a, b ) 8 | % Inputs 9 | % a - Vector 1. 10 | % b - Vector 2. 11 | % Outputs 12 | % result - Normalized cross-correlation result. 13 | 14 | if (size(a, 2) ~= 1) 15 | N = size(a, 2); 16 | q = size(b, 2); 17 | result = zeros(q, N); 18 | for x=1:N 19 | for y=1:q 20 | result(y, x) = abs(hyperNormXCorr(a(:, x), b(:, y))); 21 | end 22 | end 23 | else 24 | a = a(:); b = b(:); 25 | s = length(a); 26 | %err = normxcorr2(a, b); 27 | err = sum((a-mean(a)).*(b-mean(b))) / (std(a)*std(b)); 28 | err = err * (1/(s-1)); 29 | result = err; 30 | end 31 | return; -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperNormalize.m: -------------------------------------------------------------------------------- 1 | function [ normalizedM ] = hyperNormalize( M ) 2 | %HYPERNORMALIZE Normalized data to be in range [0, 1] 3 | % hyperNormalize Normalizes data to be in range [0, 1] 4 | % 5 | % Usage 6 | % hyperNormalize(M) 7 | % Inputs 8 | % M - Input data 9 | % Outputs 10 | % normalizedM - Normalized data 11 | 12 | minVal = min(M(:)); 13 | maxVal = max(M(:)); 14 | 15 | normalizedM = M - minVal; 16 | if (maxVal == minVal) 17 | normalizeData = zeros(size(M)); 18 | else 19 | normalizedM = normalizedM ./ (maxVal-minVal); 20 | end 21 | -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperPct.m: -------------------------------------------------------------------------------- 1 | function [M_pct, V, lambda] = hyperPct(M, q) 2 | %HYPERPCA Performs the principal components transform (PCT) 3 | % hyperPct performs the principal components transform on a data matrix. 4 | % 5 | % Usage 6 | % [M_pct, V] = hyperPct(M, q) 7 | % Inputs 8 | % M - 2D matrix (p x N) 9 | % q - number of components to keep 10 | % Outputs 11 | % M_pct - 2D matrix (q x N) which is result of transform 12 | % V - Transformation matrix. 13 | % lambda - eigenvalues 14 | % 15 | % References 16 | % http://en.wikipedia.org/wiki/Principal_component_analysis 17 | 18 | [p, N] = size(M); 19 | 20 | % Remove the data mean 21 | u = mean(M.').'; 22 | %M = M - repmat(u, 1, N); 23 | M = M - (u*ones(1,N)); 24 | 25 | % Compute covariance matrix 26 | C = (M*M.')/N; 27 | 28 | % Find eigenvalues of covariance matrix 29 | [V, D] = eigs(C, q); 30 | 31 | % Transform data 32 | M_pct = V'*M; 33 | 34 | lambda = diag(D); 35 | 36 | return; -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperPpi.m: -------------------------------------------------------------------------------- 1 | function [U] = hyperPpi(M, q, numSkewers) 2 | % HYPERPPI Performs the pixel purity index (PPI) algorithm 3 | % Performs the pixel purity index algorithm for endmember finding. 4 | % 5 | % Usage 6 | % [U] = hyperPpi(M, q, numSkewers) 7 | % Inputs 8 | % M - 2d matrix of HSI data (p x N) 9 | % q - Number of endmembers to find 10 | % numSkewers - Number of "skewer" vectors to project data onto. 11 | % Outputs 12 | % U - Recovered endmembers (p x N) 13 | 14 | [p, N] = size(M); 15 | 16 | % Remove data mean 17 | u = mean(M.').'; 18 | M = M - repmat(u, 1, N); 19 | 20 | % Generate skewers 21 | skewers = randn(p, numSkewers); 22 | 23 | votes = zeros(N, 1); 24 | for kk=1:numSkewers 25 | % Project all the data onto a skewer 26 | tmp = abs(skewers(:,kk).'*M); 27 | [val, idx] = max(tmp); 28 | votes(idx) = votes(idx) + 1; 29 | end 30 | 31 | [val, idx] = sort(votes, 'descend'); 32 | U = M(:, idx(1:q)); 33 | 34 | 35 | -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperReadAvirisSpc.m: -------------------------------------------------------------------------------- 1 | function [lambda] = hyperReadAvirisSpc(filename) 2 | %HYPERREADAVIRISSPC Reads AVIRIS .spc files. 3 | % hyperReadAvirisSpc reads AVIRIS files containing information about the 4 | % wavelengths sampled during a collect with the AVIRIS sensor. 5 | % 6 | % Usage 7 | % [lambda] = hyperReadAvirisSpc(filename) 8 | % Input 9 | % filename - input filename of .spc file. 10 | % Output 11 | % lambda - wavelengths contained in .spc file. 12 | 13 | 14 | fid = fopen(filename, 'r'); 15 | 16 | i = 1; 17 | done = false; 18 | while not(done) 19 | txt = fgetl(fid); 20 | if (txt == -1) 21 | break; 22 | end 23 | a = sscanf(txt, '%g %g %g %g %g'); 24 | lambda(i) = a(1); 25 | i = i+1; 26 | end 27 | return; 28 | -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperRoc.m: -------------------------------------------------------------------------------- 1 | function [pd,fa] = hyperRoc(x) 2 | 3 | x = x(:); 4 | 5 | numTs = 100; 6 | pd = linspace(0,1,numTs); 7 | for k=1:numTs 8 | fa(k) = sum(x>=pd(k)); 9 | end 10 | 11 | N = length(x); 12 | fa = fa./N; 13 | pd = 1-pd; -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperRxDetector.m: -------------------------------------------------------------------------------- 1 | function [result, sigma, sigmaInv] = hyperRxDetector(M) 2 | %HYPERRX RX anomaly detector 3 | % hyperRxDetector performs the RX anomaly detector 4 | % 5 | % Usage 6 | % [result] = hyperRxDetector(M) 7 | % Inputs 8 | % M - 2D data matrix (p x N) 9 | % Outputs 10 | % result - Detector output (1 x N) 11 | % sigma - Covariance matrix (p x p) 12 | % sigmaInv - Inverse of covariance matrix (p x p) 13 | 14 | % Remove the data mean 15 | [p, N] = size(M); 16 | mMean = mean(M, 2); 17 | M = M - repmat(mMean, 1, N); 18 | 19 | % Compute covariance matrix 20 | sigma = hyperCov(M); 21 | sigmaInv = inv(sigma); 22 | 23 | result = zeros(N, 1); 24 | for i=1:N 25 | result(i) = M(:,i).'*sigmaInv*M(:,i); 26 | end 27 | result = abs(result); 28 | 29 | return; -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperSam.m: -------------------------------------------------------------------------------- 1 | function [errRadians] = hyperSam(a, b) 2 | % HYPERSAM Computes the spectral angle error (in radians) between two vectors 3 | % 4 | % Usage 5 | % [errRadians] = hyperSam(a, b) 6 | % Inputs 7 | % a - Vector 1. 8 | % b - Vector 2. 9 | % Outputs 10 | % errRadians - angle between vectors a and b in radians 11 | 12 | [p,N] = size(a); 13 | errRadians = zeros(1,N); 14 | for k=1:N 15 | tmp = a(:,k); 16 | errRadians(k) = acos(dot(tmp, b)/ (norm(b) * norm(tmp))); 17 | end 18 | return; -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperSaveFigure.m: -------------------------------------------------------------------------------- 1 | function hyperSaveFigure(h, filename, fmt) 2 | % HYPERSAVEFIGURE Writes a figure to disk as an image. 3 | % 4 | % Usage 5 | % hyperSaveFigure(gcf, 'filename.png'); 6 | % Inputs 7 | % h - Handle to figure 8 | % filename - Filename for output file. Extension determines image type. 9 | % fmt - Format of output image. 'wysiwyg' or wysiwyp' for 'what you see 10 | % is what you get' and what 'you see is what you print' respectively. 11 | % Outputs 12 | % none 13 | 14 | if (nargin == 2) 15 | fmt = 'wysiwyg'; 16 | end 17 | 18 | fmt = lower(fmt); 19 | 20 | if strcmp(fmt, 'wysiwyp') 21 | saveas(h, filename); 22 | elseif strcmp(fmt, 'wysiwyg') 23 | set(h, 'Color',[1 1 1]); 24 | frame = getframe(h); 25 | [X,map] = frame2im(frame); 26 | imwrite(X ,filename); 27 | else 28 | error('Bad format string specified.'); 29 | end 30 | %print(h, '-dpng', filename); -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperSid.m: -------------------------------------------------------------------------------- 1 | function [ err ] = hyperSid( M, b ) 2 | % HYPERSID Computes the spectral information divergence between two vectors 3 | % 4 | % Usage 5 | % [err] = hyperSid(a, b) 6 | % Inputs 7 | % M - 2d matrix of data (p x N) 8 | % b - vector 2 9 | % Outputs 10 | % err - spectral information divergence between M and b 11 | % 12 | % References 13 | % C.-I Chang, "Spectral information divergence for hyperspectral image 14 | % analysis," IEEE 1999 International Geoscience and Remote Sensing Symp., 15 | % Hamburg, Germany, pp. 509-511, 28 June-2 July, 1999. 16 | 17 | [p, N] = size(M); 18 | err = zeros(1, N); 19 | for k=1:N 20 | err(k) = abs(sum(M(:,k).*log(M(:,k)./b)) + sum(b.*log(b./M(:,k)))); 21 | end 22 | err = 1./(err+eps); 23 | -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperUcls.m: -------------------------------------------------------------------------------- 1 | function [ W ] = hyperUcls( M, U ) 2 | %HYPERUCLS Unconstrained least squares 3 | % hyperUcls performs unconstrained least squares abundance estimation 4 | % 5 | % Usage 6 | % [ W ] = hyperUcls( M, U ) 7 | % Inputs 8 | % M - 2D data matrix (p x N) 9 | % U - 2D matrix of endmembers (p x q) 10 | % Outputs 11 | % W - Abundance maps (q x N) 12 | 13 | if (ndims(M) ~= 2) 14 | error('M must be a p x N matrix.'); 15 | end 16 | if (ndims(U) ~= 2) 17 | error('M must be a p x q matrix.'); 18 | end 19 | 20 | [p1, N] = size(M); 21 | [p2, q] = size(U); 22 | if (p1 ~= p2) 23 | error('M and U must have the same number of spectral bands.'); 24 | end 25 | 26 | Minv = pinv(U); 27 | W = zeros(q, N); 28 | for n1 = 1:N 29 | W(:, n1) = Minv*M(:, n1); 30 | end 31 | 32 | return; 33 | -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/hyperVca.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/hyperVca.m -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/results/ace detector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/results/ace detector.png -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/results/amsd detector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/results/amsd detector.png -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/results/cem detector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/results/cem detector.png -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/results/hud detector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/results/hud detector.png -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/results/mf detector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/results/mf detector.png -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/results/osp detector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/results/osp detector.png -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/results/rx detector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/results/rx detector.png -------------------------------------------------------------------------------- /lib/hyperspectralToolbox/results/signed ace detector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/hyperspectralToolbox/results/signed ace detector.png -------------------------------------------------------------------------------- /lib/quality_assess/ErrRelGlobAdimSyn.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/quality_assess/ErrRelGlobAdimSyn.m -------------------------------------------------------------------------------- /lib/quality_assess/MSIQA.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/quality_assess/MSIQA.m -------------------------------------------------------------------------------- /lib/quality_assess/PSNR3D.m: -------------------------------------------------------------------------------- 1 | function [psnr] = PSNR3D(imagery1,imagery2) 2 | [m, n, k] = size(imagery1); 3 | [mm, nn, kk] = size(imagery2); 4 | m = min(m, mm); 5 | n = min(n, nn); 6 | k = min(k, kk); 7 | imagery1 = imagery1(1:m, 1:n, 1:k); 8 | imagery2 = imagery2(1:m, 1:n, 1:k); 9 | psnr = 0; 10 | for i = 1:k 11 | psnr = psnr + 10*log10(255^2/mse(imagery1(:, :, i) - imagery2(:, :, i))); 12 | end 13 | psnr = psnr/k; 14 | end -------------------------------------------------------------------------------- /lib/show_BS.m: -------------------------------------------------------------------------------- 1 | function show_result = show_BS(D,B,F,enList,methodname) 2 | sizD = size(D); 3 | frames = 5; 4 | n = length(enList); 5 | n_frames = [10:10:50]; 6 | %I0 = zeros(sizD(1),frames*sizD(2)); 7 | BF = zeros(2*sizD(1),frames*sizD(2)); 8 | plot_m = tight_subplot(n+1,1,[.01 .01],[.01 .01],[.01 .01]); 9 | I_D = 1-zeros(2*sizD(1),frames*sizD(2)); 10 | for i = 1:frames 11 | I_D((1+sizD(1)):2*sizD(1),(i*sizD(2)-sizD(2)+1):(i*sizD(2))) = D(:,:,n_frames(i)); 12 | end 13 | axes(plot_m(1)); 14 | imshow(I_D);ylabel(['Original']); 15 | for m = 1:length(enList) 16 | B1 = B{enList(m)}; 17 | F1 = F{enList(m)}; 18 | I_1 = BF; 19 | % m = 1; 20 | for i = 1:frames 21 | I_1(1:sizD(1),(i*sizD(2)-sizD(2)+1):(i*sizD(2))) = B1(:,:,n_frames(i)); 22 | I_1((1+sizD(1)):2*sizD(1),(i*sizD(2)-sizD(2)+1):(i*sizD(2))) = abs(double(F1(:,:,n_frames(i)))); 23 | end 24 | axes(plot_m(m+1)); 25 | imshow(I_1);ylabel(methodname{enList(m)}); 26 | end -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ktensor/display.m: -------------------------------------------------------------------------------- 1 | function display(t) 2 | %DISPLAY Command window display for a ktensor. 3 | % 4 | % DISPLAY(T) displays a Kruskal tensor with its name. 5 | % 6 | % See also DISPLAY, KTENSOR/DISP, KTENSOR. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: display.m,v 1.7 2010/03/19 23:46:29 tgkolda Exp $ 19 | 20 | disp(t,inputname(1)); 21 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ktensor/double.m: -------------------------------------------------------------------------------- 1 | function A = double(X) 2 | %DOUBLE Convert a ktensor to a double array. 3 | % 4 | % A = double(X) converts X to a standard multidimensional array. 5 | % 6 | % See also KTENSOR. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: double.m,v 1.13 2010/03/19 23:46:29 tgkolda Exp $ 19 | 20 | if isempty(X.lambda) % check for empty tensor 21 | A = []; 22 | return; 23 | end 24 | 25 | sz = [size(X) 1]; 26 | A = X.lambda' * khatrirao(X.u,'r')'; 27 | A = reshape(A,sz); 28 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ktensor/isequal.m: -------------------------------------------------------------------------------- 1 | function [tf, tf_lambda, tf_U] = isequal(A,B) 2 | %ISEQUAL True if each component of two ktensor's is numerically equal. 3 | % 4 | %MATLAB Tensor Toolbox. 5 | %Copyright 2012, Sandia Corporation. 6 | 7 | % This is the MATLAB Tensor Toolbox by T. Kolda, B. Bader, and others. 8 | % http://www.sandia.gov/~tgkolda/TensorToolbox. 9 | % Copyright (2012) Sandia Corporation. Under the terms of Contract 10 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 11 | % work by or on behalf of the U.S. Government. Export of this data may 12 | % require a license from the United States Government. 13 | % The full license terms can be found in the file LICENSE.txt 14 | 15 | tf = false; 16 | tf_lambda = false; 17 | tf_U = false; 18 | 19 | if ~isa(B,'ktensor') 20 | return; 21 | end 22 | 23 | tf_lambda = isequal(A.lambda, B.lambda); 24 | if ncomponents(A) == ncomponents(B) 25 | tf_U = cellfun(@isequal, A.u, B.u); 26 | end 27 | tf = tf_lambda & all(tf_U); 28 | 29 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ktensor/ncomponents.m: -------------------------------------------------------------------------------- 1 | function n = ncomponents(t) 2 | %NCOMPONENTS Number of components for a ktensor. 3 | % 4 | % NCOMPONENTS(T) returns the number of compontents in the ktensor T. 5 | % 6 | % See also KTENSOR 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: ncomponents.m,v 1.2 2010/03/19 23:46:30 tgkolda Exp $ 19 | 20 | n = length(t.lambda); 21 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ktensor/ndims.m: -------------------------------------------------------------------------------- 1 | function n = ndims(t) 2 | %NDIMS Number of dimensions for a ktensor. 3 | % 4 | % NDIMS(T) returns the number of dimensions of tensor T. 5 | % 6 | % See also KTENSOR 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: ndims.m,v 1.7 2010/03/19 23:46:30 tgkolda Exp $ 19 | 20 | n = numel(t.u); 21 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ktensor/redistribute.m: -------------------------------------------------------------------------------- 1 | function X = redistribute(X,mode) 2 | %REDISTRIBUTE Distribute lambda values to a specified mode. 3 | % 4 | % K = REDISTRIBUTE(K,N) absorbs the weights from the lambda vector 5 | % into mode N. Set the lambda vector to all ones. 6 | % 7 | % See also KTENSOR, NORMALIZE. 8 | % 9 | %MATLAB Tensor Toolbox. 10 | %Copyright 2012, Sandia Corporation. 11 | 12 | % This is the MATLAB Tensor Toolbox by T. Kolda, B. Bader, and others. 13 | % http://www.sandia.gov/~tgkolda/TensorToolbox. 14 | % Copyright (2012) Sandia Corporation. Under the terms of Contract 15 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 16 | % work by or on behalf of the U.S. Government. Export of this data may 17 | % require a license from the United States Government. 18 | % The full license terms can be found in the file LICENSE.txt 19 | 20 | for r = 1:length(X.lambda) 21 | X.u{mode}(:,r) = X.u{mode}(:,r) * X.lambda(r); 22 | X.lambda(r) = 1; 23 | end 24 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ktensor/uminus.m: -------------------------------------------------------------------------------- 1 | function t = uminus(t) 2 | %UMINUS Unary minus for ktensor. 3 | % 4 | % See also KTENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: uminus.m,v 1.7 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | t.lambda = -t.lambda; 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ktensor/uplus.m: -------------------------------------------------------------------------------- 1 | function t = uplus(t) 2 | %UPLUS Unary plus for a ktensor. 3 | % 4 | % See also KTENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: uplus.m,v 1.7 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | % This function does nothing! 19 | 20 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptenmat/Contents.m: -------------------------------------------------------------------------------- 1 | % @SPTENMAT 2 | % 3 | % Files 4 | % aatx - Implicitly compute A * A' * x for sptenmat. 5 | % disp - Command window display of a sptenmat. 6 | % display - Command window display of a sptenmat. 7 | % double - Convert a sptenmat to a sparse matrix. 8 | % end - Last index of indexing expression for sptenmat. 9 | % full - Convert a sptenmat to a (dense) tenmat. 10 | % nnz - Return number of nonzeros in a sptenmat. 11 | % norm - Frobenius norm of a sptenmat. 12 | % size - Return size of sptenmat. 13 | % sptenmat - Matricized sparse tensor stored as a sparse 2D array. 14 | % subsasgn - Subscripted assignment for sptenmat. 15 | % subsref - Subscripted reference for a sptenmat. 16 | % tsize - Tensor size of sptenmat. 17 | % uminus - Unary minus (-) for sptenmat. 18 | % uplus - Unary plus (+) for sptenmat. 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptenmat/display.m: -------------------------------------------------------------------------------- 1 | function display(t) 2 | %DISPLAY Command window display of a sptenmat. 3 | % 4 | % DISPLAY(T) displays the tensor with its name. 5 | % 6 | % See also SPTENMAT/DISP. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: display.m,v 1.8 2010/03/19 23:46:30 tgkolda Exp $ 19 | 20 | disp(t,inputname(1)); 21 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptenmat/end.m: -------------------------------------------------------------------------------- 1 | function e = end(X,k,n) 2 | %END Last index of indexing expression for sptenmat. 3 | % 4 | % The expression X(end,:) will call END(X,1,2) to determine 5 | % the value of the first index. 6 | % 7 | % See also SPTENMAT, SPTENMAT/SUBSREF, END. 8 | % 9 | %MATLAB Tensor Toolbox. 10 | %Copyright 2010, Sandia Corporation. 11 | 12 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 13 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 14 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 15 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 16 | % work by or on behalf of the U.S. Government. Export of this data may 17 | % require a license from the United States Government. 18 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 19 | % $Id: end.m,v 1.7 2010/03/19 23:46:30 tgkolda Exp $ 20 | 21 | if n > 2 22 | error('Subscript out of range.'); 23 | end 24 | e = size(X,k); 25 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptenmat/nnz.m: -------------------------------------------------------------------------------- 1 | function n = nnz(a) 2 | %NNZ Return number of nonzeros in a sptenmat. 3 | % 4 | % nnz(A) returns the number of nonzeros in A. 5 | % 6 | % See also SPTENMAT. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: nnz.m,v 1.6 2010/03/19 23:46:30 tgkolda Exp $ 19 | 20 | n = length(a.vals); 21 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptenmat/norm.m: -------------------------------------------------------------------------------- 1 | function nrm = norm(T) 2 | %NORM Frobenius norm of a sptenmat. 3 | % 4 | % NORM(T) returns the Frobenius norm of a matricized sparse tensor. 5 | % 6 | % See also SPTENMAT, NORM. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: norm.m,v 1.6 2010/03/19 23:46:30 tgkolda Exp $ 19 | 20 | nrm = norm(T.vals); 21 | 22 | return; 23 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptenmat/uminus.m: -------------------------------------------------------------------------------- 1 | function t = uminus(t) 2 | %UMINUS Unary minus (-) for sptenmat. 3 | % 4 | % See also SPTENMAT. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: uminus.m,v 1.4 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | t.vals = -t.vals; 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptenmat/uplus.m: -------------------------------------------------------------------------------- 1 | function t = uplus(t) 2 | %UPLUS Unary plus (+) for sptenmat. 3 | % 4 | % See also TENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: uplus.m,v 1.4 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | % This function does nothing! 19 | 20 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptensor/ctranspose.m: -------------------------------------------------------------------------------- 1 | function ctranspose(x) 2 | %CTRANSPOSE is not defined for sparse tensors. 3 | % 4 | % See also SPTENSOR/PERMUTE. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: ctranspose.m,v 1.4 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | error('Transpose on sparse tensor is not defined'); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptensor/display.m: -------------------------------------------------------------------------------- 1 | function display(t) 2 | %DISPLAY Command window display of a sparse tensor. 3 | % 4 | % DISPLAY(T) displays the tensor with its name. 5 | % 6 | % See also SPTENSOR, SPTENSOR/DISP. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: display.m,v 1.9 2010/03/19 23:46:30 tgkolda Exp $ 19 | 20 | disp(t,inputname(1)); 21 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptensor/double.m: -------------------------------------------------------------------------------- 1 | function a = double(s) 2 | %DOUBLE Converts a sparse tensor to a dense multidimensional array. 3 | % 4 | % See also SPTENSOR, SPTENSOR/FULL. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: double.m,v 1.13 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | a = zeros([size(s) 1 1]); 19 | if nnz(s) > 0 20 | a(tt_sub2ind(size(s),s.subs)) = s.vals; 21 | end 22 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptensor/end.m: -------------------------------------------------------------------------------- 1 | function e = end(X,k,n) 2 | %END Last index of indexing expression for sparse tensor. 3 | % 4 | % The expression X(end,:,:) will call END(X,1,3) to determine 5 | % the value of the first index. 6 | % 7 | % See also SPTENSOR, SPTENSOR/SUBSREF, END. 8 | % 9 | %MATLAB Tensor Toolbox. 10 | %Copyright 2010, Sandia Corporation. 11 | 12 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 13 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 14 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 15 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 16 | % work by or on behalf of the U.S. Government. Export of this data may 17 | % require a license from the United States Government. 18 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 19 | % $Id: end.m,v 1.7 2010/03/19 23:46:30 tgkolda Exp $ 20 | 21 | if n > ndims(X) 22 | error('Subscript out of range.'); 23 | end 24 | e = X.size(k); 25 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptensor/ldivide.m: -------------------------------------------------------------------------------- 1 | function C = ldivide(A,B) 2 | %LDIVIDE Array right division for sparse tensors. 3 | % 4 | % LDIVIDE(A,B) is called for the syntax 'A .\ B' when A or B is a sparse 5 | % tensor. A and B must have the same size, unless one is a scalar. 6 | % 7 | % See also SPTENSOR. 8 | % 9 | %MATLAB Tensor Toolbox. 10 | %Copyright 2010, Sandia Corporation. 11 | 12 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 13 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 14 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 15 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 16 | % work by or on behalf of the U.S. Government. Export of this data may 17 | % require a license from the United States Government. 18 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 19 | % $Id: ldivide.m,v 1.4 2010/03/19 23:46:30 tgkolda Exp $ 20 | 21 | C = rdivide(B,A); 22 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptensor/ndims.m: -------------------------------------------------------------------------------- 1 | function n = ndims(t) 2 | %NDIMS Number of dimensions of a sparse tensor. 3 | % 4 | % NDIMS(T) returns the number of dimensions of sparse tensor T. 5 | % 6 | % Examples: 7 | % T = sptenrand([3 2 2],5); 8 | % ndims(T) %<-- should return 3 9 | % 10 | % See also SPTENSOR. 11 | % 12 | %MATLAB Tensor Toolbox. 13 | %Copyright 2010, Sandia Corporation. 14 | 15 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 16 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 17 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 18 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 19 | % work by or on behalf of the U.S. Government. Export of this data may 20 | % require a license from the United States Government. 21 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 22 | % $Id: ndims.m,v 1.8 2010/03/19 23:46:30 tgkolda Exp $ 23 | 24 | n = size(t.size,2); 25 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptensor/nnz.m: -------------------------------------------------------------------------------- 1 | function a = nnz(t) 2 | %NNZ Number of nonzeros in sparse tensor. 3 | % 4 | % NNZ(T) is the number of nonzero elements in T. 5 | % 6 | % See also SPTENSOR, SPTENSOR/FIND. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: nnz.m,v 1.9 2010/03/19 23:46:30 tgkolda Exp $ 19 | 20 | if isempty(t.subs) 21 | a = 0; 22 | else 23 | a = size(t.subs,1); 24 | end 25 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptensor/norm.m: -------------------------------------------------------------------------------- 1 | function nrm = norm(T) 2 | %NORM Frobenius norm of a sparse tensor. 3 | % 4 | % NORM(T) returns the Frobenius norm of a sparse tensor. 5 | % 6 | % See also SPTENSOR, NORM. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: norm.m,v 1.7 2010/03/19 23:46:30 tgkolda Exp $ 19 | 20 | nrm = norm(T.vals); 21 | 22 | return; 23 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptensor/ones.m: -------------------------------------------------------------------------------- 1 | function t = ones(t) 2 | %ONES Replace nonzero elements of sparse tensor with ones. 3 | % 4 | % S = ONES(T) generates a sparse tensor with the same sparsity 5 | % structure as T, but with ones in the nonzero position. 6 | % 7 | % See also SPTENSOR, SPONES. 8 | % 9 | %MATLAB Tensor Toolbox. 10 | %Copyright 2010, Sandia Corporation. 11 | 12 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 13 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 14 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 15 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 16 | % work by or on behalf of the U.S. Government. Export of this data may 17 | % require a license from the United States Government. 18 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 19 | % $Id: ones.m,v 1.11 2010/03/19 23:46:30 tgkolda Exp $ 20 | 21 | t.vals = ones(size(t.vals)); 22 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptensor/size.m: -------------------------------------------------------------------------------- 1 | function m = size(t,idx) 2 | %SIZE Sparse tensor dimensions. 3 | % 4 | % D = SIZE(T) returns the size of the tensor. 5 | % 6 | % I = size(T,DIM) returns the sizes of the dimensions specified by DIM. 7 | % 8 | % See also SPTENSOR, SPTENSOR/NDIMS. 9 | % 10 | %MATLAB Tensor Toolbox. 11 | %Copyright 2010, Sandia Corporation. 12 | 13 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 14 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 15 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 16 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 17 | % work by or on behalf of the U.S. Government. Export of this data may 18 | % require a license from the United States Government. 19 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 20 | % $Id: size.m,v 1.7 2010/03/19 23:46:30 tgkolda Exp $ 21 | 22 | if exist('idx','var') 23 | m = t.size(idx); 24 | else 25 | m = t.size; 26 | end 27 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptensor/transpose.m: -------------------------------------------------------------------------------- 1 | function transpose(x) 2 | %TRANSPOSE is not defined on sparse tensors. 3 | % 4 | % See also SPTENSOR/PERMUTE. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: transpose.m,v 1.4 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | error('Transpose on sparse tensor is not defined'); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptensor/uminus.m: -------------------------------------------------------------------------------- 1 | function t = uminus(t) 2 | %UMINUS Unary minus (-) for sptensor. 3 | % 4 | % See also SPTENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: uminus.m,v 1.4 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | t.vals = -t.vals; 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@sptensor/uplus.m: -------------------------------------------------------------------------------- 1 | function t = uplus(t) 2 | %UPLUS Unary plus (+) for sptensor. 3 | % 4 | % See also SPTENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: uplus.m,v 1.4 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | % This function does nothing! 19 | 20 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tenmat/Contents.m: -------------------------------------------------------------------------------- 1 | % @TENMAT 2 | % 3 | % Files 4 | % ctranspose - Complex conjugate transpose for tenmat. 5 | % disp - Command window display of a matricized tensor (tenmat). 6 | % display - Command window display of a tenmat. 7 | % double - Convert tenmat to double array. 8 | % end - Last index of indexing expression for tenmat. 9 | % minus - Binary subtraction (-) for tenmat. 10 | % mtimes - Multiplies two tenmat objects. 11 | % norm - Frobenius norm of a tenmat. 12 | % plus - Binary addition (+) for tenmat. 13 | % size - Size of tenmat. 14 | % subsasgn - Subscripted assignment for tenmat. 15 | % subsref - Subscripted reference for tenmat. 16 | % tenmat - Create a matricized tensor. 17 | % tsize - Tensor size of tenmat. 18 | % uminus - Unary minus (-) for tenmat. 19 | % uplus - Unary plus (+) for tenmat. 20 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tenmat/ctranspose.m: -------------------------------------------------------------------------------- 1 | function a = ctranspose(a) 2 | %CTRANSPOSE Complex conjugate transpose for tenmat. 3 | % 4 | % C = CTRANSPOSE(A) swaps the row and column indices of A. 5 | % 6 | % See also TENMAT. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: ctranspose.m,v 1.7 2010/03/19 23:46:30 tgkolda Exp $ 19 | 20 | tmp = a.rindices; 21 | a.rindices = a.cindices; 22 | a.cindices = tmp; 23 | a.data = ctranspose(a.data); 24 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tenmat/display.m: -------------------------------------------------------------------------------- 1 | function display(t) 2 | %DISPLAY Command window display of a tenmat. 3 | % 4 | % See also TENMAT. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: display.m,v 1.6 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | disp(t,inputname(1)); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tenmat/double.m: -------------------------------------------------------------------------------- 1 | function a = double(t) 2 | %DOUBLE Convert tenmat to double array. 3 | % 4 | % See also TENMAT. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: double.m,v 1.6 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | a = t.data; 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tenmat/end.m: -------------------------------------------------------------------------------- 1 | function e = end(X,k,n) 2 | %END Last index of indexing expression for tenmat. 3 | % 4 | % The expression X(end,:) will call END(X,1,2) to determine 5 | % the value of the first index. 6 | % 7 | % See also TENMAT, TENMAT/SUBSREF, END. 8 | % 9 | %MATLAB Tensor Toolbox. 10 | %Copyright 2010, Sandia Corporation. 11 | 12 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 13 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 14 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 15 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 16 | % work by or on behalf of the U.S. Government. Export of this data may 17 | % require a license from the United States Government. 18 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 19 | % $Id: end.m,v 1.7 2010/03/19 23:46:30 tgkolda Exp $ 20 | 21 | if n > ndims(X) 22 | error('Subscript out of range.'); 23 | end 24 | e = size(X.data,k); 25 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tenmat/norm.m: -------------------------------------------------------------------------------- 1 | function n = norm(T) 2 | %NORM Frobenius norm of a tenmat. 3 | % 4 | % NORM(X) returns the Frobenius norm of a tenmat. 5 | % 6 | % See also TENMAT. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: norm.m,v 1.6 2010/03/19 23:46:30 tgkolda Exp $ 19 | 20 | v = reshape(T.data, numel(T.data), 1); 21 | n = norm(v); 22 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tenmat/uminus.m: -------------------------------------------------------------------------------- 1 | function t = uminus(t) 2 | %UMINUS Unary minus (-) for tenmat. 3 | % 4 | % See also TENMAT. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: uminus.m,v 1.4 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | t.data = -t.data; 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tenmat/uplus.m: -------------------------------------------------------------------------------- 1 | function t = uplus(t) 2 | %UPLUS Unary plus (+) for tenmat. 3 | % 4 | % See also TENMAT. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: uplus.m,v 1.4 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | % This function does nothing! 19 | 20 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/and.m: -------------------------------------------------------------------------------- 1 | function Z = and(X,Y) 2 | %AND Logical AND (&) for tensors. 3 | % 4 | % See also TENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: and.m,v 1.9 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | Z = tenfun(@and,X,Y); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/ctranspose.m: -------------------------------------------------------------------------------- 1 | function ctranspose(x) 2 | %CTRANSPOSE is not defined for tensors. 3 | % 4 | % See also TENSOR/PERMUTE. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: ctranspose.m,v 1.4 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | error('Transpose on tensor is not defined'); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/display.m: -------------------------------------------------------------------------------- 1 | function display(t) 2 | %DISPLAY Command window display of a tensor. 3 | % 4 | % DISPLAY(X) displays a tensor with its name. 5 | % 6 | % See also TENSOR, TENSOR/DISP. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: display.m,v 1.7 2010/03/19 23:46:30 tgkolda Exp $ 19 | 20 | disp(t,inputname(1)); 21 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/double.m: -------------------------------------------------------------------------------- 1 | function A = double(X) 2 | %DOUBLE Convert tensor to double array. 3 | % 4 | % A = double(X) converts X to a standard multidimensional array. 5 | % 6 | % See also TENSOR. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: double.m,v 1.8 2010/03/19 23:46:30 tgkolda Exp $ 19 | 20 | A = double(X.data); 21 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/end.m: -------------------------------------------------------------------------------- 1 | function e = end(X,k,n) 2 | %END Last index of indexing expression for tensor. 3 | % 4 | % The expression X(end,:,:) will call END(X,1,3) to determine 5 | % the value of the first index. 6 | % 7 | % See also TENSOR, TENSOR/SUBSREF, END. 8 | % 9 | %MATLAB Tensor Toolbox. 10 | %Copyright 2010, Sandia Corporation. 11 | 12 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 13 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 14 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 15 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 16 | % work by or on behalf of the U.S. Government. Export of this data may 17 | % require a license from the United States Government. 18 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 19 | % $Id: end.m,v 1.9 2010/03/19 23:46:30 tgkolda Exp $ 20 | 21 | if n > ndims(X) 22 | error('Subscript out of range.'); 23 | end 24 | e = X.size(k); 25 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/eq.m: -------------------------------------------------------------------------------- 1 | function Z = eq(X,Y) 2 | %EQ Equal (==) for tensors. 3 | % 4 | % See also TENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: eq.m,v 1.8 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | Z = tenfun(@eq,X,Y); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/full.m: -------------------------------------------------------------------------------- 1 | function X = full(X) 2 | %FULL Convert to a (dense) tensor. 3 | % 4 | % FULL(X) returns X, i.e., does nothing. 5 | % 6 | % See also SPTENSOR/FULL, KTENSOR/FULL, TTENSOR/FULL. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: full.m,v 1.7 2010/03/19 23:46:30 tgkolda Exp $ 19 | 20 | return; 21 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/ge.m: -------------------------------------------------------------------------------- 1 | function Z = ge(X,Y) 2 | %GE Greater than or equal (>=) for tensors. 3 | % 4 | % See also TENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: ge.m,v 1.8 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | Z = tenfun(@ge,X,Y); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/gt.m: -------------------------------------------------------------------------------- 1 | function Z = gt(X,Y) 2 | %GT Greater than (>) for tensors. 3 | % 4 | % See also TENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: gt.m,v 1.8 2010/03/19 23:46:30 tgkolda Exp $ 17 | 18 | Z = tenfun(@gt,X,Y); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/le.m: -------------------------------------------------------------------------------- 1 | function Z = le(X,Y) 2 | %LE Less than or equal (<=) for tensor. 3 | % 4 | % See also TENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: le.m,v 1.8 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | Z = tenfun(@le,X,Y); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/lt.m: -------------------------------------------------------------------------------- 1 | function Z = lt(X,Y) 2 | %LT Less than (<) for tensor. 3 | % 4 | % See also TENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: lt.m,v 1.8 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | Z = tenfun(@lt,X,Y); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/minus.m: -------------------------------------------------------------------------------- 1 | function Z = minus(X,Y) 2 | %MINUS Binary subtraction (-) for tensors. 3 | % 4 | % MINUS(A,B) is called for the syntax 'A - B' when A or B is a tensor. A 5 | % and B must have the same size, unless one is a scalar. A scalar can be 6 | % subtracted from a tensor of any size. 7 | % 8 | % See also TENSOR. 9 | % 10 | %MATLAB Tensor Toolbox. 11 | %Copyright 2010, Sandia Corporation. 12 | 13 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 14 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 15 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 16 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 17 | % work by or on behalf of the U.S. Government. Export of this data may 18 | % require a license from the United States Government. 19 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 20 | % $Id: minus.m,v 1.9 2010/03/19 23:46:31 tgkolda Exp $ 21 | 22 | Z = tenfun(@minus,X,Y); 23 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/ne.m: -------------------------------------------------------------------------------- 1 | function Z = ne(X,Y) 2 | %NE Not equal (~=) for tensors. 3 | % 4 | % See also TENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: ne.m,v 1.8 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | Z = tenfun(@ne,X,Y); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/nnz.m: -------------------------------------------------------------------------------- 1 | function n = nnz(x) 2 | %NNZ Number of nonzeros for tensors. 3 | % 4 | % See also TENSOR, SPTENSOR/NNZ. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: nnz.m,v 1.4 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | n = nnz(x.data); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/norm.m: -------------------------------------------------------------------------------- 1 | function n = norm(T) 2 | %NORM Frobenius norm of a tensor. 3 | % 4 | % NORM(X) returns the Frobenius norm of a tensor. 5 | % 6 | % See also TENSOR. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: norm.m,v 1.8 2010/03/19 23:46:31 tgkolda Exp $ 19 | 20 | v = reshape(T.data, numel(T.data), 1); 21 | n = norm(v); 22 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/not.m: -------------------------------------------------------------------------------- 1 | function B = not(A) 2 | %NOT Logical NOT (~) for tensors. 3 | % 4 | % See also TENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: not.m,v 1.7 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | B = tensor(not(A.data), size(A)); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/or.m: -------------------------------------------------------------------------------- 1 | function Z = or(X,Y) 2 | %OR Logical OR (|) for tensors. 3 | % 4 | % See also TENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: or.m,v 1.8 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | Z = tenfun(@or,X,Y); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/plus.m: -------------------------------------------------------------------------------- 1 | function Z = plus(X,Y) 2 | %PLUS Binary addition (+) for tensors. 3 | % 4 | % PLUS(A,B) is called for the syntax 'A + B' when A or B is a tensor. A 5 | % and B must have the same size, unless one is a scalar. A scalar can be 6 | % added to a tensor of any size. 7 | % 8 | % See also TENSOR. 9 | % 10 | %MATLAB Tensor Toolbox. 11 | %Copyright 2010, Sandia Corporation. 12 | 13 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 14 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 15 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 16 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 17 | % work by or on behalf of the U.S. Government. Export of this data may 18 | % require a license from the United States Government. 19 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 20 | % $Id: plus.m,v 1.9 2010/03/19 23:46:31 tgkolda Exp $ 21 | 22 | Z = tenfun(@plus,X,Y); 23 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/power.m: -------------------------------------------------------------------------------- 1 | function Z = power(X,Y) 2 | %POWER Elementwise power (.^) operator for a tensor. 3 | % 4 | % See also TENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: power.m,v 1.8 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | Z = tenfun(@power,X,Y); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/reshape.m: -------------------------------------------------------------------------------- 1 | function t = reshape(t,siz) 2 | %RESHAPE Change tensor size. 3 | % RESHAPE(X,SIZ) returns the tensor whose elements 4 | % have been reshaped to the appropriate size. 5 | % 6 | % See also SQUEEZE. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: reshape.m,v 1.3 2010/03/19 23:46:31 tgkolda Exp $ 19 | 20 | if prod(t.size) ~= prod(siz) 21 | error('Number of elements cannot change'); 22 | end 23 | 24 | t.data = reshape(t.data,siz); 25 | t.size = siz; 26 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/times.m: -------------------------------------------------------------------------------- 1 | function Z = times(X,Y) 2 | %TIMES Array multiplication for tensors. 3 | % 4 | % TIMES(A,B) is called for the syntax 'A .* B' when A or B is a 5 | % tensor. A and B must have the same size, unless one is a scalar. A 6 | % scalar can be multiplied by a tensor of any size. 7 | % 8 | % See also TENSOR. 9 | % 10 | %MATLAB Tensor Toolbox. 11 | %Copyright 2010, Sandia Corporation. 12 | 13 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 14 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 15 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 16 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 17 | % work by or on behalf of the U.S. Government. Export of this data may 18 | % require a license from the United States Government. 19 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 20 | % $Id: times.m,v 1.10 2010/03/19 23:46:31 tgkolda Exp $ 21 | 22 | Z = tenfun(@times,X,Y); 23 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/transpose.m: -------------------------------------------------------------------------------- 1 | function transpose(x) 2 | %TRANSPOSE is not defined on tensors. 3 | % 4 | % See also TENSOR/PERMUTE. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: transpose.m,v 1.4 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | error('Transpose on tensor is not defined'); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/uminus.m: -------------------------------------------------------------------------------- 1 | function t = uminus(t) 2 | %UMINUS Unary minus (-) for tensors. 3 | % 4 | % See also TENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: uminus.m,v 1.6 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | t.data = -t.data; 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/uplus.m: -------------------------------------------------------------------------------- 1 | function t = uplus(t) 2 | %UPLUS Unary plus (+) for tensors. 3 | % 4 | % See also TENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: uplus.m,v 1.6 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | % This function does nothing! 19 | 20 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@tensor/xor.m: -------------------------------------------------------------------------------- 1 | function Z = xor(X,Y) 2 | %XOR Logical EXCLUSIVE OR for tensors. 3 | % 4 | % See also TENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: xor.m,v 1.8 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | Z = tenfun(@xor,X,Y); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ttensor/display.m: -------------------------------------------------------------------------------- 1 | function display(t) 2 | %DISPLAY Command window display of a ttensor. 3 | % 4 | % See also TTENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: display.m,v 1.7 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | disp(t,inputname(1)); 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ttensor/double.m: -------------------------------------------------------------------------------- 1 | function A = double(T) 2 | %DOUBLE Convert ttensor to double array. 3 | % 4 | % A = double(T) converts T to a standard multidimensional array. 5 | % 6 | % See also TTENSOR. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: double.m,v 1.7 2010/03/19 23:46:31 tgkolda Exp $ 19 | 20 | A = double(full(T)); 21 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ttensor/end.m: -------------------------------------------------------------------------------- 1 | function e = end(X,k,n) 2 | %END Last index of indexing expression for ttensor. 3 | % 4 | % The expression X(end,:,:) will call END(X,1,3) to determine 5 | % the value of the first index. 6 | % 7 | % See also TTENSOR, TTENSOR/SUBSREF, END. 8 | % 9 | %MATLAB Tensor Toolbox. 10 | %Copyright 2010, Sandia Corporation. 11 | 12 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 13 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 14 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 15 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 16 | % work by or on behalf of the U.S. Government. Export of this data may 17 | % require a license from the United States Government. 18 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 19 | % $Id: end.m,v 1.7 2010/03/19 23:46:31 tgkolda Exp $ 20 | 21 | % Note that this only works with {} because () is not supported by 22 | % subsref. 23 | e = ndims(X); 24 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ttensor/isequal.m: -------------------------------------------------------------------------------- 1 | function [tf, tf_core, tf_U] = isequal(A,B) 2 | %ISEQUAL True if each component of two ttensor's is numerically equal. 3 | 4 | tf = false; 5 | tf_core = false; 6 | tf_U = false; 7 | 8 | if ~isa(B,'ttensor') 9 | return; 10 | end 11 | 12 | if ndims(A) ~= ndims(B) 13 | return; 14 | end 15 | 16 | tf_core = isequal(A.core, B.core); 17 | tf_U = cellfun(@isequal, A.u, B.u); 18 | tf = tf_core & all(tf_U); 19 | 20 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ttensor/mtimes.m: -------------------------------------------------------------------------------- 1 | function C = mtimes(A,B) 2 | %MTIMES Implement scalar multiplication for a ttensor. 3 | % 4 | % See also TTENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: mtimes.m,v 1.8 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | if ~isa(B,'ttensor') && numel(B) == 1 19 | C = ttensor(B * A.core, A.u); 20 | elseif ~isa(A,'ttensor') && numel(A) == 1 21 | C = ttensor(A * B.core, B.u); 22 | else 23 | error('Use mtimes(full(A),full(B)).'); 24 | end 25 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ttensor/ndims.m: -------------------------------------------------------------------------------- 1 | function n = ndims(t) 2 | %NDIMS Return the number of dimensions for a ttensor. 3 | % 4 | % NDIMS(T) returns the number of dimensions of tensor T. 5 | % 6 | % See also TTENSOR. 7 | % 8 | %MATLAB Tensor Toolbox. 9 | %Copyright 2010, Sandia Corporation. 10 | 11 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 12 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 13 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 14 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 15 | % work by or on behalf of the U.S. Government. Export of this data may 16 | % require a license from the United States Government. 17 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 18 | % $Id: ndims.m,v 1.7 2010/03/19 23:46:31 tgkolda Exp $ 19 | 20 | n = numel(t.u); 21 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ttensor/uminus.m: -------------------------------------------------------------------------------- 1 | function t = uminus(t) 2 | %UMINUS Unary minus for ttensor. 3 | % 4 | % See also TTENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: uminus.m,v 1.8 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | t.core = -t.core; 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/@ttensor/uplus.m: -------------------------------------------------------------------------------- 1 | function t = uplus(t) 2 | %UPLUS Unary plus for ttensor. 3 | % 4 | % See also TTENSOR. 5 | % 6 | %MATLAB Tensor Toolbox. 7 | %Copyright 2010, Sandia Corporation. 8 | 9 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 10 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 11 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 12 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 13 | % work by or on behalf of the U.S. Government. Export of this data may 14 | % require a license from the United States Government. 15 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 16 | % $Id: uplus.m,v 1.7 2010/03/19 23:46:31 tgkolda Exp $ 17 | 18 | % This function does nothing! 19 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/INSTALL.txt: -------------------------------------------------------------------------------- 1 | To install the Tensor Toolbox for MATLAB: 2 | 3 | 1. Unpack the compressed file. In a linux environment, for example, this can 4 | be done from the command line via: 5 | 6 | unzip tensor_toolbox_2.4.zip 7 | 8 | *or* 9 | 10 | gunzip -c tensor_toolbox_2.4.tar.gz | tar xvf - 11 | 12 | This should create a directory named *tensor_toolbox_2.4*. 13 | 14 | 2. Rename the root directory from *tensor_toolbox_2.4* to *tensor_toolbox*. 15 | 16 | 3. Start MATLAB. 17 | 18 | 4. Within MATLAB, cd to the *tensor_toolbox* directory and execute the 19 | following commands: 20 | 21 | addpath(pwd) %<-- Add the tensor toolbox to the MATLAB path 22 | cd algorithms; addpath(pwd) %<-- Also add the algorithms directory 23 | cd ../met; addpath(pwd) %<-- Also add the met directory 24 | savepath %<-- Save for future MATLAB sessions 25 | 26 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/cp_wopt.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensor_toolbox/cp_wopt.m -------------------------------------------------------------------------------- /lib/tensor_toolbox/doc/V_SSHOPM_doc.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensor_toolbox/doc/V_SSHOPM_doc.m -------------------------------------------------------------------------------- /lib/tensor_toolbox/doc/html/C_ttensor_doc_eq15566.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensor_toolbox/doc/html/C_ttensor_doc_eq15566.png -------------------------------------------------------------------------------- /lib/tensor_toolbox/doc/html/D_ktensor_doc_eq09466.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensor_toolbox/doc/html/D_ktensor_doc_eq09466.png -------------------------------------------------------------------------------- /lib/tensor_toolbox/doc/html/D_ktensor_doc_eq51104.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensor_toolbox/doc/html/D_ktensor_doc_eq51104.png -------------------------------------------------------------------------------- /lib/tensor_toolbox/doc/html/D_ktensor_doc_eq64665.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensor_toolbox/doc/html/D_ktensor_doc_eq64665.png -------------------------------------------------------------------------------- /lib/tensor_toolbox/doc/html/D_ktensor_doc_eq81501.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensor_toolbox/doc/html/D_ktensor_doc_eq81501.png -------------------------------------------------------------------------------- /lib/tensor_toolbox/doc/html/V_SSHOPM_doc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensor_toolbox/doc/html/V_SSHOPM_doc.png -------------------------------------------------------------------------------- /lib/tensor_toolbox/doc/html/V_SSHOPM_doc_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensor_toolbox/doc/html/V_SSHOPM_doc_01.png -------------------------------------------------------------------------------- /lib/tensor_toolbox/doc/html/V_SSHOPM_doc_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensor_toolbox/doc/html/V_SSHOPM_doc_02.png -------------------------------------------------------------------------------- /lib/tensor_toolbox/doc/images/Workspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensor_toolbox/doc/images/Workspace.png -------------------------------------------------------------------------------- /lib/tensor_toolbox/doc/images/banner-background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensor_toolbox/doc/images/banner-background.jpg -------------------------------------------------------------------------------- /lib/tensor_toolbox/doc/images/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensor_toolbox/doc/images/logo.gif -------------------------------------------------------------------------------- /lib/tensor_toolbox/helpindex.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Tensor Toolbox 6 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/info.xml: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | R2006a 7 | Tensor 8 | toolbox 9 | $toolbox/matlab/icons/unknownicon.gif 10 | . 11 | 12 | 13 | 14 | 15 | doc tensor_toolbox/ 16 | $toolbox/matlab/icons/webicon.gif 17 | 18 | 19 | 20 | web http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox 21 | $toolbox/matlab/icons/webicon.gif 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/met/Contents.m: -------------------------------------------------------------------------------- 1 | % MET: Memory Efficient Tucker 2 | % 3 | % Files 4 | % ttm_me - Memory-efficient sptensor times matrix. 5 | % ttm_me_mem - Estimates intermediate memory comsumption for ttm_me. 6 | % ttm_me_partition - Finds best order for ttm_me. 7 | % tucker_me - Memory-efficient Tucker higher-order orthogonal iteration. 8 | % tucker_me_test - Very simple tests of tucker_me. 9 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/tenones.m: -------------------------------------------------------------------------------- 1 | function X = tenones(sz) 2 | %TENONES Ones tensor. 3 | % 4 | % X = TENONES(SZ) forms a tensor of size SZ with all ones. 5 | % 6 | % TENONES(SZ) is equivalent to TENSOR(ONES(SZ(1),SZ(2),...),SZ). 7 | % 8 | % See also TENSOR, ONES. 9 | % 10 | %MATLAB Tensor Toolbox. 11 | %Copyright 2010, Sandia Corporation. 12 | 13 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 14 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 15 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 16 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 17 | % work by or on behalf of the U.S. Government. Export of this data may 18 | % require a license from the United States Government. 19 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 20 | % $Id: tenones.m,v 1.5 2010/03/19 23:46:31 tgkolda Exp $ 21 | 22 | data = ones([sz 1 1]); 23 | X = tensor(data,sz); 24 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/tt_assignment_type.m: -------------------------------------------------------------------------------- 1 | function type = tt_assignment_type(x,subs,rhs) 2 | %TT_ASSIGNMENT_TYPE What type of subsasgn is this? 3 | % 4 | %MATLAB Tensor Toolbox. 5 | %Copyright 2010, Sandia Corporation. 6 | 7 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 8 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 9 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 10 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 11 | % work by or on behalf of the U.S. Government. Export of this data may 12 | % require a license from the United States Government. 13 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 14 | % $Id: tt_assignment_type.m,v 1.3 2010/03/19 23:46:31 tgkolda Exp $ 15 | 16 | if isequal(class(x),class(rhs)) 17 | type = 'subtensor'; 18 | return; 19 | end 20 | 21 | if (numel(subs) >= 2) 22 | type = 'subtensor'; 23 | return; 24 | end 25 | 26 | type = 'subscripts'; 27 | 28 | 29 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/tt_intvec2str.m: -------------------------------------------------------------------------------- 1 | function s = tt_intvec2str(v) 2 | %TT_VEC2STR Print integer vector to a string with brackets. 3 | % 4 | %MATLAB Tensor Toolbox. 5 | %Copyright 2010, Sandia Corporation. 6 | 7 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 8 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 9 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 10 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 11 | % work by or on behalf of the U.S. Government. Export of this data may 12 | % require a license from the United States Government. 13 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 14 | % $Id: tt_intvec2str.m,v 1.8 2010/03/19 23:46:31 tgkolda Exp $ 15 | 16 | if isempty(v) 17 | s = sprintf('[]'); 18 | return; 19 | end 20 | 21 | s = ['[ ' sprintf('%d ',v(1:end)) ']']; 22 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/tt_matrix2cellstr.m: -------------------------------------------------------------------------------- 1 | function S = tt_matrix2cellstr(M) 2 | %TT_MATRIX2CELLSTR Convert a matrix to a cell array of strings. 3 | % 4 | %MATLAB Tensor Toolbox. 5 | %Copyright 2010, Sandia Corporation. 6 | 7 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 8 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 9 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 10 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 11 | % work by or on behalf of the U.S. Government. Export of this data may 12 | % require a license from the United States Government. 13 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 14 | % $Id: tt_matrix2cellstr.m,v 1.10 2010/03/19 23:46:31 tgkolda Exp $ 15 | 16 | fmt = get(0,'FormatSpacing'); 17 | format compact 18 | S = evalc('disp(M)'); 19 | set(0,'FormatSpacing',fmt) 20 | S = textscan(S,'%s','delimiter','\n','whitespace',''); 21 | S = S{1}; 22 | end 23 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/tt_size2str.m: -------------------------------------------------------------------------------- 1 | function s = tt_size2str(sz) 2 | %TT_SIZE2STR Convert size to a string that can be printed. 3 | % 4 | %MATLAB Tensor Toolbox. 5 | %Copyright 2010, Sandia Corporation. 6 | 7 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 8 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 9 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 10 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 11 | % work by or on behalf of the U.S. Government. Export of this data may 12 | % require a license from the United States Government. 13 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 14 | % $Id: tt_size2str.m,v 1.8 2010/03/19 23:46:31 tgkolda Exp $ 15 | 16 | if isempty(sz) 17 | s = sprintf('[empty tensor]'); 18 | return; 19 | end 20 | 21 | if numel(sz) == 1 22 | s = sprintf('%d',sz); 23 | else 24 | s = [sprintf('%d x ',sz(1:end-1)) sprintf('%d', sz(end)) ]; 25 | end 26 | 27 | -------------------------------------------------------------------------------- /lib/tensor_toolbox/tt_subsubsref.m: -------------------------------------------------------------------------------- 1 | function a = tt_subsubsref(obj,s) 2 | %TT_SUBSUBSREF Helper function for tensor toolbox subsref. 3 | % 4 | %MATLAB Tensor Toolbox. 5 | %Copyright 2010, Sandia Corporation. 6 | 7 | % This is the MATLAB Tensor Toolbox by Brett Bader and Tamara Kolda. 8 | % http://csmr.ca.sandia.gov/~tgkolda/TensorToolbox. 9 | % Copyright (2010) Sandia Corporation. Under the terms of Contract 10 | % DE-AC04-94AL85000, there is a non-exclusive license for use of this 11 | % work by or on behalf of the U.S. Government. Export of this data may 12 | % require a license from the United States Government. 13 | % The full license terms can be found in tensor_toolbox/LICENSE.txt 14 | % $Id: tt_subsubsref.m,v 1.8 2010/03/19 23:46:31 tgkolda Exp $ 15 | 16 | if length(s) == 1 17 | a = obj; 18 | else 19 | a = subsref(obj, s(2:end)); 20 | end 21 | 22 | -------------------------------------------------------------------------------- /lib/tensorlab/decimate.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensorlab/decimate.m -------------------------------------------------------------------------------- /lib/tensorlab/dedecimate.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensorlab/dedecimate.m -------------------------------------------------------------------------------- /lib/tensorlab/deloewnerize.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensorlab/deloewnerize.m -------------------------------------------------------------------------------- /lib/tensorlab/desegmentize.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensorlab/desegmentize.m -------------------------------------------------------------------------------- /lib/tensorlab/lmlra3_dgn.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensorlab/lmlra3_dgn.m -------------------------------------------------------------------------------- /lib/tensorlab/lmlrares.m: -------------------------------------------------------------------------------- 1 | function E = lmlrares(T,U,S,varargin) 2 | %LMLRARES Residual of a LMLRA. 3 | % E = lmlrares(T,U,S) computes the residual tensor E as lmlragen(U,S)-T. If T 4 | % is an incomplete tensor, the residual is only computed for known elements. 5 | % If T is an efficient representation of a structured tensor, T is first 6 | % expanded using ful(T). 7 | % 8 | % See also btdres, ll1res, cpdres, froblmlrares. 9 | 10 | % Authors: Laurent Sorber (Laurent.Sorber@cs.kuleuven.be) 11 | % Marc Van Barel (Marc.VanBarel@cs.kuleuven.be) 12 | % Lieven De Lathauwer (Lieven.DeLathauwer@kuleuven-kulak.be) 13 | 14 | % Compute the residual. 15 | E = btdres(T,{[U(:).',S]},varargin{:}); 16 | -------------------------------------------------------------------------------- /lib/tensorlab/loewnerize.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensorlab/loewnerize.m -------------------------------------------------------------------------------- /lib/tensorlab/scov.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensorlab/scov.m -------------------------------------------------------------------------------- /lib/tensorlab/segmentize.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensorlab/segmentize.m -------------------------------------------------------------------------------- /lib/tensorlab/struct_kr.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensorlab/struct_kr.m -------------------------------------------------------------------------------- /lib/tensorlab/userguide3.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/lib/tensorlab/userguide3.pdf -------------------------------------------------------------------------------- /result/pre_jasperRidge_10band.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/result/pre_jasperRidge_10band.mat -------------------------------------------------------------------------------- /result/pre_modeldrivenVSdatadriven.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/result/pre_modeldrivenVSdatadriven.png -------------------------------------------------------------------------------- /result/pre_synthetic_data_test_once.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/result/pre_synthetic_data_test_once.png -------------------------------------------------------------------------------- /result/pre_watercolors_MSI.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wc253/LTDL/90f3824dc579a95a18d142969ecd87264eb20211/result/pre_watercolors_MSI.png --------------------------------------------------------------------------------