├── CoheGroupDetect ├── KalmanFilter │ ├── KPMstats │ │ ├── CVS │ │ │ ├── Entries.Old │ │ │ ├── Template │ │ │ ├── Entries.Extra.Old │ │ │ ├── Repository │ │ │ └── Root │ │ ├── unidrndKPM.m~ │ │ ├── logist2ApplyRegularized.m │ │ ├── parzenC.dll │ │ ├── convertBinaryLabels.m │ │ ├── parzenC.mexglx │ │ ├── fit_paritioned_model_testfn.m │ │ ├── unidrndKPM.m │ │ ├── README.txt │ │ ├── chisquared_histo.m │ │ ├── normal_coef.m │ │ ├── unif_discrete_sample.m │ │ ├── parzenC_test.m │ │ ├── #histCmpChi2.m# │ │ ├── marginalize_gaussian.m │ │ ├── mk_unit_norm.m │ │ ├── KLgauss.m │ │ ├── matrix_normal_pdf.m │ │ ├── condgauss_sample.m │ │ ├── sample.m │ │ ├── logist2Apply.m │ │ ├── histCmpChi2.m~ │ │ ├── test_dir.m │ │ ├── histCmpChi2.m │ │ ├── clg_prob.m │ │ ├── logist2FitRegularized.m │ │ ├── matrix_T_pdf.m │ │ ├── standardize.m~ │ │ ├── standardize.m │ │ ├── student_t_logprob.m │ │ ├── est_transmat.m │ │ ├── mixgauss_classifier_apply.m │ │ ├── sample_gaussian.m │ │ ├── cwr_readme.txt │ │ ├── multinomial_prob.m │ │ ├── dirichlet_sample.m │ │ ├── mkPolyFvec.m │ │ ├── multinomial_sample.m │ │ ├── logist2Fit.m │ │ ├── student_t_prob.m │ │ ├── condGaussToJoint.m │ │ ├── gaussian_sample.m │ │ ├── mixgauss_sample.m │ │ ├── mc_stat_distrib.m │ │ ├── partial_corr_coef.m │ │ ├── gaussian_prob.m │ │ └── condgaussTrainObserved.m │ ├── KPMtools │ │ ├── CVS │ │ │ ├── Template │ │ │ ├── Repository │ │ │ └── Root │ │ ├── div.m │ │ ├── hungarian.m │ │ ├── repmatC.dll │ │ ├── colmult.mexglx │ │ ├── normaliseC.dll │ │ ├── plot_axis_thru_origin.m │ │ ├── repmatC.mexglx │ │ ├── logb.m │ │ ├── rectintLoopC.dll │ │ ├── ncols.m │ │ ├── nrows.m │ │ ├── rectintLoopC.mexglx │ │ ├── isscalar.m │ │ ├── rectintSparseLoopC.dll │ │ ├── safeStr.m │ │ ├── README.txt │ │ ├── logsum_test.m │ │ ├── choose.m │ │ ├── factorial.m │ │ ├── sampleUniformInts.m │ │ ├── wrap.m │ │ ├── installC_KPMtools.m │ │ ├── centeringMatrix.m │ │ ├── is_stochastic.m │ │ ├── logdet.m │ │ ├── hsvKPM.m │ │ ├── assert.m │ │ ├── myplot.m │ │ ├── pick.m │ │ ├── myrepmat.m │ │ ├── is_psd.m │ │ ├── sprintf_intvec.m │ │ ├── rgb2grayKPM.m │ │ ├── softeye.m │ │ ├── myones.m │ │ ├── myreshape.m │ │ ├── isvector.m │ │ ├── plotColors.m │ │ ├── plotColors.m~ │ │ ├── plotgauss1d.m │ │ ├── isposdef.m │ │ ├── mexutil.h │ │ ├── myrand.m │ │ ├── mysubset.m │ │ ├── mult_by_table.m │ │ ├── sumv.m │ │ ├── argmax.m │ │ ├── rand_psd.m │ │ ├── num2strcell.m │ │ ├── argmin.m │ │ ├── myismember.m │ │ ├── setdiag.m │ │ ├── subplot2.m │ │ ├── unaryEncoding.m │ │ ├── filepartsLast.m │ │ ├── filepartsLast.m~ │ │ ├── rnd_partition.m │ │ ├── entropy.m │ │ ├── optimalMatchingTest.m │ │ ├── optimalMatchingTest.m~ │ │ ├── block.m │ │ ├── isemptycell.m │ │ ├── subplot3.m │ │ ├── logsumexpv.m │ │ ├── mysetdiff.m │ │ ├── splitLongSeqIntoManyShort.m │ │ ├── approxeq.m │ │ ├── myunion.m │ │ ├── bipartiteMatchingDemoPlot.m~ │ │ ├── plotBox.m~ │ │ ├── cross_entropy.m │ │ ├── sort_evec.m │ │ ├── plot_ellipse.m │ │ ├── logsum_simple.m │ │ ├── hash_add.m │ │ ├── montageKPM3.m │ │ ├── mysize.m │ │ ├── myintersect.m │ │ ├── draw_ellipse_axes.m │ │ ├── plotBox.m │ │ ├── bipartiteMatchingDemoPlot.m │ │ ├── mk_multi_index.m │ │ ├── mysymsetdiff.m │ │ ├── rectintC.m │ │ ├── logsumexp.m │ │ ├── logsum.m │ │ ├── plot_polygon.m │ │ ├── find_equiv_posns.m │ │ ├── hash_del.m │ │ ├── partitionData.m │ │ ├── max_mult.m │ │ ├── compute_counts.m │ │ ├── polygon_area.m │ │ ├── normaliseC.c │ │ ├── draw_ellipse.m │ │ ├── assignEdgeNums.m │ │ ├── draw_circle.m │ │ ├── optimalMatchingIntProg.m~ │ │ ├── pca_kpm.m │ │ ├── partition_matrix_vec.m │ │ ├── assign_cols.m │ │ ├── sqdist.m │ │ ├── marg_table.m │ │ ├── rectintSparseC.m │ │ ├── plotROC.m │ │ ├── mk_stochastic.m │ │ ├── extend_domain_table.m │ │ ├── collapse_mog.m │ │ ├── image_rgb.m │ │ ├── mkdirKPM.m │ │ ├── strmatch_substr.m │ │ ├── normalise.m │ │ ├── normalize.m │ │ ├── approx_unique.m │ │ ├── hash_lookup.m │ │ ├── rotate_xlabel.m │ │ ├── set_xtick_label_demo.m │ │ ├── initFigures.m~ │ │ ├── nchoose2.m │ │ ├── bipartiteMatchingIntProg.m~ │ │ ├── subsets1.m │ │ └── subsets1.m~ │ └── Kalman │ │ ├── testKalman.m │ │ ├── ensure_AR.m │ │ ├── convert_to_lagged_form.m │ │ ├── README.txt │ │ ├── README.txt~ │ │ ├── SS_to_AR.m │ │ ├── learn_AR_diagonal.m │ │ └── learn_AR.m ├── fun_anchorTrk.m └── CoherentTrk │ └── CF_neighbor2pair.m ├── util ├── SVM │ ├── liblinear-1.93 │ │ ├── python │ │ │ └── Makefile │ │ ├── matlab │ │ │ ├── train.mexw64 │ │ │ ├── predict.mexw64 │ │ │ ├── libsvmread.mexw64 │ │ │ ├── libsvmwrite.mexw64 │ │ │ ├── linear_model_matlab.h │ │ │ └── make.m │ │ ├── windows │ │ │ ├── predict.exe │ │ │ ├── train.exe │ │ │ ├── liblinear.dll │ │ │ ├── train.mexw64 │ │ │ ├── predict.mexw64 │ │ │ ├── libsvmread.mexw64 │ │ │ └── libsvmwrite.mexw64 │ │ ├── blas │ │ │ ├── Makefile │ │ │ └── blas.h │ │ ├── linear.def │ │ ├── tron.h │ │ └── Makefile.win │ ├── libsvm-3.17 │ │ ├── python │ │ │ └── Makefile │ │ ├── java │ │ │ ├── test_applet.html │ │ │ ├── libsvm.jar │ │ │ ├── libsvm │ │ │ │ ├── svm_print_interface.java │ │ │ │ ├── svm_node.java │ │ │ │ ├── svm_problem.java │ │ │ │ └── svm_model.java │ │ │ └── Makefile │ │ ├── windows │ │ │ ├── libsvm.dll │ │ │ ├── svm-toy.exe │ │ │ ├── svm-scale.exe │ │ │ ├── svm-train.exe │ │ │ ├── svm-predict.exe │ │ │ ├── svmtrain.mexw64 │ │ │ ├── libsvmread.mexw64 │ │ │ ├── libsvmwrite.mexw64 │ │ │ └── svmpredict.mexw64 │ │ ├── matlab │ │ │ ├── svmtrain.mexw64 │ │ │ ├── libsvmread.mexw64 │ │ │ ├── svmpredict.mexw64 │ │ │ ├── libsvmwrite.mexw64 │ │ │ ├── svm_model_matlab.h │ │ │ └── make.m │ │ ├── svm-toy │ │ │ ├── gtk │ │ │ │ ├── interface.h │ │ │ │ ├── main.c │ │ │ │ └── Makefile │ │ │ └── qt │ │ │ │ └── Makefile │ │ ├── svm.def │ │ └── Makefile │ ├── liblinear.pdf │ └── A Practical Guide to Support Vector Classication.pdf ├── PG_Curve-master │ ├── main.m │ ├── ReadMe.txt │ ├── name_class.mat │ ├── actual_label.mat │ ├── num_in_class.mat │ ├── predict_label.mat │ ├── decision_values.mat │ ├── ConfusionMatrices │ │ ├── draw_cm.m │ │ └── compute_confusion_matrix.m │ ├── PrecisionRecall │ │ ├── draw_prc.m │ │ └── compute_precision_recall.m │ └── AccuracyF │ │ └── compute_accuracy_F.m ├── fun_curX.m ├── fun_curX_preprocess.m ├── dist2.m └── fun_trkInfo.m ├── gt_labels.mat ├── video_info_t0.xls ├── gt_videoName_bool.mat ├── result_groupDescr ├── purityMean.mat ├── stab_rankKnn.mat ├── collectiveness.mat ├── stab_graph_hist.mat ├── stab_invKnnNum.mat ├── groupSizePercent_max.mat └── CodeVector_kmeans_max_pooling.mat ├── 1_8_groupSplit-festivalwalk_1_2-1 ├── 000000.jpg ├── 000001.jpg ├── 000002.jpg ├── 000003.jpg ├── 000004.jpg ├── 000005.jpg ├── 000006.jpg ├── 000007.jpg ├── 000008.jpg ├── 000009.jpg ├── 000010.jpg ├── 000011.jpg ├── 000012.jpg ├── 000013.jpg ├── 000014.jpg ├── 000015.jpg ├── 000016.jpg ├── 000017.jpg ├── 000018.jpg ├── 000019.jpg ├── 000020.jpg ├── 000021.jpg ├── 000022.jpg ├── 000023.jpg ├── 000024.jpg ├── 000025.jpg ├── 000026.jpg ├── 000027.jpg ├── 000028.jpg ├── 000029.jpg ├── 000030.jpg ├── 000031.jpg ├── 000032.jpg ├── 000033.jpg ├── 000034.jpg ├── 000035.jpg ├── 000036.jpg ├── 000037.jpg ├── 000038.jpg ├── 000039.jpg ├── 000040.jpg ├── 000041.jpg ├── 000042.jpg ├── 000043.jpg ├── 000044.jpg ├── 000045.jpg ├── 000046.jpg ├── 000047.jpg ├── 000048.jpg ├── 000049.jpg ├── 000050.jpg ├── 000051.jpg ├── 000052.jpg ├── 000053.jpg ├── 000054.jpg ├── 000055.jpg ├── 000056.jpg ├── 000057.jpg ├── 000058.jpg ├── 000059.jpg ├── 000060.jpg ├── 000061.jpg ├── 000062.jpg ├── 000063.jpg ├── 000064.jpg ├── 000065.jpg ├── 000066.jpg ├── 000067.jpg ├── 000068.jpg ├── 000069.jpg ├── 000070.jpg ├── 000071.jpg ├── 000072.jpg ├── 000073.jpg ├── 000074.jpg ├── 000075.jpg ├── 000076.jpg ├── 000077.jpg ├── 000078.jpg ├── 000079.jpg ├── 000080.jpg ├── 000081.jpg ├── 000082.jpg ├── 000083.jpg ├── 000084.jpg ├── 000085.jpg ├── 000086.jpg ├── 000087.jpg ├── 000088.jpg ├── 000089.jpg ├── 000090.jpg ├── 000091.jpg ├── 000092.jpg ├── 000093.jpg ├── 000094.jpg ├── 000095.jpg ├── 000096.jpg ├── 000097.jpg ├── 000098.jpg ├── 000099.jpg ├── 000100.jpg ├── 000101.jpg ├── 000102.jpg ├── 000103.jpg ├── 000104.jpg ├── 000105.jpg ├── 000106.jpg ├── 000107.jpg ├── trks_1.mat ├── trks_2.mat ├── trks_3.mat ├── trks_1_smooth.mat ├── trks_2_smooth.mat ├── trks_3_smooth.mat ├── A_1_1_8_groupSplit-festivalwalk_1_2-1.mat ├── trks_1_8_groupSplit-festivalwalk_1_2-1.mat ├── color_1_1_8_groupSplit-festivalwalk_1_2-1.mat ├── group_1_1_8_groupSplit-festivalwalk_1_2-1.mat ├── t_seq_1_1_8_groupSplit-festivalwalk_1_2-1.mat ├── group_id_1_1_8_groupSplit-festivalwalk_1_2-1.mat └── trkClusterTimeLine_1_1_8_groupSplit-festivalwalk_1_2-1.mat ├── descriptor ├── gr_stability │ └── RandomWalks │ │ ├── DemoData.mat │ │ ├── Demo_Image.gif │ │ ├── RandomWalks.png │ │ ├── html │ │ ├── RandomWalks.png │ │ ├── RandomWalks_01.png │ │ ├── RandomWalks_02.png │ │ ├── RandomWalks_03.png │ │ ├── RandomWalks_04.png │ │ ├── RandomWalks_05.png │ │ ├── RandomWalks_06.png │ │ ├── RandomWalks_07.png │ │ ├── RandomWalks_08.png │ │ ├── RandomWalks_09.png │ │ ├── RandomWalks_eq06570.png │ │ ├── RandomWalks_eq24049.png │ │ ├── RandomWalks_eq27924.png │ │ ├── RandomWalks_eq27941.png │ │ ├── RandomWalks_eq28134.png │ │ ├── RandomWalks_eq40747.png │ │ ├── RandomWalks_eq53776.png │ │ ├── RandomWalks_eq69739.png │ │ ├── RandomWalks_eq70849.png │ │ ├── RandomWalks_eq79464.png │ │ ├── RandomWalks_eq79749.png │ │ ├── RandomWalks_eq81000.png │ │ ├── RandomWalks_eq81966.png │ │ └── RandomWalks_eq94611.png │ │ ├── RandDir.m │ │ └── RandomGraphMove.m ├── gactoolbox │ ├── mexfiles │ │ ├── gacLlinks_c.mexw64 │ │ ├── gacOnelink_c.mexw64 │ │ ├── gacPartial_sort.mexw64 │ │ ├── gacPartialMin_knn_c.mexw64 │ │ ├── gacPartialMin_triu_c.mexw64 │ │ ├── compileMexFiles.m │ │ ├── gacFindKcCluster.m │ │ └── gacMink.m │ └── gdlfiles │ │ ├── gdlAffinity_c.mexw64 │ │ ├── gdlDirectedAffinity_c.mexw64 │ │ ├── gdlInitAffinityTable_c.mexw64 │ │ ├── gdlDirectedAffinity_batch_c.mexw64 │ │ ├── gdlInitAffinityTable_knn_c.mexw64 │ │ ├── gdlCompileMex.m │ │ ├── gdlDirectedAffinity.m │ │ ├── gdlAffinity_increment.m │ │ └── gdlAffinity.m └── gr_conflict │ └── conflict_dict │ ├── fast_sc │ ├── code │ │ ├── sc2 │ │ │ ├── cgf_sc2.dll │ │ │ ├── cgf_sc2.mexa64 │ │ │ ├── cgf_sc2.mexglx │ │ │ ├── makefile.linux │ │ │ ├── makefile.win32 │ │ │ └── nrf │ │ │ │ ├── getreent.c │ │ │ │ ├── makefile.win32 │ │ │ │ ├── makefile.linux │ │ │ │ ├── README │ │ │ │ ├── impure.c │ │ │ │ └── linmin.c │ │ ├── save_figures.m │ │ ├── demo_fast_sc.m │ │ └── display_figures.m │ ├── results │ │ ├── sc_b500_20120409T130706.mat │ │ ├── sc_b500_20120414T170951.mat │ │ └── sc_b500_20130508T035402.mat │ └── README │ ├── litekmeans.m │ └── fun_codebook_computation.m ├── .gitattributes ├── .gitignore └── main_gr.m /CoheGroupDetect/KalmanFilter/KPMstats/CVS/Entries.Old: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/CVS/Template: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/CVS/Template: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/CVS/Entries.Extra.Old: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/CVS/Repository: -------------------------------------------------------------------------------- 1 | KPMstats 2 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/CVS/Repository: -------------------------------------------------------------------------------- 1 | KPMtools 2 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/Kalman/testKalman.m: -------------------------------------------------------------------------------- 1 | tracking_demo 2 | learning_demo 3 | -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/python/Makefile: -------------------------------------------------------------------------------- 1 | all = lib 2 | 3 | lib: 4 | make -C .. lib 5 | -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/python/Makefile: -------------------------------------------------------------------------------- 1 | all = lib 2 | 3 | lib: 4 | make -C .. lib 5 | -------------------------------------------------------------------------------- /gt_labels.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/gt_labels.mat -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/CVS/Root: -------------------------------------------------------------------------------- 1 | :ext:murphyk@remote.cs.ubc.ca:/ai/murphyk/cvsroot 2 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/CVS/Root: -------------------------------------------------------------------------------- 1 | :ext:murphyk@remote.cs.ubc.ca:/ai/murphyk/cvsroot 2 | -------------------------------------------------------------------------------- /video_info_t0.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/video_info_t0.xls -------------------------------------------------------------------------------- /gt_videoName_bool.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/gt_videoName_bool.mat -------------------------------------------------------------------------------- /util/SVM/liblinear.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/liblinear.pdf -------------------------------------------------------------------------------- /util/PG_Curve-master/main.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/PG_Curve-master/main.m -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/java/test_applet.html: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /result_groupDescr/purityMean.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/result_groupDescr/purityMean.mat -------------------------------------------------------------------------------- /util/PG_Curve-master/ReadMe.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/PG_Curve-master/ReadMe.txt -------------------------------------------------------------------------------- /result_groupDescr/stab_rankKnn.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/result_groupDescr/stab_rankKnn.mat -------------------------------------------------------------------------------- /util/PG_Curve-master/name_class.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/PG_Curve-master/name_class.mat -------------------------------------------------------------------------------- /result_groupDescr/collectiveness.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/result_groupDescr/collectiveness.mat -------------------------------------------------------------------------------- /result_groupDescr/stab_graph_hist.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/result_groupDescr/stab_graph_hist.mat -------------------------------------------------------------------------------- /result_groupDescr/stab_invKnnNum.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/result_groupDescr/stab_invKnnNum.mat -------------------------------------------------------------------------------- /util/PG_Curve-master/actual_label.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/PG_Curve-master/actual_label.mat -------------------------------------------------------------------------------- /util/PG_Curve-master/num_in_class.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/PG_Curve-master/num_in_class.mat -------------------------------------------------------------------------------- /util/PG_Curve-master/predict_label.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/PG_Curve-master/predict_label.mat -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/java/libsvm.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/libsvm-3.17/java/libsvm.jar -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/unidrndKPM.m~: -------------------------------------------------------------------------------- 1 | function R = unidrndKPM(min, max, nr, nc) 2 | 3 | R = unidrnd(max-min+1, nr, nc) + (min-1); 4 | -------------------------------------------------------------------------------- /util/PG_Curve-master/decision_values.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/PG_Curve-master/decision_values.mat -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/windows/libsvm.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/libsvm-3.17/windows/libsvm.dll -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/windows/svm-toy.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/libsvm-3.17/windows/svm-toy.exe -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/div.m: -------------------------------------------------------------------------------- 1 | function d = div(a,b) 2 | % DIV Integer division 3 | % d = div(a,b) 4 | 5 | d = floor(a / b); 6 | -------------------------------------------------------------------------------- /result_groupDescr/groupSizePercent_max.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/result_groupDescr/groupSizePercent_max.mat -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/matlab/train.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/liblinear-1.93/matlab/train.mexw64 -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/windows/predict.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/liblinear-1.93/windows/predict.exe -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/windows/train.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/liblinear-1.93/windows/train.exe -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/matlab/svmtrain.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/libsvm-3.17/matlab/svmtrain.mexw64 -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/windows/svm-scale.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/libsvm-3.17/windows/svm-scale.exe -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/windows/svm-train.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/libsvm-3.17/windows/svm-train.exe -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000000.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000000.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000001.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000002.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000003.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000004.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000005.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000006.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000007.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000008.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000008.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000009.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000010.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000011.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000011.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000012.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000013.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000013.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000014.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000014.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000015.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000015.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000016.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000017.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000018.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000018.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000019.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000019.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000020.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000020.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000021.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000021.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000022.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000022.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000023.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000023.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000024.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000024.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000025.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000025.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000026.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000026.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000027.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000027.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000028.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000028.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000029.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000029.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000030.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000030.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000031.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000031.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000032.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000032.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000033.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000033.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000034.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000034.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000035.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000035.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000036.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000036.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000037.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000037.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000038.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000038.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000039.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000039.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000040.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000040.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000041.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000041.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000042.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000042.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000043.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000043.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000044.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000044.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000045.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000045.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000046.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000046.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000047.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000047.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000048.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000048.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000049.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000049.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000050.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000050.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000051.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000051.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000052.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000052.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000053.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000053.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000054.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000054.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000055.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000055.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000056.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000056.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000057.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000057.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000058.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000058.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000059.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000059.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000060.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000060.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000061.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000061.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000062.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000062.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000063.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000063.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000064.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000064.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000065.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000065.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000066.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000066.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000067.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000067.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000068.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000068.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000069.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000069.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000070.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000070.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000071.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000071.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000072.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000072.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000073.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000073.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000074.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000074.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000075.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000075.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000076.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000076.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000077.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000077.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000078.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000078.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000079.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000079.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000080.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000080.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000081.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000081.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000082.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000082.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000083.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000083.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000084.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000084.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000085.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000085.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000086.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000086.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000087.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000087.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000088.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000088.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000089.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000089.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000090.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000090.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000091.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000091.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000092.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000092.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000093.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000093.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000094.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000094.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000095.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000095.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000096.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000096.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000097.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000097.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000098.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000098.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000099.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000099.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000100.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000100.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000101.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000101.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000102.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000102.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000103.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000103.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000104.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000104.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000105.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000105.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000106.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000106.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/000107.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/000107.jpg -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/trks_1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/trks_1.mat -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/trks_2.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/trks_2.mat -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/trks_3.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/trks_3.mat -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/matlab/predict.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/liblinear-1.93/matlab/predict.mexw64 -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/windows/liblinear.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/liblinear-1.93/windows/liblinear.dll -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/windows/train.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/liblinear-1.93/windows/train.mexw64 -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/matlab/libsvmread.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/libsvm-3.17/matlab/libsvmread.mexw64 -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/matlab/svmpredict.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/libsvm-3.17/matlab/svmpredict.mexw64 -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/windows/svm-predict.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/libsvm-3.17/windows/svm-predict.exe -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/windows/svmtrain.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/libsvm-3.17/windows/svmtrain.mexw64 -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/logist2ApplyRegularized.m: -------------------------------------------------------------------------------- 1 | function prob = logist2ApplyRegularized(net, features) 2 | 3 | prob = glmfwd(net, features')'; 4 | -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/DemoData.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/DemoData.mat -------------------------------------------------------------------------------- /util/PG_Curve-master/ConfusionMatrices/draw_cm.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/PG_Curve-master/ConfusionMatrices/draw_cm.m -------------------------------------------------------------------------------- /util/PG_Curve-master/PrecisionRecall/draw_prc.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/PG_Curve-master/PrecisionRecall/draw_prc.m -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/matlab/libsvmread.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/liblinear-1.93/matlab/libsvmread.mexw64 -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/windows/predict.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/liblinear-1.93/windows/predict.mexw64 -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/matlab/libsvmwrite.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/libsvm-3.17/matlab/libsvmwrite.mexw64 -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/windows/libsvmread.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/libsvm-3.17/windows/libsvmread.mexw64 -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/windows/libsvmwrite.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/libsvm-3.17/windows/libsvmwrite.mexw64 -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/windows/svmpredict.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/libsvm-3.17/windows/svmpredict.mexw64 -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/parzenC.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/CoheGroupDetect/KalmanFilter/KPMstats/parzenC.dll -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/hungarian.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/CoheGroupDetect/KalmanFilter/KPMtools/hungarian.m -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/repmatC.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/CoheGroupDetect/KalmanFilter/KPMtools/repmatC.dll -------------------------------------------------------------------------------- /descriptor/gactoolbox/mexfiles/gacLlinks_c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gactoolbox/mexfiles/gacLlinks_c.mexw64 -------------------------------------------------------------------------------- /descriptor/gactoolbox/mexfiles/gacOnelink_c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gactoolbox/mexfiles/gacOnelink_c.mexw64 -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/Demo_Image.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/Demo_Image.gif -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/matlab/libsvmwrite.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/liblinear-1.93/matlab/libsvmwrite.mexw64 -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/windows/libsvmread.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/liblinear-1.93/windows/libsvmread.mexw64 -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/windows/libsvmwrite.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/liblinear-1.93/windows/libsvmwrite.mexw64 -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/java/libsvm/svm_print_interface.java: -------------------------------------------------------------------------------- 1 | package libsvm; 2 | public interface svm_print_interface 3 | { 4 | public void print(String s); 5 | } 6 | -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/trks_1_smooth.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/trks_1_smooth.mat -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/trks_2_smooth.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/trks_2_smooth.mat -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/trks_3_smooth.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/trks_3_smooth.mat -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/convertBinaryLabels.m: -------------------------------------------------------------------------------- 1 | % labels01 = (labelsPM+1)/2; % maps -1->0, +1->1 2 | % labelsPM = (2*labels01)-1; % maps 0,1 -> -1,1 3 | 4 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/parzenC.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/CoheGroupDetect/KalmanFilter/KPMstats/parzenC.mexglx -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/colmult.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/CoheGroupDetect/KalmanFilter/KPMtools/colmult.mexglx -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/normaliseC.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/CoheGroupDetect/KalmanFilter/KPMtools/normaliseC.dll -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/plot_axis_thru_origin.m: -------------------------------------------------------------------------------- 1 | function plot_axis_thru_origin() 2 | 3 | lnx=line(get(gca,'xlim'),[0 0]); lny=line([0 0],get(gca,'ylim')); 4 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/repmatC.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/CoheGroupDetect/KalmanFilter/KPMtools/repmatC.mexglx -------------------------------------------------------------------------------- /descriptor/gactoolbox/gdlfiles/gdlAffinity_c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gactoolbox/gdlfiles/gdlAffinity_c.mexw64 -------------------------------------------------------------------------------- /descriptor/gactoolbox/mexfiles/gacPartial_sort.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gactoolbox/mexfiles/gacPartial_sort.mexw64 -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/RandomWalks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/RandomWalks.png -------------------------------------------------------------------------------- /result_groupDescr/CodeVector_kmeans_max_pooling.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/result_groupDescr/CodeVector_kmeans_max_pooling.mat -------------------------------------------------------------------------------- /util/PG_Curve-master/AccuracyF/compute_accuracy_F.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/PG_Curve-master/AccuracyF/compute_accuracy_F.m -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/logb.m: -------------------------------------------------------------------------------- 1 | function x = logb(y, base) 2 | % logb - logarithm to base b 3 | % function x = logb(y, base) 4 | 5 | x = log(y) ./ log(base); 6 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/rectintLoopC.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/CoheGroupDetect/KalmanFilter/KPMtools/rectintLoopC.dll -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/ncols.m: -------------------------------------------------------------------------------- 1 | function c = cols(x) 2 | % COLS The number of columns. 3 | % COLS is a more readable alternative to size(x,2). 4 | c = size(x,2); 5 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/nrows.m: -------------------------------------------------------------------------------- 1 | function r = rows(x) 2 | % ROWS The number of rows. 3 | % ROWS is a more readable alternative to size(x,1). 4 | r = size(x,1); 5 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/rectintLoopC.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/CoheGroupDetect/KalmanFilter/KPMtools/rectintLoopC.mexglx -------------------------------------------------------------------------------- /descriptor/gactoolbox/mexfiles/gacPartialMin_knn_c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gactoolbox/mexfiles/gacPartialMin_knn_c.mexw64 -------------------------------------------------------------------------------- /descriptor/gactoolbox/mexfiles/gacPartialMin_triu_c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gactoolbox/mexfiles/gacPartialMin_triu_c.mexw64 -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks.png -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/fit_paritioned_model_testfn.m: -------------------------------------------------------------------------------- 1 | function model = foo(inputs, outputs, varargin) 2 | 3 | model.inputs = inputs; 4 | model.outputs = outputs; 5 | 6 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/isscalar.m: -------------------------------------------------------------------------------- 1 | function p = isscalar(v) 2 | % ISSCALAR Returns 1 if all dimensions have size 1. 3 | % p = isscalar(v) 4 | 5 | p = (prod(size(v))==1); 6 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/rectintSparseLoopC.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/CoheGroupDetect/KalmanFilter/KPMtools/rectintSparseLoopC.dll -------------------------------------------------------------------------------- /descriptor/gactoolbox/gdlfiles/gdlDirectedAffinity_c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gactoolbox/gdlfiles/gdlDirectedAffinity_c.mexw64 -------------------------------------------------------------------------------- /descriptor/gactoolbox/gdlfiles/gdlInitAffinityTable_c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gactoolbox/gdlfiles/gdlInitAffinityTable_c.mexw64 -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_01.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_01.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_02.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_02.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_03.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_03.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_04.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_04.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_05.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_05.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_06.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_06.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_07.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_07.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_08.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_08.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_09.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_09.png -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/java/libsvm/svm_node.java: -------------------------------------------------------------------------------- 1 | package libsvm; 2 | public class svm_node implements java.io.Serializable 3 | { 4 | public int index; 5 | public double value; 6 | } 7 | -------------------------------------------------------------------------------- /util/PG_Curve-master/PrecisionRecall/compute_precision_recall.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/PG_Curve-master/PrecisionRecall/compute_precision_recall.m -------------------------------------------------------------------------------- /util/SVM/A Practical Guide to Support Vector Classication.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/SVM/A Practical Guide to Support Vector Classication.pdf -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/safeStr.m: -------------------------------------------------------------------------------- 1 | function s = safeStr(s) 2 | % Change punctuation characters to they print properly 3 | 4 | s = strrep(s, '\', '/'); 5 | s = strrep(s, '_', '-'); 6 | -------------------------------------------------------------------------------- /descriptor/gactoolbox/gdlfiles/gdlDirectedAffinity_batch_c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gactoolbox/gdlfiles/gdlDirectedAffinity_batch_c.mexw64 -------------------------------------------------------------------------------- /descriptor/gactoolbox/gdlfiles/gdlInitAffinityTable_knn_c.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gactoolbox/gdlfiles/gdlInitAffinityTable_knn_c.mexw64 -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/code/sc2/cgf_sc2.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_conflict/conflict_dict/fast_sc/code/sc2/cgf_sc2.dll -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_eq06570.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_eq06570.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_eq24049.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_eq24049.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_eq27924.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_eq27924.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_eq27941.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_eq27941.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_eq28134.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_eq28134.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_eq40747.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_eq40747.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_eq53776.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_eq53776.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_eq69739.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_eq69739.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_eq70849.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_eq70849.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_eq79464.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_eq79464.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_eq79749.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_eq79749.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_eq81000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_eq81000.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_eq81966.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_eq81966.png -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/html/RandomWalks_eq94611.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_stability/RandomWalks/html/RandomWalks_eq94611.png -------------------------------------------------------------------------------- /util/PG_Curve-master/ConfusionMatrices/compute_confusion_matrix.m: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/util/PG_Curve-master/ConfusionMatrices/compute_confusion_matrix.m -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/unidrndKPM.m: -------------------------------------------------------------------------------- 1 | function R = unidrndKPM(min, max, nr, nc) 2 | 3 | if nargin < 3 4 | nr = 1; nc = 1; 5 | end 6 | 7 | R = unidrnd(max-min+1, nr, nc) + (min-1); 8 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/code/sc2/cgf_sc2.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_conflict/conflict_dict/fast_sc/code/sc2/cgf_sc2.mexa64 -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/code/sc2/cgf_sc2.mexglx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_conflict/conflict_dict/fast_sc/code/sc2/cgf_sc2.mexglx -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/README.txt: -------------------------------------------------------------------------------- 1 | KPMtools is a directory of miscellaneous matlab functions written by 2 | Kevin Patrick Murphy and various other people (see individual file headers). 3 | 4 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/logsum_test.m: -------------------------------------------------------------------------------- 1 | p1 = log(1e-5); 2 | p2 = log(5*1e-6); 3 | p3 = log(sum(exp([p1 p2]))) 4 | p4 = logsumexp([p1 p2],2) 5 | p5 = logsum([p1 p2]) 6 | p6 = logsum([p1 p2]) 7 | -------------------------------------------------------------------------------- /descriptor/gactoolbox/mexfiles/compileMexFiles.m: -------------------------------------------------------------------------------- 1 | 2 | mex -O gacLlinks_c.cpp 3 | mex -O gacOnelink_c.cpp 4 | mex -O gacPartial_sort.cpp 5 | mex -O gacPartialMin_knn_c.cpp 6 | mex -O gacPartialMin_triu_c.cpp -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/java/libsvm/svm_problem.java: -------------------------------------------------------------------------------- 1 | package libsvm; 2 | public class svm_problem implements java.io.Serializable 3 | { 4 | public int l; 5 | public double[] y; 6 | public svm_node[][] x; 7 | } 8 | -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/A_1_1_8_groupSplit-festivalwalk_1_2-1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/A_1_1_8_groupSplit-festivalwalk_1_2-1.mat -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/README.txt: -------------------------------------------------------------------------------- 1 | KPMstats is a directory of miscellaneous statistics functions written by 2 | Kevin Patrick Murphy and various other people (see individual file headers). 3 | 4 | 5 | -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/trks_1_8_groupSplit-festivalwalk_1_2-1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/trks_1_8_groupSplit-festivalwalk_1_2-1.mat -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/choose.m: -------------------------------------------------------------------------------- 1 | function c = choose(n,k) 2 | % CHOOSE The number of ways of choosing k things from n 3 | % c = choose(n,k) 4 | 5 | c = factorial(n)/(factorial(k) * factorial(n-k)); 6 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/factorial.m: -------------------------------------------------------------------------------- 1 | function x = factorial(n) 2 | % FACTORIAL Compute n! 3 | % x = factorial(n) 4 | 5 | if n == 0 6 | x = 1; 7 | else 8 | x = n*factorial(n-1); 9 | end 10 | -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/color_1_1_8_groupSplit-festivalwalk_1_2-1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/color_1_1_8_groupSplit-festivalwalk_1_2-1.mat -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/group_1_1_8_groupSplit-festivalwalk_1_2-1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/group_1_1_8_groupSplit-festivalwalk_1_2-1.mat -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/t_seq_1_1_8_groupSplit-festivalwalk_1_2-1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/t_seq_1_1_8_groupSplit-festivalwalk_1_2-1.mat -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/sampleUniformInts.m: -------------------------------------------------------------------------------- 1 | function M = sampleUniformInts(N, r, c) 2 | 3 | % M is an rxc matrix of integers in 1..N 4 | 5 | prob = normalize(ones(N,1)); 6 | M = sample_discrete(prob, r, c); 7 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/code/sc2/makefile.linux: -------------------------------------------------------------------------------- 1 | MEX = mex 2 | NRFDIR = ./nrf 3 | 4 | all: cgf_sc.c 5 | make -C nrf -f makefile.linux 6 | $(MEX) -I$(NRFDIR) -L$(NRFDIR) -lnrfopt cgf_sc.c -o cgf_sc2 7 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/results/sc_b500_20120409T130706.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_conflict/conflict_dict/fast_sc/results/sc_b500_20120409T130706.mat -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/results/sc_b500_20120414T170951.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_conflict/conflict_dict/fast_sc/results/sc_b500_20120414T170951.mat -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/results/sc_b500_20130508T035402.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/descriptor/gr_conflict/conflict_dict/fast_sc/results/sc_b500_20130508T035402.mat -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/matlab/linear_model_matlab.h: -------------------------------------------------------------------------------- 1 | const char *model_to_matlab_structure(mxArray *plhs[], struct model *model_); 2 | const char *matlab_matrix_to_model(struct model *model_, const mxArray *matlab_struct); 3 | -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/group_id_1_1_8_groupSplit-festivalwalk_1_2-1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/group_id_1_1_8_groupSplit-festivalwalk_1_2-1.mat -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/wrap.m: -------------------------------------------------------------------------------- 1 | function v = wrap(u,N) 2 | % WRAP Wrap a vector of indices around a torus. 3 | % v = wrap(u,N) 4 | % 5 | % e.g., wrap([-1 0 1 2 3 4], 3) = 2 3 1 2 3 1 6 | 7 | v = mod(u-1,N)+1; 8 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/installC_KPMtools.m: -------------------------------------------------------------------------------- 1 | mex ind2subv.c 2 | mex subv2ind.c 3 | mex normalise.c 4 | mex -c mexutil.c 5 | if ~isunix 6 | mex repmatC.c mexutil.obj 7 | else 8 | mex repmatC.c mexutil.o 9 | end 10 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/centeringMatrix.m: -------------------------------------------------------------------------------- 1 | N = 3; 2 | x = rand(N,2); % each row is a feature vector 3 | m = mean(x,1); 4 | xc = x-repmat(m, N, 1); 5 | 6 | C = eye(N) - (1/N)*ones(N,N); 7 | xc2 = C*x; 8 | assert(approxeq(xc, xc2)) 9 | -------------------------------------------------------------------------------- /1_8_groupSplit-festivalwalk_1_2-1/trkClusterTimeLine_1_1_8_groupSplit-festivalwalk_1_2-1.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/amandajshao/crowd_group_profile/HEAD/1_8_groupSplit-festivalwalk_1_2-1/trkClusterTimeLine_1_1_8_groupSplit-festivalwalk_1_2-1.mat -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/matlab/svm_model_matlab.h: -------------------------------------------------------------------------------- 1 | const char *model_to_matlab_structure(mxArray *plhs[], int num_of_feature, struct svm_model *model); 2 | struct svm_model *matlab_matrix_to_model(const mxArray *matlab_struct, const char **error_message); 3 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/is_stochastic.m: -------------------------------------------------------------------------------- 1 | function p = is_stochastic(T) 2 | % IS_STOCHASTIC Is the argument a stochastic matrix, i.e., the sum over the last dimension is 1. 3 | % p = is_stochastic(T) 4 | 5 | p = approxeq(T, mk_stochastic(T)); 6 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/chisquared_histo.m: -------------------------------------------------------------------------------- 1 | function s = chisquared_histo(h1, h2) 2 | % Measure distance between 2 histograms (small numbers means more similar) 3 | denom = h1 + h2; 4 | denom = denom + (denom==0); 5 | s = sum(((h1 - h2) .^ 2) ./ denom); 6 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/code/sc2/makefile.win32: -------------------------------------------------------------------------------- 1 | MEX = C:\MATLAB6p5\bin\win32\mex.bat #mex 2 | NRFDIR = ./nrf 3 | MEXT = dll 4 | 5 | all: cgf_sc.c 6 | make -C nrf -f makefile.win32 7 | $(MEX) -I$(NRFDIR) cgf_sc.c nrf/libnrfopt.a -output cgf_sc2 8 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/normal_coef.m: -------------------------------------------------------------------------------- 1 | function c = normal_coef (Sigma) 2 | % NORMAL_COEF Compute the normalizing coefficient for a multivariate gaussian. 3 | % c = normal_coef (Sigma) 4 | 5 | n = length(Sigma); 6 | c = (2*pi)^(-n/2) * det(Sigma)^(-0.5); 7 | 8 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/logdet.m: -------------------------------------------------------------------------------- 1 | function y = logdet(A) 2 | % log(det(A)) where A is positive-definite. 3 | % This is faster and more stable than using log(det(A)). 4 | 5 | % From Tom Minka's lightspeed toolbox 6 | 7 | U = chol(A); 8 | y = 2*sum(log(diag(U))); 9 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/code/sc2/nrf/getreent.c: -------------------------------------------------------------------------------- 1 | /* default reentrant pointer when multithread enabled */ 2 | 3 | #include <_ansi.h> 4 | #include 5 | 6 | struct _reent * 7 | _DEFUN_VOID(__getreent) 8 | { 9 | return _impure_ptr; 10 | } 11 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/hsvKPM.m: -------------------------------------------------------------------------------- 1 | function colors = hsvKPM(N) 2 | % hsvKPM Like built-in HSV, except it randomizes the order, so that adjacent colors are dis-similar 3 | % function colors = hsvKPM(N) 4 | 5 | colors = hsv(N); 6 | perm = randperm(N); 7 | colors = colors(perm,:); 8 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/assert.m: -------------------------------------------------------------------------------- 1 | function assert(pred, str) 2 | % ASSERT Raise an error if the predicate is not true. 3 | % assert(pred, string) 4 | 5 | if nargin<2, str = ''; end 6 | 7 | if ~pred 8 | s = sprintf('assertion violated: %s', str); 9 | error(s); 10 | end 11 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/myplot.m: -------------------------------------------------------------------------------- 1 | colors = ['r' 'b' 'k' 'g' 'c' 'y' 'm' ... 2 | 'r' 'b' 'k' 'g' 'c' 'y' 'm']; 3 | symbols = ['o' 'x' 's' '>' '<' '^' 'v' ... 4 | '*' 'p' 'h' '+' 'd' 'o' 'x']; 5 | for i=1:length(colors) 6 | styles{i} = sprintf('-%s%s', colors(i), symbols(i)); 7 | end 8 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/pick.m: -------------------------------------------------------------------------------- 1 | function [i,j] = pick(ndx) 2 | % PICK Pick an entry at random from a vector 3 | % function [i,j] = pick(ndx) 4 | % 5 | % i = ndx(j) for j ~ U(1:length(ndx)) 6 | 7 | dist = normalize(ones(1,length(ndx))); 8 | j = sample_discrete(dist); 9 | i = ndx(j); 10 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/myrepmat.m: -------------------------------------------------------------------------------- 1 | function T = myrepmat(T, sizes) 2 | % MYREPMAT Like the built-in repmat, except myrepmat(T,n) == repmat(T,[n 1]) 3 | % T = myrepmat(T, sizes) 4 | 5 | if length(sizes)==1 6 | T = repmat(T, [sizes 1]); 7 | else 8 | T = repmat(T, sizes(:)'); 9 | end 10 | -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/svm-toy/gtk/interface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE - it is generated by Glade. 3 | */ 4 | 5 | #ifdef __cplusplus 6 | extern "C" { 7 | #endif 8 | 9 | GtkWidget* create_window (void); 10 | GtkWidget* create_fileselection (void); 11 | 12 | #ifdef __cplusplus 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/is_psd.m: -------------------------------------------------------------------------------- 1 | function b = positive_semidefinite(M) 2 | % 3 | % Return true iff v M v' >= 0 for any vector v. 4 | % We do this by checking that all the eigenvalues are non-negative. 5 | 6 | E = eig(M); 7 | if length(find(E>=0)) == length(E) 8 | b = 1; 9 | else 10 | b = 0; 11 | end 12 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/unif_discrete_sample.m: -------------------------------------------------------------------------------- 1 | function r = unif_discrete_sample(n, nrows, ncols) 2 | % UNIF_DISCRETE_SAMPLE Generate random numbers uniformly from {1,2,..,n} 3 | % function r = unif_discrete_sample(n, nrows, ncols) 4 | % Same as unidrnd in the stats toolbox. 5 | 6 | r = ceil(n .* rand(nrows,ncols)); 7 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/parzenC_test.m: -------------------------------------------------------------------------------- 1 | d = 2; M = 3; Q = 4; T = 5; Sigma = 10; 2 | N = sample_discrete(normalize(ones(1,M)), 1, Q); 3 | data = randn(d,T); 4 | mu = randn(d,M,Q); 5 | 6 | [BM, B2M] = parzen(data, mu, Sigma, N); 7 | [B, B2] = parzenC(data, mu, Sigma, N); 8 | 9 | approxeq(B,BM) 10 | approxeq(B2,B2M) 11 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/sprintf_intvec.m: -------------------------------------------------------------------------------- 1 | function s = sprintf_intvec(v) 2 | % SPRINTF_INTVEC Print a vector of ints as comma separated string, with no trailing comma 3 | % function s = sprintf_intvec(v) 4 | % 5 | % e.g., sprintf_intvec(1:3) returns '1,2,3' 6 | 7 | s = sprintf('%d,', v); 8 | s = s(1:end-1); 9 | 10 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/rgb2grayKPM.m: -------------------------------------------------------------------------------- 1 | function g = rgb2grayKPM(rgb) 2 | % function g = rgb2grayKPM(rgb) 3 | % rgb2grayKPM Like the built-in function, but if r is already gray, does not cause an error 4 | 5 | [nr nc ncolors] = size(rgb); 6 | if ncolors > 1 7 | g = rgb2gray(rgb); 8 | else 9 | g = rgb; 10 | end 11 | 12 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/softeye.m: -------------------------------------------------------------------------------- 1 | function M = softeye(K, p) 2 | % SOFTEYE Make a stochastic matrix with p on the diagonal, and the remaining mass distributed uniformly 3 | % M = softeye(K, p) 4 | % 5 | % M is a K x K matrix. 6 | 7 | M = p*eye(K); 8 | q = 1-p; 9 | for i=1:K 10 | M(i, [1:i-1 i+1:K]) = q/(K-1); 11 | end 12 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/myones.m: -------------------------------------------------------------------------------- 1 | function T = myones(sizes) 2 | % MYONES Like the built-in ones, except myones(k) produces a k*1 vector instead of a k*k matrix, 3 | % T = myones(sizes) 4 | 5 | if length(sizes)==0 6 | T = 1; 7 | elseif length(sizes)==1 8 | T = ones(sizes, 1); 9 | else 10 | T = ones(sizes(:)'); 11 | end 12 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/code/sc2/nrf/makefile.win32: -------------------------------------------------------------------------------- 1 | CC= gcc 2 | CFLAGS= -O -I. 3 | 4 | OPTOBJS= frprmn.o linmin.o brent.o mnbrak.o nrutil.o impure.o getreent.o 5 | 6 | .c.o: 7 | ${CC} ${CFLAGS} -c $*.c 8 | 9 | libnrfopt.a: clean $(OPTOBJS) 10 | ar cr libnrfopt.a $(OPTOBJS) 11 | 12 | clean: 13 | rm -rf *.o *.a 14 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/myreshape.m: -------------------------------------------------------------------------------- 1 | function T = myreshape(T, sizes) 2 | % MYRESHAPE Like the built-in reshape, except myreshape(T,n) == reshape(T,[n 1]) 3 | % T = myreshape(T, sizes) 4 | 5 | if length(sizes)==0 6 | return; 7 | elseif length(sizes)==1 8 | T = reshape(T, [sizes 1]); 9 | else 10 | T = reshape(T, sizes(:)'); 11 | end 12 | -------------------------------------------------------------------------------- /descriptor/gactoolbox/gdlfiles/gdlCompileMex.m: -------------------------------------------------------------------------------- 1 | 2 | mex -O gdlInitAffinityTable_c.cpp gdlComputeAffinity.cpp 3 | mex -O gdlInitAffinityTable_knn_c.cpp gdlComputeAffinity.cpp 4 | mex -O gdlAffinity_c.cpp gdlComputeAffinity.cpp 5 | mex -O gdlDirectedAffinity_c.cpp gdlComputeDirectedAffinity.cpp 6 | mex -O gdlDirectedAffinity_batch_c.cpp gdlComputeDirectedAffinity.cpp -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/isvector.m: -------------------------------------------------------------------------------- 1 | function p = isvector(v) 2 | % ISVECTOR Returns 1 if all but one dimension have size 1. 3 | % p = isvector(v) 4 | % 5 | % Example: isvector(rand(1,2,1)) = 1, isvector(rand(2,2)) = 0. 6 | 7 | s=size(v); 8 | p = (ndims(v)<=2) & (s(1) == 1 | s(2) == 1); 9 | %p = sum( size(v) > 1) <= 1; % Peter Acklam's solution 10 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/plotColors.m: -------------------------------------------------------------------------------- 1 | function styles = plotColors() 2 | 3 | colors = ['r' 'b' 'k' 'g' 'c' 'y' 'm' ... 4 | 'r' 'b' 'k' 'g' 'c' 'y' 'm']; 5 | symbols = ['o' 'x' '+' '>' '<' '^' 'v' ... 6 | '*' 'p' 'h' 's' 'd' 'o' 'x']; 7 | for i=1:length(colors) 8 | styles{i} = sprintf('-%s%s', colors(i), symbols(i)); 9 | end 10 | 11 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/plotColors.m~: -------------------------------------------------------------------------------- 1 | function styles = plotColors() 2 | 3 | colors = ['r' 'b' 'k' 'g' 'c' 'y' 'm' ... 4 | 'r' 'b' 'k' 'g' 'c' 'y' 'm']; 5 | symbols = ['o' 'x' '+' '>' '<' '^' 'v' ... 6 | '*' 'p' 'h' 's' 'd' 'o' 'x']; 7 | for i=1:length(colors) 8 | styles{i} = sprintf('-%s%s', colors(i), symbols(i)); 9 | end 10 | 11 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/plotgauss1d.m: -------------------------------------------------------------------------------- 1 | function h = plotgauss1d(mu, sigma2) 2 | % function h = plotgauss1d(mu, sigma^2) 3 | % Example 4 | % plotgauss1d(0,5); hold on; h=plotgauss1d(0,2);set(h,'color','r') 5 | 6 | sigma = sqrt(sigma2); 7 | x = linspace(mu-3*sigma, mu+3*sigma, 100); 8 | p = gaussian_prob(x, mu, sigma2); 9 | h = plot(x, p, '-'); 10 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/code/sc2/nrf/makefile.linux: -------------------------------------------------------------------------------- 1 | CC= gcc 2 | CFLAGS= -O -I. -fPIC 3 | 4 | OPTOBJS= frprmn.o linmin.o brent.o mnbrak.o nrutil.o #impure.o #getreent.o 5 | 6 | .c.o: 7 | ${CC} ${CFLAGS} -c $*.c 8 | 9 | libnrfopt.a: clean $(OPTOBJS) 10 | ar cr libnrfopt.a $(OPTOBJS) 11 | 12 | clean: 13 | rm -rf *.o *.a 14 | 15 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/#histCmpChi2.m#: -------------------------------------------------------------------------------- 1 | function d = histCmpChi2(h1, h2) 2 | % Compare two histograms using chi-squared 3 | % function d = histCmpChi2(h1, h2) 4 | % 5 | % d(i,j) = chi^2(h1(i,:), h2(j,:)) = sum_b (h1(b 6 | 7 | [N B] = size(h1); 8 | d = zeros(N,N); 9 | for i=1:N 10 | hh1 = repmat(h1(i,:), N, 1); 11 | numer = (hh1 .- h2).^2; 12 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/marginalize_gaussian.m: -------------------------------------------------------------------------------- 1 | function [muX, SXX] = marginalize_gaussian(mu, Sigma, X, Y, ns) 2 | % MARGINALIZE_GAUSSIAN Compute Pr(X) from Pr(X,Y) where X and Y are jointly Gaussian. 3 | % [muX, SXX] = marginalize_gaussian(mu, Sigma, X, Y, ns) 4 | 5 | [muX, muY, SXX, SXY, SYX, SYY] = partition_matrix_vec(mu, Sigma, X, Y, ns); 6 | 7 | 8 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/isposdef.m: -------------------------------------------------------------------------------- 1 | function b = isposdef(a) 2 | % ISPOSDEF Test for positive definite matrix. 3 | % ISPOSDEF(A) returns 1 if A is positive definite, 0 otherwise. 4 | % Using chol is much more efficient than computing eigenvectors. 5 | 6 | % From Tom Minka's lightspeed toolbox 7 | 8 | [R,p] = chol(a); 9 | b = (p == 0); 10 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/mk_unit_norm.m: -------------------------------------------------------------------------------- 1 | function B = mk_unit_norm(A) 2 | % MK_UNIT_NORM Make each column be a unit norm vector 3 | % function B = mk_unit_norm(A) 4 | % 5 | % We divide each column by its magnitude 6 | 7 | 8 | [nrows ncols] = size(A); 9 | s = sum(A.^2); 10 | ndx = find(s==0); 11 | s(ndx)=1; 12 | B = A ./ repmat(sqrt(s), [nrows 1]); 13 | 14 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/mexutil.h: -------------------------------------------------------------------------------- 1 | #include "mex.h" 2 | 3 | mxArray *mxCreateNumericArrayE(int ndim, const int *dims, 4 | mxClassID class, mxComplexity ComplexFlag); 5 | mxArray *mxCreateNumericMatrixE(int m, int n, mxClassID class, 6 | mxComplexity ComplexFlag); 7 | mxArray *mxCreateDoubleMatrixE(int m, int n, 8 | mxComplexity ComplexFlag); 9 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/myrand.m: -------------------------------------------------------------------------------- 1 | function T = myrand(sizes) 2 | % MYRAND Like the built-in rand, except myrand(k) produces a k*1 vector instead of a k*k matrix, 3 | % T = myrand(sizes) 4 | 5 | if length(sizes)==0 6 | warning('myrand[]'); 7 | T = rand(1,1); 8 | elseif length(sizes)==1 9 | T = rand(sizes, 1); 10 | else 11 | T = rand(sizes); 12 | end 13 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/mysubset.m: -------------------------------------------------------------------------------- 1 | function p=mysubset(small,large) 2 | % MYSUBSET Is the small set of +ve integers a subset of the large set? 3 | % p = mysubset(small, large) 4 | 5 | % Surprisingly, this is not built-in. 6 | 7 | if isempty(small) 8 | p = 1; % isempty(large); 9 | else 10 | p = length(myintersect(small,large)) == length(small); 11 | end 12 | -------------------------------------------------------------------------------- /descriptor/gactoolbox/mexfiles/gacFindKcCluster.m: -------------------------------------------------------------------------------- 1 | function inKcCluster = gacFindKcCluster (affinityTab, Kc) 2 | 3 | Kc = ceil(1.2*Kc); 4 | % input should be symmetric 5 | % [sortedAff, ~] = sort(affinityTab); 6 | [sortedAff, ~] = gacMink(affinityTab, Kc, 1); 7 | inKcCluster = bsxfun(@le, affinityTab, sortedAff(Kc,:)); 8 | inKcCluster = inKcCluster | inKcCluster'; 9 | 10 | end -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/mult_by_table.m: -------------------------------------------------------------------------------- 1 | function bigT = mult_by_table(bigT, bigdom, bigsz, smallT, smalldom, smallsz) 2 | % MULT_BY_TABLE 3 | % bigT = mult_by_table(bigT, bigdom, bigsz, smallT, smalldom, smallsz) 4 | % 5 | 6 | Ts = extend_domain_table(smallT, smalldom, smallsz, bigdom, bigsz); 7 | bigT(:) = bigT(:) .* Ts(:); % must have bigT(:) on LHS to preserve shape 8 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/sumv.m: -------------------------------------------------------------------------------- 1 | function T2 = sumv(T1, sum_over) 2 | % 3 | % Like the built in sum, but will sum over several dimensions and then squeeze the result. 4 | 5 | T2 = T1; 6 | for i=1:length(sum_over) 7 | if sum_over(i) <= ndims(T2) % prevent summing over non-existent dimensions 8 | T2=sum(T2, sum_over(i)); 9 | end 10 | end 11 | T2 = squeeze(T2); 12 | -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/RandDir.m: -------------------------------------------------------------------------------- 1 | function out = RandDir(N) 2 | 3 | % Generate a random vector from the set {+/- e_1, +/- e_2,..., +/- e_N} 4 | % where e_i is the ith basis vector. N should be an integer. 5 | 6 | I = round(ceil(2*N*rand)); 7 | 8 | if rem(I,2) == 1 9 | sgn = -1; 10 | else 11 | sgn = 1; 12 | end 13 | out = zeros(N,1); 14 | 15 | out(ceil(I/2)) = sgn*1; 16 | 17 | end -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/KLgauss.m: -------------------------------------------------------------------------------- 1 | function kl = KLgauss(P, Q) 2 | %The following computes D(P||Q), the KL divergence between two zero-mean 3 | %Gaussians with covariance P and Q: 4 | % klDiv = -0.5*(log(det(P*inv(Q))) + trace(eye(N)-P*inv(Q))); 5 | 6 | R = P*inv(Q); 7 | kl = -0.5*(log(det(R))) + trace(eye(length(P))-R); 8 | 9 | %To get MI, just set P=cov(X,Y) and Q=blockdiag(cov(X),cov(Y)). 10 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/argmax.m: -------------------------------------------------------------------------------- 1 | function indices = argmax(v) 2 | % ARGMAX Return as a subscript vector the location of the largest element of a multidimensional array v. 3 | % indices = argmax(v) 4 | % 5 | % Returns the first maximum in the case of ties. 6 | % Example: 7 | % X = [2 8 4; 7 3 9]; 8 | % argmax(X) = [2 3], i.e., row 2 column 3 9 | 10 | [m i] = max(v(:)); 11 | indices = ind2subv(mysize(v), i); 12 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/rand_psd.m: -------------------------------------------------------------------------------- 1 | function M = rand_psd(d, d2, k) 2 | % Create a random positive definite matrix of size d by d by k (k defaults to 1) 3 | % M = rand_psd(d, d2, k) default: d2 = d, k = 1 4 | 5 | if nargin<2, d2 = d; end 6 | if nargin<3, k = 1; end 7 | if d2 ~= d, error('must be square'); end 8 | 9 | M = zeros(d,d,k); 10 | for i=1:k 11 | A = rand(d); 12 | M(:,:,i) = A*A'; 13 | end 14 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/code/sc2/nrf/README: -------------------------------------------------------------------------------- 1 | 2 | These are the numerical recipies routines for conjugate gradient 3 | descent. They have been modified to make the 1d line minimizations 4 | efficient. 5 | 6 | frprmn.c: main routine for executing conj. grad. 7 | linmin.c: line minimization algorithm 8 | mnbrak.c: routine for bracketing the minimum 9 | brent.c: finds minimum via Brent's method 10 | 11 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/matrix_normal_pdf.m: -------------------------------------------------------------------------------- 1 | function p = matrix_normal_pdf(A, M, V, K) 2 | % MATRIX_NORMAL_PDF Evaluate the density of a matrix under a Matrix-Normal distribution 3 | % p = matrix_normal_pdf(A, M, V, K) 4 | 5 | % See "Bayesian Linear Regression", T. Minka, MIT Tech Report, 2001 6 | 7 | [d m] = size(K); 8 | c = det(K)^(d/2) / det(2*pi*V)^(m/2); 9 | p = c * exp(-0.5*tr((A-M)'*inv(V)*(A-M)*K)); 10 | -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/blas/Makefile: -------------------------------------------------------------------------------- 1 | AR = ar rcv 2 | RANLIB = ranlib 3 | 4 | HEADERS = blas.h blasp.h 5 | FILES = dnrm2.o daxpy.o ddot.o dscal.o 6 | 7 | CFLAGS = $(OPTFLAGS) 8 | FFLAGS = $(OPTFLAGS) 9 | 10 | blas: $(FILES) $(HEADERS) 11 | $(AR) blas.a $(FILES) 12 | $(RANLIB) blas.a 13 | 14 | clean: 15 | - rm -f *.o 16 | - rm -f *.a 17 | - rm -f *~ 18 | 19 | .c.o: 20 | $(CC) $(CFLAGS) -c $*.c 21 | 22 | 23 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/condgauss_sample.m: -------------------------------------------------------------------------------- 1 | function x = mixgauss_sample(mu, Sigma, labels) 2 | % MIXGAUSS_SAMPLE Sample from a mixture of Gaussians given known mixture labels 3 | % function x = mixgauss_sample(mu, Sigma, labels) 4 | 5 | T = length(labels); 6 | [D Q] = size(mu); 7 | x = zeros(D,T); 8 | for q=1:Q 9 | ndx = find(labels==q); 10 | x(:,ndx) = gaussian_sample(mu(:,q)', Sigma(:,:,q), length(ndx))'; 11 | end 12 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/num2strcell.m: -------------------------------------------------------------------------------- 1 | function c = num2strcell(n, format) 2 | % num2strcell Convert vector of numbers to cell array of strings 3 | % function c = num2strcell(n, format) 4 | % 5 | % If format is omitted, we use 6 | % c{i} = sprintf('%d', n(i)) 7 | 8 | if nargin < 2, format = '%d'; end 9 | 10 | N = length(n); 11 | c = cell(1,N); 12 | for i=1:N 13 | c{i} = sprintf(format, n(i)); 14 | end 15 | 16 | 17 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/Kalman/ensure_AR.m: -------------------------------------------------------------------------------- 1 | function [A, C, Q, R, initx, initV] = ensure_AR(A, C, Q, R, initx, initV, k, obs, diagonal) 2 | % 3 | % Ensure that the system matrices have the right form for an autoregressive process. 4 | 5 | ss = length(A); 6 | if nargin<8, obs=ones(ss, 1); end 7 | if nargin<9, diagonal=0; end 8 | 9 | [coef, C] = SS_to_AR(A, Q, k, diagonal); 10 | [A, C, Q, R, initx, initV] = AR_to_SS(coef, C, obs); 11 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/sample.m: -------------------------------------------------------------------------------- 1 | function x = sample(p, n) 2 | % SAMPLE Sample from categorical distribution. 3 | % Returns a row vector of integers, sampled according to the probability 4 | % distribution p. 5 | % Uses the stick-breaking algorithm. 6 | % Much faster algorithms are also possible. 7 | 8 | if nargin < 2 9 | n = 1; 10 | end 11 | 12 | cdf = cumsum(p(:)); 13 | for i = 1:n 14 | x(i) = sum(cdf < rand) + 1; 15 | end 16 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/logist2Apply.m: -------------------------------------------------------------------------------- 1 | function p = logist2Apply(beta, x) 2 | % LOGIST2APPLY 2 class logistic regression: compute posterior prob of class 1 3 | % function p = logist2Apply(beta, x) 4 | % 5 | % x(:,i) - each COLUMN is a test case; we append 1s automatically, if appropriate 6 | 7 | [D Ncases] = size(x); 8 | if length(beta)==D+1 9 | F = [x; ones(1,Ncases)]; 10 | else 11 | F = x; 12 | end 13 | p = 1./(1+exp(-beta(:)'*F)); 14 | -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/linear.def: -------------------------------------------------------------------------------- 1 | LIBRARY liblinear 2 | EXPORTS 3 | train @1 4 | cross_validation @2 5 | save_model @3 6 | load_model @4 7 | get_nr_feature @5 8 | get_nr_class @6 9 | get_labels @7 10 | predict_values @8 11 | predict @9 12 | predict_probability @10 13 | free_and_destroy_model @11 14 | free_model_content @12 15 | destroy_param @13 16 | check_parameter @14 17 | check_probability_model @15 18 | set_print_string_function @16 19 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/argmin.m: -------------------------------------------------------------------------------- 1 | function indices = argmin(v) 2 | % ARGMIN Return as a subscript vector the location of the smallest element of a multidimensional array v. 3 | % indices = argmin(v) 4 | % 5 | % Returns the first minimum in the case of ties. 6 | % Example: 7 | % X = [2 8 4; 7 3 9]; 8 | % argmin(X) = [1 1], i.e., row 1 column 1 9 | 10 | [m i] = min(v(:)); 11 | indices = ind2subv(mysize(v), i); 12 | %indices = ind2subv(size(v), i); 13 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/histCmpChi2.m~: -------------------------------------------------------------------------------- 1 | function d = histCmpChi2(h1, h2) 2 | % Compare two histograms using chi-squared 3 | % function d = histCmpChi2(h1, h2) 4 | % 5 | % d(i,j) = chi^2(h1(i,:), h2(j,:)) = sum_b (h1(i,b)-h2(j,b)^2 / (h1(i,b) + h2(j,b)) 6 | 7 | [N B] = size(h1); 8 | d = zeros(N,N); 9 | for i=1:N 10 | h1i = repmat(h1(i,:), N, 1); 11 | numer = (h1i - h2).^2; 12 | denom = h1i + h2; 13 | d(i,:) = numer ./ denom; 14 | end 15 | 16 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/myismember.m: -------------------------------------------------------------------------------- 1 | function p = myismember(a,A) 2 | % MYISMEMBER Is 'a' an element of a set of positive integers? (much faster than built-in ismember) 3 | % p = myismember(a,A) 4 | 5 | %if isempty(A) | a < min(A) | a > max(A) % slow 6 | 7 | if length(A)==0 8 | p = 0; 9 | elseif a < min(A) 10 | p = 0; 11 | elseif a > max(A) 12 | p = 0; 13 | else 14 | bits = zeros(1, max(A)); 15 | bits(A) = 1; 16 | p = bits(a); 17 | end 18 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/setdiag.m: -------------------------------------------------------------------------------- 1 | function M = setdiag(M, v) 2 | % SETDIAG Set the diagonal of a matrix to a specified scalar/vector. 3 | % M = set_diag(M, v) 4 | 5 | n = length(M); 6 | if length(v)==1 7 | v = repmat(v, 1, n); 8 | end 9 | 10 | % e.g., for 3x3 matrix, elements are numbered 11 | % 1 4 7 12 | % 2 5 8 13 | % 3 6 9 14 | % so diagnoal = [1 5 9] 15 | 16 | 17 | J = 1:n+1:n^2; 18 | M(J) = v; 19 | 20 | %M = triu(M,1) + tril(M,-1) + diag(v); 21 | 22 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/subplot2.m: -------------------------------------------------------------------------------- 1 | function subplot2(nrows, ncols, i, j) 2 | % function subplot2(nrows, ncols, i, j) 3 | 4 | 5 | sz = [nrows ncols]; 6 | %k = sub2ind(sz, i, j) 7 | k = sub2ind(sz(end:-1:1), j, i); 8 | subplot(nrows, ncols, k); 9 | 10 | if 0 11 | ncols_plot = ceil(sqrt(Nplots)); 12 | nrows_plot = ceil(Nplots/ncols_plot); 13 | Nplots = nrows_plot*ncols_plot; 14 | for p=1:Nplots 15 | subplot(nrows_plot, ncols_plot, p); 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/unaryEncoding.m: -------------------------------------------------------------------------------- 1 | function U = unaryEncoding(data, K) 2 | % unaryEncoding Encode data(s) as a 1-of-K column vector 3 | % function U = unaryEncoding(data, K) 4 | % 5 | % eg. 6 | % If data = [3 2 2] and K=3, 7 | % then U = [0 0 0 8 | % 0 1 1 9 | % 1 0 0] 10 | 11 | if nargin < 2, K = max(data); end 12 | N = length(data); 13 | U = zeros(K,N); 14 | ndx = subv2ind([K N], [data(:)'; 1:N]'); 15 | U(ndx) = 1; 16 | U = reshape(U, [K N]); 17 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/README: -------------------------------------------------------------------------------- 1 | A short instruction to run the code 2 | 1. download IMAGES.mat from http://redwood.berkeley.edu/bruno/sparsenet/ 3 | 2. copy IMAGES.mat to ./data directory 4 | 3. move to ./code 5 | 4. run matlab and execute: 6 | "demo_fast_sc(1)": epsilon-L1 sparsity penalty 7 | "demo_fast_sc(2)": L1 sparsity penalty 8 | 9 | Note: You can apply sparse coding to any type of general data. See sparse_coding.m for details. 10 | 11 | 12 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/test_dir.m: -------------------------------------------------------------------------------- 1 | % # of sample points 2 | n_samples = 1000; 3 | 4 | p = ones(3,1)/3; 5 | 6 | % Low Entropy 7 | alpha = 0.5*p; 8 | 9 | % High Entropy 10 | %alpha = 10*p; 11 | 12 | % draw n_samples random points from the 3-d dirichlet(alpha), 13 | % and plot the results 14 | points = zeros(3,n_samples); 15 | for i = 1:n_samples 16 | points(:,i) = dirichletrnd(alpha); 17 | end 18 | 19 | scatter3(points(1,:)', points(2,:)', points(3,:)', 'r', '.', 'filled'); -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/filepartsLast.m: -------------------------------------------------------------------------------- 1 | function [last] = filepartsLast(fname) 2 | % filepartsLast Return the last part of a filename (strip off directory and suffix) 3 | % function filepartsLast(fname) 4 | % 5 | % Examples 6 | % filepartsLast('C:/foo/bar') = 'bar' 7 | % filepartsLast('C:/foo/bar.mat') = 'bar' 8 | % filepartsLast('C:/foo/bar.mat.gz') = 'bar.mat' 9 | % filepartsLast('bar.mat') = 'bar' 10 | 11 | [pathstr,name,ext,versn] = fileparts(fname); 12 | last = name; 13 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/filepartsLast.m~: -------------------------------------------------------------------------------- 1 | function [last] = filepartsLast(fname) 2 | % filepartsLast Return the last part of a filename (strip off directory and suffix) 3 | % function filepartsLast(fname) 4 | % 5 | % Examples 6 | % filepartsLast('C:/foo/bar') = 'bar' 7 | % filepartsLast('C:/foo/bar.mat') = 'bar' 8 | % filepartsLast('C:/foo/bar.mat.gz') = 'bar.mat' 9 | % filepartsLast('bar.mat') = 'bar' 10 | 11 | [pathstr,name,ext,versn] = fileparts(fname); 12 | last = name; 13 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/rnd_partition.m: -------------------------------------------------------------------------------- 1 | function [train, test] = rnd_partition(data, train_percent); 2 | % function [train, test] = rnd_partition(data, train_percent); 3 | % 4 | % data(:,i) is the i'th example 5 | % train_percent of these columns get put into train, the rest into test 6 | 7 | N = size(data, 2); 8 | ndx = randperm(N); 9 | k = ceil(N*train_percent); 10 | train_ndx = ndx(1:k); 11 | test_ndx = ndx(k+1:end); 12 | train = data(:, train_ndx); 13 | test = data(:, test_ndx); 14 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/code/sc2/nrf/impure.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | /* Note that there is a copy of this in sys/reent.h. */ 4 | #ifndef __ATTRIBUTE_IMPURE_PTR__ 5 | #define __ATTRIBUTE_IMPURE_PTR__ 6 | #endif 7 | 8 | #ifndef __ATTRIBUTE_IMPURE_DATA__ 9 | #define __ATTRIBUTE_IMPURE_DATA__ 10 | #endif 11 | 12 | static struct _reent __ATTRIBUTE_IMPURE_DATA__ impure_data = _REENT_INIT (impure_data); 13 | struct _reent *__ATTRIBUTE_IMPURE_PTR__ _impure_ptr = &impure_data; 14 | -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/svm-toy/qt/Makefile: -------------------------------------------------------------------------------- 1 | CXX? = g++ 2 | CFLAGS = -Wall -O3 -I$(INCLUDE) -I$(INCLUDE)/QtGui -lQtGui 3 | INCLUDE = /usr/include/qt4 4 | MOC = /usr/bin/moc-qt4 5 | 6 | svm-toy: svm-toy.cpp svm-toy.moc ../../svm.o 7 | $(CXX) $(CFLAGS) svm-toy.cpp ../../svm.o -o svm-toy 8 | 9 | svm-toy.moc: svm-toy.cpp 10 | $(MOC) svm-toy.cpp -o svm-toy.moc 11 | 12 | ../../svm.o: ../../svm.cpp ../../svm.h 13 | make -C ../.. svm.o 14 | 15 | clean: 16 | rm -f *~ svm-toy svm-toy.moc ../../svm.o 17 | 18 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/histCmpChi2.m: -------------------------------------------------------------------------------- 1 | function d = histCmpChi2(h1, h2) 2 | % Compare two histograms using chi-squared 3 | % function d = histCmpChi2(h1, h2) 4 | % 5 | % d(i,j) = chi^2(h1(i,:), h2(j,:)) = sum_b (h1(i,b)-h2(j,b)^2 / (h1(i,b) + h2(j,b)) 6 | 7 | [N B] = size(h1); 8 | d = zeros(N,N); 9 | for i=1:N 10 | h1i = repmat(h1(i,:), N, 1); 11 | numer = (h1i - h2).^2; 12 | denom = h1i + h2 + eps; % if denom=0, then numer=0 13 | d(i,:) = sum(numer ./ denom, 2); 14 | end 15 | 16 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/clg_prob.m: -------------------------------------------------------------------------------- 1 | function p = eval_pdf_clg(X,Y,mu,Sigma,W) 2 | % function p = eval_pdf_clg(X,Y,mu,Sigma,W) 3 | % 4 | % p(c,t) = N(Y(:,t); mu(:,c) + W(:,:,c)*X(:,t), Sigma(:,:,c)) 5 | 6 | [d T] = size(Y); 7 | [d nc] = size(mu); 8 | p = zeros(nc,T); 9 | for c=1:nc 10 | denom = (2*pi)^(d/2)*sqrt(abs(det(Sigma(:,:,c)))); 11 | M = repmat(mu(:,c), 1, T) + W(:,:,c)*X; 12 | mahal = sum(((Y-M)'*inv(Sigma(:,:,c))).*(Y-M)',2); 13 | p(c,:) = (exp(-0.5*mahal) / denom)'; 14 | end 15 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/logist2FitRegularized.m: -------------------------------------------------------------------------------- 1 | function [net, niter] = logist2FitRegularized(labels, features, maxIter) 2 | 3 | if nargin < 3, maxIter = 100; end 4 | 5 | [D N] = size(features); 6 | weightPrior = 0.5; 7 | net = glm(D, 1, 'logistic', weightPrior); 8 | options = foptions; 9 | options(14) = maxIter; 10 | [net, options] = glmtrain(net, options, features', labels(:)); 11 | niter = options(14); 12 | %w = logist2Fit(labelsPatches(jValidPatches), features(:, jValidPatches)); 13 | 14 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/entropy.m: -------------------------------------------------------------------------------- 1 | function H = entropy(v, scale) 2 | % ENTROPY Entropy log base 2 3 | % H = entropy(v) 4 | % If v is a matrix, we compute the entropy of each column 5 | % 6 | % % H = entropy(v,1) means we scale the result so that it lies in [0,1] 7 | 8 | if nargin < 2, scale = 0; end 9 | 10 | v = v + (v==0); 11 | H = -1 * sum(v .* log2(v), 1); % sum the rows 12 | 13 | if scale 14 | n = size(v, 1); 15 | unif = normalise(ones(n,1)); 16 | H = H / entropy(unif); 17 | end 18 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/matrix_T_pdf.m: -------------------------------------------------------------------------------- 1 | function p = matrix_T_pdf(A, M, V, K, n) 2 | % MATRIX_T_PDF Evaluate the density of a matrix under a Matrix-T distribution 3 | % p = matrix_T_pdf(A, M, V, K, n) 4 | 5 | % See "Bayesian Linear Regression", T. Minka, MIT Tech Report, 2001 6 | 7 | [d m] = size(K); 8 | is = 1:d; 9 | c1 = prod(gamma((n+1-is)/2)) / prod(gamma((n-m+1-is)/2)); 10 | c2 = det(K)^(d/2) / det(pi*V)^(m/2); %% pi or 2pi? 11 | p = c1 * c2 * det((A-M)'*inv(V)*(A-M)*K + eye(m))^(-n/2); 12 | 13 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/optimalMatchingTest.m: -------------------------------------------------------------------------------- 1 | % Consider matching sources to detections 2 | 3 | % s1 d2 4 | % s2 d3 5 | % d1 6 | 7 | a = optimalMatching([52;0.01]) 8 | 9 | % sources(:,i) = [x y] coords 10 | sources = [0.1 0.7; 0.6 0.4]'; 11 | detections = [0.2 0.2; 0.2 0.8; 0.7 0.1]'; 12 | dst = sqdist(sources, detections) 13 | 14 | % a = [2 3] which means s1-d2, s2-d3 15 | a = optimalMatching(dst) 16 | 17 | % a = [0 1 2] which means d1-0, d2-s1, d3-s2 18 | a = optimalMatching(dst') 19 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/optimalMatchingTest.m~: -------------------------------------------------------------------------------- 1 | % Consider matching sources to detections 2 | 3 | % s1 d2 4 | % s2 d3 5 | % d1 6 | 7 | a = optimalMatching([52;0.01]) 8 | 9 | % sources(:,i) = [x y] coords 10 | sources = [0.1 0.7; 0.6 0.4]'; 11 | detections = [0.2 0.2; 0.2 0.8; 0.7 0.1]'; 12 | dst = sqdist(sources, detections) 13 | 14 | % a = [2 3] which means s1-d2, s2-d3 15 | a = optimalMatching(dst) 16 | 17 | % a = [0 1 2] which means d1-0, d2-s1, d3-s2 18 | a = optimalMatching(dst') 19 | -------------------------------------------------------------------------------- /descriptor/gr_stability/RandomWalks/RandomGraphMove.m: -------------------------------------------------------------------------------- 1 | function out = RandomGraphMove(X,S) 2 | 3 | % Produce a random edge on a graph defined by S 4 | % 5 | % inputs: 6 | % X: current node 7 | % S: Connections matrix, S(i,j) lists the number of edges between node i 8 | % and node j 9 | 10 | V = S(:,X); % Node this one is connected with 11 | Idx = find(V); 12 | 13 | v = V(Idx)/sum(V); 14 | s = cumsum(v); 15 | 16 | r = rand; 17 | 18 | ind = find(s > r); 19 | 20 | out = Idx(ind(1)); 21 | 22 | end 23 | 24 | 25 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/block.m: -------------------------------------------------------------------------------- 1 | function sub = block(blocks, block_sizes) 2 | % BLOCK Return a vector of subscripts corresponding to the specified blocks. 3 | % sub = block(blocks, block_sizes) 4 | % 5 | % e.g., block([2 5], [2 1 2 1 2]) = [3 7 8]. 6 | 7 | blocks = blocks(:)'; 8 | block_sizes = block_sizes(:)'; 9 | skip = [0 cumsum(block_sizes)]; 10 | start = skip(blocks)+1; 11 | fin = start + block_sizes(blocks) - 1; 12 | sub = []; 13 | for j=1:length(blocks) 14 | sub = [sub start(j):fin(j)]; 15 | end 16 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/isemptycell.m: -------------------------------------------------------------------------------- 1 | function E = isemptycell(C) 2 | % ISEMPTYCELL Apply the isempty function to each element of a cell array 3 | % E = isemptycell(C) 4 | % 5 | % This is equivalent to E = cellfun('isempty', C), 6 | % where cellfun is a function built-in to matlab version 5.3 or newer. 7 | 8 | if 0 % all(version('-release') >= 12) 9 | E = cellfun('isempty', C); 10 | else 11 | E = zeros(size(C)); 12 | for i=1:prod(size(C)) 13 | E(i) = isempty(C{i}); 14 | end 15 | E = logical(E); 16 | end 17 | -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/svm-toy/gtk/main.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Initial main.c file generated by Glade. Edit as required. 3 | * Glade will not overwrite this file. 4 | */ 5 | 6 | #include 7 | #include "interface.h" 8 | void svm_toy_initialize(); 9 | 10 | int main (int argc, char *argv[]) 11 | { 12 | GtkWidget *window; 13 | 14 | gtk_set_locale (); 15 | gtk_init (&argc, &argv); 16 | 17 | window = create_window (); 18 | gtk_widget_show (window); 19 | 20 | svm_toy_initialize(); 21 | gtk_main (); 22 | return 0; 23 | } 24 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/Kalman/convert_to_lagged_form.m: -------------------------------------------------------------------------------- 1 | function yy = convert_to_lagged_form(y, k) 2 | % Create an observation vector yy(:,t) containing the last k values of y, newest first 3 | % e.g., k=2, y = (a1 a2 a3) yy = a2 a3 4 | % (b1 b2 b3) b2 b2 5 | % a1 a2 6 | % b1 b2 7 | 8 | [s T] = size(y); 9 | bs = s*ones(1,k); 10 | yy = zeros(k*s, T-k+1); 11 | for i=1:k 12 | yy(block(i,bs), :) = y(:, k-i+1:end-i+1); 13 | end 14 | 15 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/standardize.m~: -------------------------------------------------------------------------------- 1 | function [S, mu, sigma2] = standardize(M, mu, sigma2) 2 | % function S = standardize(M, mu, sigma2) 3 | % Make each column of M be zero mean, std 1. 4 | % Thus each row is scaled separately. 5 | % 6 | % If mu, sigma2 are omitted, they are computed from M 7 | 8 | if nargin < 2 9 | mu = mean(M,2); 10 | sigma2 = std(M,0,2); 11 | sigma2 = sigma2 + eps*(sigma2==0); 12 | end 13 | 14 | [nrows ncols] = size(M); 15 | S = M - repmat(mu(:), [1 ncols]); 16 | S = S ./ repmat(sigma2, [1 ncols]); 17 | 18 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/standardize.m: -------------------------------------------------------------------------------- 1 | function [S, mu, sigma2] = standardize(M, mu, sigma2) 2 | % function S = standardize(M, mu, sigma2) 3 | % Make each column of M be zero mean, std 1. 4 | % Thus each row is scaled separately. 5 | % 6 | % If mu, sigma2 are omitted, they are computed from M 7 | 8 | M = double(M); 9 | if nargin < 2 10 | mu = mean(M,2); 11 | sigma2 = std(M,0,2); 12 | sigma2 = sigma2 + eps*(sigma2==0); 13 | end 14 | 15 | [nrows ncols] = size(M); 16 | S = M - repmat(mu(:), [1 ncols]); 17 | S = S ./ repmat(sigma2, [1 ncols]); 18 | 19 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/subplot3.m: -------------------------------------------------------------------------------- 1 | function fignum = subplot3(nrows, ncols, fignumBase, plotnumBase) 2 | % function subplot3(nrows, ncols, fignumBase, plotnumBase) 3 | % Choose a subplot number, opening a new figure if necessary 4 | % eg nrows=2, ncols = 2, we plot on (fignum, plotnum) = (1,1), (1,2), (1,3), (1,4), (2,1), ... 5 | 6 | nplotsPerFig = nrows*ncols; 7 | fignum = fignumBase + div(plotnumBase-1, nplotsPerFig); 8 | plotnum = wrap(plotnumBase, nplotsPerFig); 9 | figure(fignum); 10 | if plotnum==1, clf; end 11 | subplot(nrows, ncols, plotnum); 12 | 13 | 14 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/code/sc2/nrf/linmin.c: -------------------------------------------------------------------------------- 1 | #include "nrutil.h" 2 | #define TOL 2.0e-4 3 | 4 | void linmin(p,xi,n,fret,f1dim) 5 | float (*f1dim)(),*fret,p[],xi[]; 6 | int n; 7 | { 8 | float brent(); 9 | void mnbrak(); 10 | int j; 11 | float xx,xmin,fx,fb,fa,bx,ax; 12 | 13 | ax=0.0; 14 | xx=1.0; 15 | mnbrak(&ax,&xx,&bx,&fa,&fx,&fb,f1dim); 16 | *fret=brent(ax,xx,bx,f1dim,TOL,&xmin); 17 | for (j=1;j<=n;j++) { 18 | xi[j] *= xmin; 19 | p[j] += xi[j]; 20 | } 21 | } 22 | #undef TOL 23 | /* (C) Copr. 1986-92 Numerical Recipes Software 6=Mn.Y". */ 24 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/logsumexpv.m: -------------------------------------------------------------------------------- 1 | function s = logsumexpv(a) 2 | % Returns log(sum(exp(a))) while avoiding numerical underflow. 3 | % 4 | % e.g., log(e^a1 + e^a2) = a1 + log(1 + e^(a2-a1)) if a1>a2 5 | % If a1 ~ a2, and a1>a2, then e^(a2-a1) is exp(small negative number), 6 | % which can be computed without underflow. 7 | 8 | % Same as logsumexp, except we assume a is a vector. 9 | % This avoids a call to repmat, which takes 50% of the time! 10 | 11 | a = a(:)'; % make row vector 12 | m = max(a); 13 | b = a - m*ones(1,length(a)); 14 | s = m + log(sum(exp(b))); 15 | 16 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/mysetdiff.m: -------------------------------------------------------------------------------- 1 | function C = mysetdiff(A,B) 2 | % MYSETDIFF Set difference of two sets of positive integers (much faster than built-in setdiff) 3 | % C = mysetdiff(A,B) 4 | % C = A \ B = { things in A that are not in B } 5 | % 6 | % Original by Kevin Murphy, modified by Leon Peshkin 7 | 8 | if isempty(A) 9 | C = []; 10 | return; 11 | elseif isempty(B) 12 | C = A; 13 | return; 14 | else % both non-empty 15 | bits = zeros(1, max(max(A), max(B))); 16 | bits(A) = 1; 17 | bits(B) = 0; 18 | C = A(logical(bits(A))); 19 | end 20 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/splitLongSeqIntoManyShort.m: -------------------------------------------------------------------------------- 1 | function short = splitLongSeqIntoManyShort(long, Tsmall) 2 | % splitLongSeqIntoManyShort Put groups of columns into a cell array of narrower matrices 3 | % function short = splitLongSeqIntoManyShort(long, Tsmall) 4 | % 5 | % long(:,t) 6 | % short{i} = long(:,ndx1:ndx2) where each segment (except maybe the last) is of length Tsmall 7 | 8 | T = length(long); 9 | Nsmall = ceil(T/Tsmall); 10 | short = cell(Nsmall,1); 11 | 12 | t = 1; 13 | for i=1:Nsmall 14 | short{i} = long(:,t:min(T,t+Tsmall-1)); 15 | t = t+Tsmall; 16 | end 17 | -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/svm.def: -------------------------------------------------------------------------------- 1 | LIBRARY libsvm 2 | EXPORTS 3 | svm_train @1 4 | svm_cross_validation @2 5 | svm_save_model @3 6 | svm_load_model @4 7 | svm_get_svm_type @5 8 | svm_get_nr_class @6 9 | svm_get_labels @7 10 | svm_get_svr_probability @8 11 | svm_predict_values @9 12 | svm_predict @10 13 | svm_predict_probability @11 14 | svm_free_model_content @12 15 | svm_free_and_destroy_model @13 16 | svm_destroy_param @14 17 | svm_check_parameter @15 18 | svm_check_probability_model @16 19 | svm_set_print_string_function @17 20 | svm_get_sv_indices @18 21 | svm_get_nr_sv @19 22 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/Kalman/README.txt: -------------------------------------------------------------------------------- 1 | Kalman filter toolbox written by Kevin Murphy, 1998. 2 | See http://www.ai.mit.edu/~murphyk/Software/kalman.html for details. 3 | 4 | Installation 5 | ------------ 6 | 7 | 1. Install KPMtools from http://www.ai.mit.edu/~murphyk/Software/KPMtools.html 8 | 3. Assuming you installed all these files in your matlab directory, In Matlab type 9 | 10 | addpath matlab/KPMtools 11 | addpath matlab/Kalman 12 | 13 | 14 | Demos 15 | ----- 16 | See tracking_demo.m for a demo of 2D tracking. 17 | See learning_demo.m for a demo of parameter estimation using EM. 18 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/approxeq.m: -------------------------------------------------------------------------------- 1 | function p = approxeq(a, b, tol, rel) 2 | % APPROXEQ Are a and b approximately equal (to within a specified tolerance)? 3 | % p = approxeq(a, b, thresh) 4 | % 'tol' defaults to 1e-3. 5 | % p(i) = 1 iff abs(a(i) - b(i)) < thresh 6 | % 7 | % p = approxeq(a, b, thresh, 1) 8 | % p(i) = 1 iff abs(a(i)-b(i))/abs(a(i)) < thresh 9 | 10 | if nargin < 3, tol = 1e-2; end 11 | if nargin < 4, rel = 0; end 12 | 13 | a = a(:); 14 | b = b(:); 15 | d = abs(a-b); 16 | if rel 17 | p = ~any( (d ./ (abs(a)+eps)) > tol); 18 | else 19 | p = ~any(d > tol); 20 | end 21 | 22 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/myunion.m: -------------------------------------------------------------------------------- 1 | function C = myunion(A,B) 2 | % MYUNION Union of two sets of positive integers (much faster than built-in union) 3 | % C = myunion(A,B) 4 | 5 | if isempty(A) 6 | ma = 0; 7 | else 8 | ma = max(A); 9 | end 10 | 11 | if isempty(B) 12 | mb = 0; 13 | else 14 | mb = max(B); 15 | end 16 | 17 | if ma==0 & mb==0 18 | C = []; 19 | elseif ma==0 & mb>0 20 | C = B; 21 | elseif ma>0 & mb==0 22 | C = A; 23 | else 24 | %bits = sparse(1, max(ma,mb)); 25 | bits = zeros(1, max(ma,mb)); 26 | bits(A) = 1; 27 | bits(B) = 1; 28 | C = find(bits); 29 | end 30 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/student_t_logprob.m: -------------------------------------------------------------------------------- 1 | function L = log_student_pdf(X, mu, lambda, alpha) 2 | % LOG_STUDENT_PDF Evaluate the log of the multivariate student-t distribution at a point 3 | % L = log_student_pdf(X, mu, lambda, alpha) 4 | % 5 | % Each column of X is evaluated. 6 | % See Bernardo and Smith p435. 7 | 8 | k = length(mu); 9 | assert(size(X,1) == k); 10 | [k N] = size(X); 11 | logc = gammaln(0.5*(alpha+k)) - gammaln(0.5*alpha) - (k/2)*log(alpha*pi) + 0.5*log(det(lambda)); 12 | middle = (1 + (1/alpha)*(X-mu)'*lambda*(X-mu)); % scalar version 13 | L = logc - ((alpha+k)/2)*log(middle); 14 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/bipartiteMatchingDemoPlot.m~: -------------------------------------------------------------------------------- 1 | function optimalMatchingDemoPlot(sources, detections, a) 2 | 3 | hold on 4 | p1 = size(sources,2); 5 | p2 = size(detections,2); 6 | for i=1:p1 7 | text(sources(1,i), sources(2,i), sprintf('s%d', i)); 8 | end 9 | for i=1:p2 10 | text(detections(1,i), detections(2,i), sprintf('d%d', i)); 11 | end 12 | 13 | if nargin < 3, return; end 14 | 15 | for i=1:p1 16 | j = a(i); 17 | if j==0 % i not matched to anything 18 | continue 19 | end 20 | line([sources(1,i) detections(1,j)], [sources(2,i) detections(2,j)]) 21 | end 22 | axis_pct; 23 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/plotBox.m~: -------------------------------------------------------------------------------- 1 | function [h, ht] =plotBox(box, col, str) 2 | % function h=plotBox(box, col, str) 3 | % 4 | % box = [xlow xhigh ylow yhigh] 5 | % col = color (default - red) 6 | % str = string printed at center (default '') 7 | 8 | if nargin < 2, col = 'r'; end 9 | if nargin < 3, str = ''; end 10 | 11 | h = plot([box(1) box(2) box(2) box(1) box(1)], [ box(3) box(3) box(4) box(4) box(3)]); 12 | set(h, 'color', col); 13 | set(h, 'linewidth', 2); 14 | if ~isempty(str) 15 | xc = mean(box(1:2)); 16 | yc = mean(box(3:4)); 17 | ht = text(xc, yc, str); 18 | else 19 | ht = []; 20 | end 21 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/est_transmat.m: -------------------------------------------------------------------------------- 1 | function [A,C] = est_transmat(seq) 2 | % ESTIMATE_TRANSMAT Max likelihood of a Markov chain transition matrix 3 | % [A,C] = estimate_transmat(seq) 4 | % 5 | % seq is a vector of positive integers 6 | % 7 | % e.g., seq = [1 2 1 2 3], C(1,2)=2, C(2,1)=1, C(2,3)=1, so 8 | % A(1,:)=[0 1 0], A(2,:) = [0.5 0 0.5], 9 | % all other entries are 0 10 | 11 | % Use a trick with sparse matrices to count the number of each transition. 12 | % From http://www.mathworks.com/company/newsletter/may03/dna.shtml 13 | 14 | C = full(sparse(seq(1:end-1), seq(2:end),1)); 15 | A = mk_stochastic(C); 16 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/mixgauss_classifier_apply.m: -------------------------------------------------------------------------------- 1 | function [classHatTest, probPos] = mixgauss_classifier_apply(mixgauss, testFeatures) 2 | 3 | Bpos = mixgauss_prob(testFeatures, mixgauss.pos.mu, mixgauss.pos.Sigma, mixgauss.pos.prior); 4 | Bneg = mixgauss_prob(testFeatures, mixgauss.neg.mu, mixgauss.neg.Sigma, mixgauss.neg.prior); 5 | prior_pos = mixgauss.priorC(1); 6 | prior_neg = mixgauss.priorC(2); 7 | post = normalize([Bpos * prior_pos; Bneg * prior_neg], 1); 8 | probPos = post(1,:)'; 9 | [junk, classHatTest] = max(post); 10 | classHatTest(find(classHatTest==2))=0; 11 | classHatTest = classHatTest(:); 12 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/cross_entropy.m: -------------------------------------------------------------------------------- 1 | function kl = cross_entropy(p, q, symmetric) 2 | % CROSS_ENTROPY Compute the Kullback-Leibler divergence between two discrete prob. distributions 3 | % kl = cross_entropy(p, q, symmetric) 4 | % 5 | % If symmetric = 1, we compute the symmetric version. Default: symmetric = 0; 6 | 7 | tiny = exp(-700); 8 | if nargin < 3, symmetric = 0; end 9 | p = p(:); 10 | q = q(:); 11 | if symmetric 12 | kl = (sum(p .* log((p+tiny)./(q+tiny))) + sum(q .* log((q+tiny)./(p+tiny))))/2; 13 | else 14 | kl = sum(p .* log((p+tiny)./(q+tiny))); 15 | end 16 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/sort_evec.m: -------------------------------------------------------------------------------- 1 | function [evec, evals] = sort_evec(temp_evec, temp_evals, N) 2 | 3 | if ~isvector(temp_evals) 4 | temp_evals = diag(temp_evals); 5 | end 6 | 7 | % Eigenvalues nearly always returned in descending order, but just 8 | % to make sure..... 9 | [evals perm] = sort(-temp_evals); 10 | evals = -evals(1:N); 11 | if evals == temp_evals(1:N) 12 | % Originals were in order 13 | evec = temp_evec(:, 1:N); 14 | return 15 | else 16 | fprintf('sorting evec\n'); 17 | % Need to reorder the eigenvectors 18 | for i=1:N 19 | evec(:,i) = temp_evec(:,perm(i)); 20 | end 21 | end 22 | 23 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/sample_gaussian.m: -------------------------------------------------------------------------------- 1 | function M = sample_gaussian(mu, Sigma, N) 2 | % SAMPLE_GAUSSIAN Draw N random row vectors from a Gaussian distribution 3 | % samples = sample_gaussian(mean, cov, N) 4 | 5 | if nargin==2 6 | N = 1; 7 | end 8 | 9 | % If Y = CX, Var(Y) = C Var(X) C'. 10 | % So if Var(X)=I, and we want Var(Y)=Sigma, we need to find C. s.t. Sigma = C C'. 11 | % Since Sigma is psd, we have Sigma = U D U' = (U D^0.5) (D'^0.5 U'). 12 | 13 | mu = mu(:); 14 | n=length(mu); 15 | [U,D,V] = svd(Sigma); 16 | M = randn(n,N); 17 | M = (U*sqrt(D))*M + mu*ones(1,N); % transform each column 18 | M = M'; 19 | 20 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/plot_ellipse.m: -------------------------------------------------------------------------------- 1 | % PLOT_ELLIPSE 2 | % h=plot_ellipse(x,y,theta,a,b) 3 | % 4 | % This routine plots an ellipse with centre (x,y), axis lengths a,b 5 | % with major axis at an angle of theta radians from the horizontal. 6 | 7 | % 8 | % Author: P. Fieguth 9 | % Jan. 98 10 | % 11 | %http://ocho.uwaterloo.ca/~pfieguth/Teaching/372/plot_ellipse.m 12 | 13 | function h=plot_ellipse(x,y,theta,a,b) 14 | 15 | np = 100; 16 | ang = [0:np]*2*pi/np; 17 | R = [cos(theta) -sin(theta); sin(theta) cos(theta)]; 18 | pts = [x;y]*ones(size(ang)) + R*[cos(ang)*a; sin(ang)*b]; 19 | h=plot( pts(1,:), pts(2,:) ); 20 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/logsum_simple.m: -------------------------------------------------------------------------------- 1 | function result = logsum(logv) 2 | 3 | len = length(logv); 4 | if (len<2); 5 | error('Subroutine logsum cannot sum less than 2 terms.'); 6 | end; 7 | 8 | % First two terms 9 | if (logv(2)Q arc instead of a Q->X arc; 17 | the X->Q arc is modelled by a softmax, which is slightly harder to fit than a 18 | mixture of Gaussians. 19 | 20 | 21 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/hash_add.m: -------------------------------------------------------------------------------- 1 | function hash_add(key, val, fname) 2 | % HASH_ADD Append key,value pair to end of hashtable stored in a file 3 | % function hash_add(key, val, filename) 4 | % 5 | % See hash_lookup for an example 6 | 7 | if ~exist(fname, 'file') 8 | % new hashtable 9 | hashtable.key{1} = key; 10 | hashtable.value{1} = val; 11 | else 12 | %hashtable = importdata(fname); 13 | %hashtable = load(fname, '-mat'); 14 | load(fname, '-mat'); 15 | Nentries = length(hashtable.key); 16 | hashtable.key{Nentries+1} = key; 17 | hashtable.value{Nentries+1} = val; 18 | end 19 | save(fname, 'hashtable', '-mat'); 20 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/montageKPM3.m: -------------------------------------------------------------------------------- 1 | function montageKPM3(data) 2 | % data{f}(y,x,b) - each frame can have a different size (can can even be empty) 3 | 4 | Nframes = length(data); 5 | Nbands = -inf; 6 | nr = -inf; nc = -inf; 7 | for f=1:Nframes 8 | if isempty(data{f}), continue; end 9 | nr = max(nr, size(data{f},1)); 10 | nc = max(nc, size(data{f},2)); 11 | Nbands = max(Nbands, size(data{f},3)); 12 | end 13 | data2 = zeros(nr, nc, Nbands, Nframes); 14 | for f=1:Nframes 15 | if isempty(data{f}), continue; end 16 | data2(1:size(data{f},1), 1:size(data{f},2), :, f) = data{f}; 17 | end 18 | 19 | montageKPM2(data2) 20 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/mysize.m: -------------------------------------------------------------------------------- 1 | function sz = mysize(M) 2 | % MYSIZE Like the built-in size, except it returns n if M is a vector of length n, and 1 if M is a scalar. 3 | % sz = mysize(M) 4 | % 5 | % The behavior is best explained by examples 6 | % - M = rand(1,1), mysize(M) = 1, size(M) = [1 1] 7 | % - M = rand(2,1), mysize(M) = 2, size(M) = [2 1] 8 | % - M = rand(1,2), mysize(M) = 2, size(M) = [1 2] 9 | % - M = rand(2,2,1), mysize(M) = [2 2], size(M) = [2 2] 10 | % - M = rand(1,2,1), mysize(M) = 2, size(M) = [1 2] 11 | 12 | if isvector(M) 13 | sz = length(M); 14 | else 15 | sz = size(M); 16 | end 17 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/myintersect.m: -------------------------------------------------------------------------------- 1 | function C = myintersect(A,B) 2 | % MYINTERSECT Intersection of two sets of positive integers (much faster than built-in intersect) 3 | % C = myintersect(A,B) 4 | 5 | A = A(:)'; B = B(:)'; 6 | 7 | if isempty(A) 8 | ma = 0; 9 | else 10 | ma = max(A); 11 | end 12 | 13 | if isempty(B) 14 | mb = 0; 15 | else 16 | mb = max(B); 17 | end 18 | 19 | if ma==0 | mb==0 20 | C = []; 21 | else 22 | %bits = sparse(1, max(ma,mb)); 23 | bits = zeros(1, max(ma,mb)); 24 | bits(A) = 1; 25 | C = B(logical(bits(B))); 26 | end 27 | 28 | %sum( bitget( bitand( cliquesb(i), cliquesb(j) ), 1:52 ) ); 29 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/Kalman/README.txt~: -------------------------------------------------------------------------------- 1 | Kalman filter toolbox written by Kevin Murphy, 1998. 2 | See http://www.ai.mit.edu/~murphyk/Software/kalman.html for details. 3 | This version was last updated on 18 January 2003. 4 | 5 | Installation 6 | ------------ 7 | 8 | 1. Install KPMtools from http://www.ai.mit.edu/~murphyk/Software/KPMtools.html 9 | 3. Assuming you installed all these files in your matlab directory, In Matlab type 10 | 11 | addpath matlab/KPMtools 12 | addpath matlab/Kalman 13 | 14 | 15 | Demos 16 | ----- 17 | See tracking_demo.m for a demo of 2D tracking. 18 | See learning_demo.m for a demo of parameter estimation using EM. 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # ========================= 18 | # Operating System Files 19 | # ========================= 20 | 21 | # OSX 22 | # ========================= 23 | 24 | .DS_Store 25 | .AppleDouble 26 | .LSOverride 27 | 28 | # Icon must ends with two \r. 29 | Icon 30 | 31 | # Thumbnails 32 | ._* 33 | 34 | # Files that might appear on external disk 35 | .Spotlight-V100 36 | .Trashes 37 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/draw_ellipse_axes.m: -------------------------------------------------------------------------------- 1 | function h = draw_ellipse_axes(x, c, linespec) 2 | % DRAW_ELLIPSE_AXES(x, c, linespec) 3 | % Draws the major and minor axes of ellipses. 4 | % Ellipses are centered at x with covariance matrix c. 5 | % x is a matrix of columns. c is a positive definite matrix. 6 | % linespec is optional. 7 | 8 | [v,e] = eig(c); 9 | v = v*sqrt(e); 10 | 11 | h = []; 12 | for j = 1:cols(v) 13 | x1 = repmat(x(1,:),2,1) + repmat([-1;1]*v(1,j),1,cols(x)); 14 | x2 = repmat(x(2,:),2,1) + repmat([-1;1]*v(2,j),1,cols(x)); 15 | h = [h line(x1,x2)]; 16 | end 17 | if nargin > 2 18 | set_linespec(h,linespec); 19 | end 20 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/plotBox.m: -------------------------------------------------------------------------------- 1 | function [h, ht] =plotBox(box, col, str) 2 | % function h=plotBox(box, col, str) 3 | % 4 | % box = [xlow xhigh ylow yhigh] 5 | % col = color (default - red) 6 | % str = string printed at center (default '') 7 | 8 | if nargin < 2, col = 'r'; end 9 | if nargin < 3, str = ''; end 10 | 11 | box = double(box); % fails on single 12 | 13 | h = plot([box(1) box(2) box(2) box(1) box(1)], [ box(3) box(3) box(4) box(4) box(3)]); 14 | set(h, 'color', col); 15 | set(h, 'linewidth', 2); 16 | if ~isempty(str) 17 | xc = mean(box(1:2)); 18 | yc = mean(box(3:4)); 19 | ht = text(xc, yc, str); 20 | else 21 | ht = []; 22 | end 23 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/bipartiteMatchingDemoPlot.m: -------------------------------------------------------------------------------- 1 | function bipartiteMatchingDemoPlot(sources, detections, a) 2 | 3 | hold on 4 | p1 = size(sources,2); 5 | p2 = size(detections,2); 6 | for i=1:p1 7 | h=text(sources(1,i), sources(2,i), sprintf('s%d', i)); 8 | set(h, 'color', 'r'); 9 | end 10 | for i=1:p2 11 | h=text(detections(1,i), detections(2,i), sprintf('d%d', i)); 12 | set(h, 'color', 'b'); 13 | end 14 | 15 | if nargin < 3, return; end 16 | 17 | for i=1:p1 18 | j = a(i); 19 | if j==0 % i not matched to anything 20 | continue 21 | end 22 | line([sources(1,i) detections(1,j)], [sources(2,i) detections(2,j)]) 23 | end 24 | axis_pct; 25 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/mk_multi_index.m: -------------------------------------------------------------------------------- 1 | function index = mk_multi_index(n, dims, vals) 2 | % MK_MULTI_INDEX Compute the indices of the submatrix where dims(i)=vals(i). 3 | % index = mk_multi_index(n, dims, vals) 4 | % 5 | % Example: 6 | % index = mk_multi_index(3, [1 3], [3 2]) 7 | % gives index = {3, ':', 2}, which will select out dim 1 = 3 and dim 3 = 2 8 | % So if A(:,:,1)=[1 2;3 4; 5 6]; A(:,:,2)=[7 8; 9 10; 11 12] 9 | % then A(index{:}) = [11 12]: 10 | 11 | if n==0 12 | index = { 1 }; 13 | return; 14 | end 15 | 16 | index = cell(1,n); 17 | for i=1:n 18 | index{i} = ':'; 19 | end 20 | for i=1:length(dims) 21 | index{dims(i)} = vals(i); 22 | end 23 | 24 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/multinomial_prob.m: -------------------------------------------------------------------------------- 1 | function B = eval_pdf_cond_multinomial(data, obsmat) 2 | % EVAL_PDF_COND_MULTINOMIAL Evaluate pdf of conditional multinomial 3 | % function B = eval_pdf_cond_multinomial(data, obsmat) 4 | % 5 | % Notation: Y = observation (O values), Q = conditioning variable (K values) 6 | % 7 | % Inputs: 8 | % data(t) = t'th observation - must be an integer in {1,2,...,K}: cannot be 0! 9 | % obsmat(i,o) = Pr(Y(t)=o | Q(t)=i) 10 | % 11 | % Output: 12 | % B(i,t) = Pr(y(t) | Q(t)=i) 13 | 14 | [Q O] = size(obsmat); 15 | T = prod(size(data)); % length(data); 16 | B = zeros(Q,T); 17 | 18 | for t=1:T 19 | B(:,t) = obsmat(:, data(t)); 20 | end 21 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/dirichlet_sample.m: -------------------------------------------------------------------------------- 1 | function theta = dirichlet_sample(alpha, N) 2 | % SAMPLE_DIRICHLET Sample N vectors from Dir(alpha(1), ..., alpha(k)) 3 | % theta = sample_dirichlet(alpha, N) 4 | % theta(i,j) = i'th sample of theta_j, where theta ~ Dir 5 | 6 | % We use the method from p. 482 of "Bayesian Data Analysis", Gelman et al. 7 | 8 | assert(alpha > 0); 9 | k = length(alpha); 10 | theta = zeros(N, k); 11 | scale = 1; % arbitrary 12 | for i=1:k 13 | %theta(:,i) = gamrnd(alpha(i), scale, N, 1); 14 | theta(:,i) = gamma_sample(alpha(i), scale, N, 1); 15 | end 16 | %theta = mk_stochastic(theta); 17 | S = sum(theta,2); 18 | theta = theta ./ repmat(S, 1, k); 19 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/mkPolyFvec.m: -------------------------------------------------------------------------------- 1 | function p = mkPolyFvec(x) 2 | % MKPOLYFVEC Make feature vector by constructing 2nd order polynomial from input data 3 | % function p = mkPolyFvec(x) 4 | % 5 | % x(:,i) for example i 6 | % p(:,i) = [x(1,i) x(2,i) x(3,i) x(1,i)^2 x(2,i)^2 x(3,i)^2 .. 7 | % x(1,i)*x(2,i) x(1,i)*x(3,i) x(2,i)*x(3,i)]' 8 | % 9 | % Example 10 | % x = [4 5 6]' 11 | % p = [4 5 6 16 25 36 20 24 30]' 12 | 13 | fvec = x; 14 | fvecSq = x.*x; 15 | [D N] = size(x); 16 | fvecCross = zeros(D*(D-1)/2, N); 17 | i = 1; 18 | for d=1:D 19 | for d2=d+1:D 20 | fvecCross(i,:) = x(d,:) .* x(d2,:); 21 | i = i + 1; 22 | end 23 | end 24 | p = [fvec; fvecSq; fvecCross]; 25 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/multinomial_sample.m: -------------------------------------------------------------------------------- 1 | function Y = sample_cond_multinomial(X, M) 2 | % SAMPLE_MULTINOMIAL Sample Y(i) ~ M(X(i), :) 3 | % function Y = sample_multinomial(X, M) 4 | % 5 | % X(i) = i'th sample 6 | % M(i,j) = P(Y=j | X=i) = noisy channel model 7 | % 8 | % e.g., if X is a binary image, 9 | % Y = sample_multinomial(softeye(2, 0.9), X) 10 | % will create a noisy version of X, where bits are flipped with probability 0.1 11 | 12 | if any(X(:)==0) 13 | error('data must only contain positive integers') 14 | end 15 | 16 | Y = zeros(size(X)); 17 | for i=min(X(:)):max(X(:)) 18 | ndx = find(X==i); 19 | Y(ndx) = sample_discrete(M(i,:), length(ndx), 1); 20 | end 21 | 22 | 23 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/mysymsetdiff.m: -------------------------------------------------------------------------------- 1 | function C = mysymsetdiff(A,B) 2 | % MYSYMSETDIFF Symmetric set difference of two sets of positive integers (much faster than built-in setdiff) 3 | % C = mysetdiff(A,B) 4 | % C = (A\B) union (B\A) = { things that A and B don't have in common } 5 | 6 | if isempty(A) 7 | ma = 0; 8 | else 9 | ma = max(A); 10 | end 11 | 12 | if isempty(B) 13 | mb = 0; 14 | else 15 | mb = max(B); 16 | end 17 | 18 | if ma==0 19 | C = B; 20 | elseif mb==0 21 | C = A; 22 | else % both non-empty 23 | m = max(ma,mb); 24 | bitsA = sparse(1, m); 25 | bitsA(A) = 1; 26 | bitsB = sparse(1, m); 27 | bitsB(B) = 1; 28 | C = find(xor(bitsA, bitsB)); 29 | end 30 | -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/svm-toy/gtk/Makefile: -------------------------------------------------------------------------------- 1 | CC? = gcc 2 | CXX? = g++ 3 | CFLAGS = -Wall -O3 -g `pkg-config --cflags gtk+-2.0` 4 | LIBS = `pkg-config --libs gtk+-2.0` 5 | 6 | svm-toy: main.o interface.o callbacks.o ../../svm.o 7 | $(CXX) $(CFLAGS) main.o interface.o callbacks.o ../../svm.o -o svm-toy $(LIBS) 8 | 9 | main.o: main.c 10 | $(CC) $(CFLAGS) -c main.c 11 | 12 | interface.o: interface.c interface.h 13 | $(CC) $(CFLAGS) -c interface.c 14 | 15 | callbacks.o: callbacks.cpp callbacks.h 16 | $(CXX) $(CFLAGS) -c callbacks.cpp 17 | 18 | ../../svm.o: ../../svm.cpp ../../svm.h 19 | make -C ../.. svm.o 20 | 21 | clean: 22 | rm -f *~ callbacks.o svm-toy main.o interface.o callbacks.o ../../svm.o 23 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/logist2Fit.m: -------------------------------------------------------------------------------- 1 | function [beta, p] = logist2Fit(y, x, addOne, w) 2 | % LOGIST2FIT 2 class logsitic classification 3 | % function beta = logist2Fit(y,x, addOne) 4 | % 5 | % y(i) = 0/1 6 | % x(:,i) = i'th input - we optionally append 1s to last dimension 7 | % w(i) = optional weight 8 | % 9 | % beta(j)- regression coefficient 10 | 11 | if nargin < 3, addOne = 1; end 12 | if nargin < 4, w = 1; end 13 | 14 | Ncases = size(x,2); 15 | if Ncases ~= length(y) 16 | error(sprintf('size of data = %dx%d, size of labels=%d', size(x,1), size(x,2), length(y))) 17 | end 18 | if addOne 19 | x = [x; ones(1,Ncases)]; 20 | end 21 | [beta, p] = logist2(y(:), x', w(:)); 22 | beta = beta(:); 23 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/rectintC.m: -------------------------------------------------------------------------------- 1 | function [overlap, normoverlap] = rectintC(A,B) 2 | % 3 | % A(i,:) = [x y w h] 4 | % B(j,:) = [x y w h] 5 | % overlap(i,j) = area of intersection 6 | % normoverlap(i,j) = overlap(i,j) / min(area(i), area(j)) 7 | % 8 | % Same as built-in rectint, but faster and uses less memory (since avoids repmat). 9 | 10 | 11 | leftA = A(:,1); 12 | bottomA = A(:,2); 13 | rightA = leftA + A(:,3); 14 | topA = bottomA + A(:,4); 15 | 16 | leftB = B(:,1)'; 17 | bottomB = B(:,2)'; 18 | rightB = leftB + B(:,3)'; 19 | topB = bottomB + B(:,4)'; 20 | 21 | verbose = 0; 22 | [overlap, normoverlap] = rectintLoopC(leftA, rightA, topA, bottomA, leftB, rightB, topB, bottomB, verbose); 23 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/Kalman/SS_to_AR.m: -------------------------------------------------------------------------------- 1 | function [coef, C] = SS_to_AR(F, Q, k, diagonal) 2 | % 3 | % Extract the parameters of a vector autoregresssive process of order k from the state-space form. 4 | % [coef, C] = SS_to_AR(F, Q, k, diagonal) 5 | 6 | if nargin<4, diagonal = 0; end 7 | 8 | s = length(Q) / k; 9 | bs = s*ones(1,k); 10 | coef = zeros(s,s,k); 11 | for i=1:k 12 | if diagonal 13 | coef(:,:,i) = diag(diag(F(block(1,bs), block(i,bs)))); 14 | else 15 | coef(:,:,i) = F(block(1,bs), block(i,bs)); 16 | end 17 | end 18 | C = Q(block(1,bs), block(1,bs)); 19 | if diagonal 20 | C = diag(diag(C)); 21 | end 22 | %C = sqrt(Q(block(1,bs), block(1,bs))); % since cov(1,1) of full vector = C C' 23 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/logsumexp.m: -------------------------------------------------------------------------------- 1 | function s = logsumexp(a, dim) 2 | % Returns log(sum(exp(a),dim)) while avoiding numerical underflow. 3 | % Default is dim = 1 (rows) or dim=2 for a row vector 4 | % logsumexp(a, 2) will sum across columns instead of rows 5 | 6 | % Written by Tom Minka, modified by Kevin Murphy 7 | 8 | if nargin < 2 9 | dim = 1; 10 | if ndims(a) <= 2 & size(a,1)==1 11 | dim = 2; 12 | end 13 | end 14 | 15 | % subtract the largest in each column 16 | [y, i] = max(a,[],dim); 17 | dims = ones(1,ndims(a)); 18 | dims(dim) = size(a,dim); 19 | a = a - repmat(y, dims); 20 | s = y + log(sum(exp(a),dim)); 21 | %i = find(~finite(y)); 22 | %if ~isempty(i) 23 | % s(i) = y(i); 24 | %end 25 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/logsum.m: -------------------------------------------------------------------------------- 1 | function y=logsum(x,d) 2 | %LOGSUM logsum(x,d)=log(sum(exp(x),d)) 3 | % d gives dimension to sum along 4 | 5 | % Copyright (C) Mike Brookes 1998 6 | % 7 | % Last modified Mon Oct 12 15:47:25 1998 8 | % 9 | % VOICEBOX is a MATLAB toolbox for speech processing. Home page is at 10 | % http://www.ee.ic.ac.uk/hp/staff/dmb/voicebox/voicebox.html 11 | % 12 | 13 | if nargin==1 14 | d=[find(size(x)-1) 1]; 15 | d=d(1); 16 | end 17 | n=size(x,d); 18 | if n<=1, y=x; return; end 19 | s=size(x); 20 | p=[d:ndims(x) 1:d-1]; 21 | z=reshape(permute(x,p),n,prod(s)/n); 22 | 23 | y=max(z); 24 | y=y+log(sum(exp(z-y(ones(n,1),:)))); 25 | 26 | s(d)=1; 27 | y=ipermute(reshape(y,s(p)),p); 28 | 29 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/plot_polygon.m: -------------------------------------------------------------------------------- 1 | function out=plot_polygon(p, args, close_loop) 2 | % PLOT_POLYGON 3 | % function handle=plot_polygon(p, args, close_loop) 4 | % p(1,i), p(2,i) are the x/y coords of point i. 5 | % If non-empty, args are passed thru to the plot command. 6 | % If close_loop = 1, connect the last point to the first 7 | 8 | % All rights reserved. Documentation updated April 1999. 9 | % Matt Kawski. http://math.la.asu.edu/~kawski 10 | % He calls it pplot 11 | 12 | if nargin < 2, args = []; end 13 | if nargin < 3, close_loop = 0; end 14 | 15 | if close_loop 16 | p = [p p(:,1)]; 17 | end 18 | 19 | if isempty(args) 20 | out=plot(p(1,:),p(2,:)); 21 | else 22 | out=plot(p(1,:),p(2,:),args); 23 | end 24 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/student_t_prob.m: -------------------------------------------------------------------------------- 1 | function p = student_t_pdf(X, mu, lambda, alpha) 2 | % STUDENT_T_PDF Evaluate the multivariate student-t distribution at a point 3 | % p = student_t_pdf(X, mu, lambda, alpha) 4 | % 5 | % Each column of X is evaluated. 6 | % See Bernardo and Smith p435. 7 | 8 | k = length(mu); 9 | assert(size(X,1) == k); 10 | [k N] = size(X); 11 | numer = gamma(0.5*(alpha+k)); 12 | denom = gamma(0.5*alpha) * (alpha*pi)^(k/2); 13 | c = (numer/denom) * det(lambda)^(0.5); 14 | p = c*(1 + (1/alpha)*(X-mu)'*lambda*(X-mu))^(-(alpha+k)/2); % scalar version 15 | %m = repmat(mu(:), 1, N); 16 | %exponent = sum((X-m)'*lambda*(X-m), 2); % column vector 17 | %p = c*(1 + (1/alpha)*exponent).^(-(alpha+k)/2); 18 | 19 | keyboard 20 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/find_equiv_posns.m: -------------------------------------------------------------------------------- 1 | function p = find_equiv_posns(vsmall, vlarge) 2 | % FIND_EQUIV_POSNS p[i] = the place where vsmall[i] occurs in vlarge. 3 | % p = find_equiv_posns(vsmall, vlarge) 4 | % THE VECTORS ARE ASSUMED TO BE SORTED. 5 | % 6 | % e.g., vsmall=[2,8], vlarge=[2,7,8,4], p=[1,3] 7 | % 8 | % In R/S, this function is called 'match' 9 | 10 | %if ~mysubset(vsmall, vlarge) 11 | % error('small domain must occur in large domain'); 12 | %end 13 | 14 | if isempty(vsmall) | isempty(vlarge) 15 | p = []; 16 | return; 17 | end 18 | 19 | bitvec = sparse(1, max(vlarge)); 20 | %bitvec = zeros(1, max(vlarge)); 21 | bitvec(vsmall) = 1; 22 | p = find(bitvec(vlarge)); 23 | 24 | %p = find(ismember(vlarge, vsmall)); % slower 25 | -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/java/Makefile: -------------------------------------------------------------------------------- 1 | .SUFFIXES: .class .java 2 | FILES = libsvm/svm.class libsvm/svm_model.class libsvm/svm_node.class \ 3 | libsvm/svm_parameter.class libsvm/svm_problem.class \ 4 | libsvm/svm_print_interface.class \ 5 | svm_train.class svm_predict.class svm_toy.class svm_scale.class 6 | 7 | #JAVAC = jikes 8 | JAVAC_FLAGS = -target 1.5 -source 1.5 9 | JAVAC = javac 10 | # JAVAC_FLAGS = 11 | 12 | all: $(FILES) 13 | jar cvf libsvm.jar *.class libsvm/*.class 14 | 15 | .java.class: 16 | $(JAVAC) $(JAVAC_FLAGS) $< 17 | 18 | libsvm/svm.java: libsvm/svm.m4 19 | m4 libsvm/svm.m4 > libsvm/svm.java 20 | 21 | clean: 22 | rm -f libsvm/*.class *.class *.jar libsvm/*~ *~ libsvm/svm.java 23 | 24 | dist: clean all 25 | rm *.class libsvm/*.class 26 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/condGaussToJoint.m: -------------------------------------------------------------------------------- 1 | function [muXY, SigmaXY] = condGaussToJoint(muX, SigmaX, muY, SigmaY, WYgivenX) 2 | 3 | % Compute P(X,Y) from P(X) * P(Y|X) where P(X)=N(X;muX,SigmaX) 4 | % and P(Y|X) = N(Y; WX + muY, SigmaY) 5 | 6 | % For details on how to compute a Gaussian from a Bayes net 7 | % - "Gaussian Influence Diagrams", R. Shachter and C. R. Kenley, Management Science, 35(5):527--550, 1989. 8 | 9 | % size(W) = dy x dx 10 | dx = length(muX); 11 | dy = length(muY); 12 | muXY = [muX(:); WYgivenX*muX(:) + muY]; 13 | 14 | W = [zeros(dx,dx) WYgivenX'; 15 | zeros(dy,dx) zeros(dy,dy)]; 16 | D = [SigmaX zeros(dx,dy); 17 | zeros(dy,dx) SigmaY]; 18 | 19 | U = inv(eye(size(W)) - W')'; 20 | SigmaXY = U' * D * U; 21 | 22 | 23 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/hash_del.m: -------------------------------------------------------------------------------- 1 | function ndx = hash_del(key, fname) 2 | % HASH_DEL Remove all entries that match key from hashtable stored in a file 3 | % ndx = hash_del(key, fname) 4 | % 5 | % Returns indices of matching entries (if any) 6 | % See hash_lookup for an example 7 | 8 | ndx = []; 9 | 10 | if ~exist(fname, 'file') 11 | % new hashtable - no op 12 | else 13 | %hashtable = importdata(fname); 14 | %hashtable = load(fname, '-mat'); 15 | load(fname, '-mat'); 16 | Nentries = length(hashtable.key); 17 | for i=1:Nentries 18 | if isequal(hashtable.key{i}, key) 19 | ndx = [ndx i]; 20 | end 21 | end 22 | hashtable.key(ndx) = []; 23 | hashtable.value(ndx) = []; 24 | save(fname, 'hashtable', '-mat'); 25 | end 26 | 27 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/partitionData.m: -------------------------------------------------------------------------------- 1 | function varargout = partitionData(Ndata, varargin) 2 | % PARTITIONDATA Partition a vector of indices into random sets 3 | % [a,b,c,...] = partitionData(N, 0.3, 0.2, 0.5, ...) 4 | % 5 | % Examples: 6 | % [a,b,c]=partitionData(105,0.3,0.2,0.5); 7 | % a= 1:30, b=32:52, c=52:105 (last bin gets all the left over) 8 | 9 | Npartitions = length(varargin); 10 | perm = randperm(Ndata); 11 | %perm = 1:Ndata; 12 | ndx = 1; 13 | for i=1:Npartitions 14 | pc(i) = varargin{i}; 15 | Nbin(i) = fix(Ndata*pc(i)); 16 | low(i) = ndx; 17 | if i==Npartitions 18 | high(i) = Ndata; 19 | else 20 | high(i) = low(i)+Nbin(i)-1; 21 | end 22 | varargout{i} = perm(low(i):high(i)); 23 | ndx = ndx+Nbin(i); 24 | end 25 | 26 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/max_mult.m: -------------------------------------------------------------------------------- 1 | function y=max_mult(A,x) 2 | % MAX_MULT Like matrix multiplication, but sum gets replaced by max 3 | % function y=max_mult(A,x) y(i) = max_j A(i,j) x(j) 4 | 5 | %X=ones(size(A,1),1) * x(:)'; % X(j,i) = x(i) 6 | %y=max(A.*X, [], 2); 7 | 8 | % This is faster 9 | if size(x,2)==1 10 | X=x*ones(1,size(A,1)); % X(i,j) = x(i) 11 | y=max(A'.*X)'; 12 | else 13 | %this works for arbitrarily sized A and x (but is ugly, and slower than above) 14 | X=repmat(x, [1 1 size(A,1)]); 15 | B=repmat(A, [1 1 size(x,2)]); 16 | C=permute(B,[2 3 1]); 17 | y=permute(max(C.*X),[3 2 1]); 18 | % this is even slower, as is using squeeze instead of permute 19 | % Y=permute(X, [3 1 2]); 20 | % y=permute(max(Y.*B, [], 2), [1 3 2]); 21 | end 22 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/compute_counts.m: -------------------------------------------------------------------------------- 1 | function count = compute_counts(data, sz) 2 | % COMPUTE_COUNTS Count the number of times each combination of discrete assignments occurs 3 | % count = compute_counts(data, sz) 4 | % 5 | % data(i,t) is the value of variable i in case t 6 | % sz(i) : values for variable i are assumed to be in [1:sz(i)] 7 | % 8 | % Example: to compute a transition matrix for an HMM from a sequence of labeled states: 9 | % transmat = mk_stochastic(compute_counts([seq(1:end-1); seq(2:end)], [nstates nstates])); 10 | 11 | assert(length(sz) == size(data, 1)); 12 | P = prod(sz); 13 | indices = subv2ind(sz, data'); % each row of data' is a case 14 | %count = histc(indices, 1:P); 15 | count = hist(indices, 1:P); 16 | count = myreshape(count, sz); 17 | 18 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/polygon_area.m: -------------------------------------------------------------------------------- 1 | function a = polygon_area(x,y) 2 | % AREA Area of a planar polygon. 3 | % AREA(X,Y) Calculates the area of a 2-dimensional 4 | % polygon formed by vertices with coordinate vectors 5 | % X and Y. The result is direction-sensitive: the 6 | % area is positive if the bounding contour is counter- 7 | % clockwise and negative if it is clockwise. 8 | % 9 | % See also TRAPZ. 10 | 11 | % Copyright (c) 1995 by Kirill K. Pankratov, 12 | % kirill@plume.mit.edu. 13 | % 04/20/94, 05/20/95 14 | 15 | % Make polygon closed ............. 16 | x = [x(:); x(1)]; 17 | y = [y(:); y(1)]; 18 | 19 | % Calculate contour integral Int -y*dx (same as Int x*dy). 20 | lx = length(x); 21 | a = -(x(2:lx)-x(1:lx-1))'*(y(1:lx-1)+y(2:lx))/2; 22 | a = abs(a); 23 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/code/save_figures.m: -------------------------------------------------------------------------------- 1 | function save_figures(pars, t) 2 | 3 | experiment=[]; 4 | experiment.basisfname = sprintf('%s_basis.png', pars.filename); 5 | experiment.fobjfname = sprintf('%s_fobj.png', pars.filename); 6 | experiment.histcoeffname = sprintf('%s_hist_coef.png', pars.filename); 7 | experiment.histfspfname = sprintf('%s_hist_fsp.png', pars.filename); 8 | 9 | figure(1), saveas(gcf, experiment.basisfname); 10 | figure(3), saveas(gcf, experiment.fobjfname); 11 | figure(5); saveas(gcf, experiment.histcoeffname); 12 | figure(6); saveas(gcf, experiment.histfspfname); 13 | 14 | if pars.save_basis_timestamps 15 | timestamp_basisfname = sprintf('%s_basis_%04dt.png', pars.filename, t); 16 | figure(1), saveas(gcf, timestamp_basisfname); 17 | end 18 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/gaussian_sample.m: -------------------------------------------------------------------------------- 1 | function x = gsamp(mu, covar, nsamp) 2 | %GSAMP Sample from a Gaussian distribution. 3 | % 4 | % Description 5 | % 6 | % X = GSAMP(MU, COVAR, NSAMP) generates a sample of size NSAMP from a 7 | % D-dimensional Gaussian distribution. The Gaussian density has mean 8 | % vector MU and covariance matrix COVAR, and the matrix X has NSAMP 9 | % rows in which each row represents a D-dimensional sample vector. 10 | % 11 | % See also 12 | % GAUSS, DEMGAUSS 13 | % 14 | 15 | % Copyright (c) Ian T Nabney (1996-2001) 16 | 17 | d = size(covar, 1); 18 | 19 | mu = reshape(mu, 1, d); % Ensure that mu is a row vector 20 | 21 | [evec, eval] = eig(covar); 22 | 23 | coeffs = randn(nsamp, d)*sqrt(eval); 24 | 25 | x = ones(nsamp, 1)*mu + coeffs*evec'; 26 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/normaliseC.c: -------------------------------------------------------------------------------- 1 | /* C mex version of normalise.m in misc directory */ 2 | 3 | #include "mex.h" 4 | 5 | void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) 6 | { 7 | double *T, *sum_ptr, sum; 8 | int i, N; 9 | 10 | plhs[0] = mxDuplicateArray(prhs[0]); 11 | T = mxGetPr(plhs[0]); 12 | if(mxIsSparse(plhs[0])) N = mxGetJc(plhs[0])[mxGetN(plhs[0])]; 13 | else N = mxGetNumberOfElements(plhs[0]); 14 | 15 | plhs[1] = mxCreateDoubleMatrix(1, 1, mxREAL); 16 | sum_ptr = mxGetPr(plhs[1]); 17 | 18 | sum = 0; 19 | for (i = 0; i < N; i++) { 20 | sum += *T++; 21 | } 22 | T = mxGetPr(plhs[0]); 23 | if (sum > 0) { 24 | for (i = 0; i < N; i++) { 25 | *T++ /= sum; 26 | } 27 | } 28 | *sum_ptr = sum; 29 | } 30 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/draw_ellipse.m: -------------------------------------------------------------------------------- 1 | function h = draw_ellipse(x, c, outline_color, fill_color) 2 | % DRAW_ELLIPSE(x, c, outline_color, fill_color) 3 | % Draws ellipses at centers x with covariance matrix c. 4 | % x is a matrix of columns. c is a positive definite matrix. 5 | % outline_color and fill_color are optional. 6 | 7 | n = 40; % resolution 8 | radians = [0:(2*pi)/(n-1):2*pi]; 9 | unitC = [sin(radians); cos(radians)]; 10 | r = chol(c)'; 11 | 12 | if nargin < 3 13 | outline_color = 'g'; 14 | end 15 | 16 | h = []; 17 | for i=1:cols(x) 18 | y = r*unitC + repmat(x(:, i), 1, n); 19 | if nargin < 4 20 | h = [h line(y(1,:), y(2,:), 'Color', outline_color)]; 21 | else 22 | h = [h fill(y(1,:), y(2,:), fill_color, 'EdgeColor', outline_color)]; 23 | end 24 | end 25 | -------------------------------------------------------------------------------- /descriptor/gactoolbox/mexfiles/gacMink.m: -------------------------------------------------------------------------------- 1 | function varargout = gacMink (X, k, dim) 2 | 3 | if nargin < 3 4 | dim = 1; 5 | end 6 | switch nargout 7 | case 1 8 | sortedDist = gacPartial_sort(X, k, dim); 9 | varargout{1} = sortedDist; 10 | case 2 11 | [sortedDist, NNIndex] = gacPartial_sort(X, k, dim); 12 | varargout{1} = sortedDist; 13 | varargout{2} = NNIndex; 14 | otherwise 15 | error('too many output'); 16 | end 17 | 18 | % check the first k elements 19 | tmpSortedDist = sort(sortedDist, dim); 20 | switch dim 21 | case {1, 2} 22 | if any(sortedDist(:) ~= tmpSortedDist(:)) 23 | error('gacMink: the first k is unsorted!'); 24 | end 25 | otherwise 26 | error('gacMink: only for matrices!'); 27 | end 28 | 29 | end -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/Kalman/learn_AR_diagonal.m: -------------------------------------------------------------------------------- 1 | function [coef, C] = learn_AR_diagonal(y, k) 2 | % Find the ML parameters for a collection of independent scalar AR processes. 3 | 4 | % sep_coef(1,1,t,i) is the coefficient to apply to compopnent i of the state vector t steps ago 5 | % eg. consider two components L and R and let A = coef(:,:,1,:), B = coef(:,:,2,:) 6 | % L3 (AL 0 BL 0) (L2) (CL 0 0 0) 7 | % R3 = (0 AR 0 BR) (R2) (0 CR 0 0) 8 | % L2 (1 0 0 0 ) (L1) + (0 0 0 0) 9 | % R2 (0 1 0 0 ) (R1) (0 0 0 0) 10 | 11 | ss = size(y, 1); 12 | sep_coef = zeros(1,1,k,ss); 13 | for i=1:ss 14 | [sep_coef(:,:,:,i), sep_cov(i)] = learn_AR(k, y(i,:)); 15 | end 16 | C = diag(sep_cov); 17 | for t=1:k 18 | x = sep_coef(1,1,t,:); 19 | coef(:,:,t) = diag(x(:)); 20 | end 21 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/assignEdgeNums.m: -------------------------------------------------------------------------------- 1 | function [edge_id, nedges] = assignEdgeNums(adj_mat) 2 | % give each edge a unique number 3 | % we number (i,j) for j>i first, in row, column order. 4 | % Then we number the reverse links 5 | 6 | nnodes = length(adj_mat); 7 | edge_id = zeros(nnodes); 8 | e = 1; 9 | for i=1:nnodes 10 | for j=i+1:nnodes 11 | if adj_mat(i,j) 12 | edge_id(i,j) = e; 13 | e = e+1; 14 | end 15 | end 16 | end 17 | 18 | nedges = e-1; 19 | tmp = edge_id; 20 | ndx = find(tmp); 21 | tmp(ndx) = tmp(ndx)+nedges; 22 | edge_id = edge_id + triu(tmp)'; 23 | 24 | 25 | if 0 26 | ndx = find(adj_mat); 27 | nedges = length(ndx); 28 | nnodes = length(adj_mat); 29 | edge_id = zeros(1, nnodes*nnodes); 30 | edge_id(ndx) = 1:nedges; 31 | edge_id = reshape(edge_id, nnodes, nnodes); 32 | end 33 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/draw_circle.m: -------------------------------------------------------------------------------- 1 | function h = draw_circle(x, r, outline_color, fill_color) 2 | % draw filled circles at centers x with radii r. 3 | % x is a matrix of columns. r is a row vector. 4 | 5 | n = 40; % resolution 6 | radians = [0:(2*pi)/(n-1):2*pi]; 7 | unitC = [sin(radians); cos(radians)]; 8 | 9 | % extend r if necessary 10 | if length(r) < cols(x) 11 | r = [r repmat(r(length(r)), 1, cols(x)-length(r))]; 12 | end 13 | 14 | h = []; 15 | % hold is needed for fill() 16 | held = ishold; 17 | hold on 18 | for i=1:cols(x) 19 | y = unitC*r(i) + repmat(x(:, i), 1, n); 20 | if nargin < 4 21 | h = [h line(y(1,:), y(2,:), 'Color', outline_color)]; 22 | else 23 | h = [h fill(y(1,:), y(2,:), fill_color, 'EdgeColor', outline_color)]; 24 | end 25 | end 26 | if ~held 27 | hold off 28 | end 29 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/optimalMatchingIntProg.m~: -------------------------------------------------------------------------------- 1 | function ass = optimalMatchingIntProg(dst) 2 | % OPTIMALMATCHINGINTPROG Use binary integer programming to solve for optimal linear assignment 3 | % function a = optimalMatchingIntProg(dst) 4 | 5 | [p1 p2] = size(dst); 6 | c = dst(:); % vectorize cost matrix 7 | 8 | % Constraints - See Marciel & Costeira paper 9 | % row sum 10 | A2 = kron(eye(p1), ones(1,p2)); 11 | b2 = ones(p1,1); 12 | 13 | % col sum 14 | A3 = kron(ones(1,p1), eye(p2)); 15 | b3 = ones(p2,1); 16 | 17 | if p1 < p2 18 | A = A2; b = b2; 19 | elseif p1 > p2 20 | A = A3; b = b3; 21 | else 22 | % enforce doubly stochastic 23 | A = [A2;A3]; 24 | b = [b2; b3]; 25 | end 26 | 27 | Aineq = zeros(1, p1*p2); 28 | bineq = 0; 29 | ass = bintprog(c, Aineq, bineq, A, b); 30 | ass = reshape(ass, p1, p2); 31 | -------------------------------------------------------------------------------- /util/fun_curX.m: -------------------------------------------------------------------------------- 1 | function [data] = fun_curX(trks, nTrks, trkTime, curTime, cur_trkInd) 2 | % FUN_CURX: Summary of this function goes here 3 | % Detailed explanation goes here 4 | % --------------------------------------------------------------------- % 5 | % May 15, 2014, Jing Shao 6 | % If you use this code, please cite the paper: 7 | % J. Shao, C. C. Loy, X. Wang, "Scene-Independent Group Profiling in Crowd", CVPR, 2014. 8 | 9 | curXset = zeros(2,nTrks); 10 | curIndex = find(trkTime(1,:)<=curTime & trkTime(2,:)>=curTime)'; 11 | for i = 1 : length(curIndex) 12 | curTrk = trks(1,curIndex(i)); 13 | pointIndex = find(curTrk.t == curTime); 14 | curXset(1,curIndex(i)) = curTrk.x(pointIndex); 15 | curXset(2,curIndex(i)) = curTrk.y(pointIndex); 16 | end 17 | data = curXset(:,cur_trkInd)'; 18 | 19 | end 20 | 21 | -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/blas/blas.h: -------------------------------------------------------------------------------- 1 | /* blas.h -- C header file for BLAS Ver 1.0 */ 2 | /* Jesse Bennett March 23, 2000 */ 3 | 4 | /** barf [ba:rf] 2. "He suggested using FORTRAN, and everybody barfed." 5 | 6 | - From The Shogakukan DICTIONARY OF NEW ENGLISH (Second edition) */ 7 | 8 | #ifndef BLAS_INCLUDE 9 | #define BLAS_INCLUDE 10 | 11 | /* Data types specific to BLAS implementation */ 12 | typedef struct { float r, i; } fcomplex; 13 | typedef struct { double r, i; } dcomplex; 14 | typedef int blasbool; 15 | 16 | #include "blasp.h" /* Prototypes for all BLAS functions */ 17 | 18 | #define FALSE 0 19 | #define TRUE 1 20 | 21 | /* Macro functions */ 22 | #define MIN(a,b) ((a) <= (b) ? (a) : (b)) 23 | #define MAX(a,b) ((a) >= (b) ? (a) : (b)) 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /descriptor/gactoolbox/gdlfiles/gdlDirectedAffinity.m: -------------------------------------------------------------------------------- 1 | function L_i = gdlDirectedAffinity (graphW, cluster_i, cluster_j) 2 | %% Compute conditional complexity from the subpart of the weighted adjacency matrix 3 | % Inputs: 4 | % - graphW: the matrix P 5 | % - cluster_i: index vector of cluster i 6 | % - cluster_j: index vector of cluster j 7 | % Output: 8 | % - L_ij - the sum of conditional complexities of cluster i and j after merging. 9 | % by Wei Zhang (wzhang009 at gmail.com), Nov., 7, 2011 10 | %%%%%%% this function is replaced by gacPathAffinity_fast_c (MEX-file) 11 | %%%%%%% this file is kept for easy reading 12 | % j1 -> i -> j2, j2 -> i -> j1 13 | 14 | % num_i = numel(cluster_i); 15 | % num_j = numel(cluster_j); 16 | 17 | L_i = sum(graphW(cluster_i, cluster_j),1)*sum(graphW(cluster_j, cluster_i),2); % / (num_i*num_i); 18 | 19 | end 20 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/mixgauss_sample.m: -------------------------------------------------------------------------------- 1 | function [data, indices] = mixgauss_sample(mu, Sigma, mixweights, Nsamples) 2 | % mixgauss_sample Sample data from a mixture of Gaussians 3 | % function [data, indices] = mixgauss_sample(mu, Sigma, mixweights, Nsamples) 4 | % 5 | % Model is P(X) = sum_k mixweights(k) N(X; mu(:,k), Sigma(:,:,k)) or Sigma(k) for scalar 6 | % data(:,i) is the i'th sample from P(X) 7 | % indices(i) is the component from which sample i was drawn 8 | 9 | [D K] = size(mu); 10 | data = zeros(D, Nsamples); 11 | indices = sample_discrete(mixweights, 1, Nsamples); 12 | for k=1:K 13 | if ndims(Sigma) < 3 14 | sig = Sigma(k); 15 | else 16 | sig = Sigma(:,:,k); 17 | end 18 | ndx = find(indices==k); 19 | if length(ndx) > 0 20 | data(:,ndx) = sample_gaussian(mu(:,k), sig, length(ndx))'; 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/pca_kpm.m: -------------------------------------------------------------------------------- 1 | function [pc_vec]=pca_kpm(features,N, method); 2 | % PCA_KPM Compute top N principal components using eigs or svd. 3 | % [pc_vec]=pca_kpm(features,N) 4 | % 5 | % features(:,i) is the i'th example - each COLUMN is an observation 6 | % pc_vec(:,j) is the j'th basis function onto which you should project the data 7 | % using pc_vec' * features 8 | 9 | [d ncases] = size(features); 10 | fm=features-repmat(mean(features,2), 1, ncases); 11 | 12 | 13 | if method==1 % d*d < d*ncases 14 | fprintf('pca_kpm eigs\n'); 15 | options.disp = 0; 16 | C = cov(fm'); % d x d matrix 17 | [pc_vec, evals] = eigs(C, N, 'LM', options); 18 | else 19 | % [U,D,V] = SVD(fm), U(:,i)=evec of fm fm', V(:,i) = evec of fm' fm 20 | fprintf('pca_kpm svds\n'); 21 | [U,D,V] = svds(fm', N); 22 | pc_vec = V; 23 | end 24 | 25 | -------------------------------------------------------------------------------- /CoheGroupDetect/fun_anchorTrk.m: -------------------------------------------------------------------------------- 1 | function [trkAnchor_ind, trkAnchor] = fun_anchorTrk(gr_temp, trks) 2 | 3 | % FUN_ANCHORTRK: Identify anchor tracklet 4 | % Detailed explanation goes here 5 | % --------------------------------------------------------------------- % 6 | % May 15, 2014, Jing Shao 7 | % If you use this code, please cite the paper: 8 | % J. Shao, C. C. Loy, X. Wang, "Scene-Independent Group Profiling in Crowd", CVPR, 2014. 9 | 10 | gr_ind_temp = gr_temp(gr_temp(:,2)~=-1,1); % if trk == -1, that means it cannot be anchor trk 11 | len_trk_temp = []; 12 | for i = 1 : length(gr_ind_temp) 13 | len_trk_temp(i) = length(trks(gr_ind_temp(i)).x); 14 | end 15 | [~,max_ind] = max(len_trk_temp); 16 | trkAnchor_ind = gr_ind_temp(max_ind,1); % anchor tracklet index 17 | trkAnchor = trks(trkAnchor_ind); % anchor tracklet 18 | 19 | end 20 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/partition_matrix_vec.m: -------------------------------------------------------------------------------- 1 | function [m1, m2, K11, K12, K21, K22] = partition_matrix_vec(m, K, n1, n2, bs) 2 | % PARTITION_MATRIX_VEC Partition a vector and matrix into blocks. 3 | % [m1, m2, K11, K12, K21, K22] = partition_matrix_vec(m, K, blocks1, blocks2, bs) 4 | % 5 | % bs(i) = block size of i'th node 6 | % 7 | % Example: 8 | % n1 = [6 8], n2 = [5], bs = [- - - - 2 1 - 2], where - = don't care 9 | % m = [0.1 0.2 0.3 0.4 0.5], K = some 5*5 matrix, 10 | % So E[X5] = [0.1 0.2], E[X6] = [0.3], E[X8] = [0.4 0.5] 11 | % m1 = [0.3 0.4 0.5], m2 = [0.1 0.2]; 12 | 13 | dom = myunion(n1, n2); 14 | n1i = block(find_equiv_posns(n1, dom), bs(dom)); 15 | n2i = block(find_equiv_posns(n2, dom), bs(dom)); 16 | m1 = m(n1i); 17 | m2 = m(n2i); 18 | K11 = K(n1i, n1i); 19 | K12 = K(n1i, n2i); 20 | K21 = K(n2i, n1i); 21 | K22 = K(n2i, n2i); 22 | -------------------------------------------------------------------------------- /descriptor/gactoolbox/gdlfiles/gdlAffinity_increment.m: -------------------------------------------------------------------------------- 1 | function L_ij = gdlAffinity_increment (graphW, cluster_i, cluster_j1, cluster_j2) 2 | %% Compute conditional complexity from the subpart of the weighted adjacency matrix 3 | % Inputs: 4 | % - graphW: the matrix P 5 | % - cluster_i: index vector of cluster i 6 | % - cluster_j: index vector of cluster j 7 | % Output: 8 | % - L_ij - the sum of conditional complexities of cluster i and j after merging. 9 | % by Wei Zhang (wzhang009 at gmail.com), Nov., 7, 2011 10 | %%%%%%% this function is replaced by gacPathAffinity_fast_c (MEX-file) 11 | %%%%%%% this file is kept for easy reading 12 | % j1 -> i -> j2, j2 -> i -> j1 13 | 14 | L_ij = sum(graphW(cluster_j1, cluster_i),1)*sum(graphW(cluster_i, cluster_j2),2) + ... 15 | sum(graphW(cluster_j2, cluster_i),1)*sum(graphW(cluster_i, cluster_j1),2); 16 | 17 | end 18 | -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/tron.h: -------------------------------------------------------------------------------- 1 | #ifndef _TRON_H 2 | #define _TRON_H 3 | 4 | class function 5 | { 6 | public: 7 | virtual double fun(double *w) = 0 ; 8 | virtual void grad(double *w, double *g) = 0 ; 9 | virtual void Hv(double *s, double *Hs) = 0 ; 10 | 11 | virtual int get_nr_variable(void) = 0 ; 12 | virtual ~function(void){} 13 | }; 14 | 15 | class TRON 16 | { 17 | public: 18 | TRON(const function *fun_obj, double eps = 0.1, int max_iter = 1000); 19 | ~TRON(); 20 | 21 | void tron(double *w); 22 | void set_print_string(void (*i_print) (const char *buf)); 23 | 24 | private: 25 | int trcg(double delta, double *g, double *s, double *r); 26 | double norm_inf(int n, double *x); 27 | 28 | double eps; 29 | int max_iter; 30 | function *fun_obj; 31 | void info(const char *fmt,...); 32 | void (*tron_print_string)(const char *buf); 33 | }; 34 | #endif 35 | -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/Makefile: -------------------------------------------------------------------------------- 1 | CXX ?= g++ 2 | CFLAGS = -Wall -Wconversion -O3 -fPIC 3 | SHVER = 2 4 | OS = $(shell uname) 5 | 6 | all: svm-train svm-predict svm-scale 7 | 8 | lib: svm.o 9 | if [ "$(OS)" = "Darwin" ]; then \ 10 | SHARED_LIB_FLAG="-dynamiclib -Wl,-install_name,libsvm.so.$(SHVER)"; \ 11 | else \ 12 | SHARED_LIB_FLAG="-shared -Wl,-soname,libsvm.so.$(SHVER)"; \ 13 | fi; \ 14 | $(CXX) $${SHARED_LIB_FLAG} svm.o -o libsvm.so.$(SHVER) 15 | 16 | svm-predict: svm-predict.c svm.o 17 | $(CXX) $(CFLAGS) svm-predict.c svm.o -o svm-predict -lm 18 | svm-train: svm-train.c svm.o 19 | $(CXX) $(CFLAGS) svm-train.c svm.o -o svm-train -lm 20 | svm-scale: svm-scale.c 21 | $(CXX) $(CFLAGS) svm-scale.c -o svm-scale 22 | svm.o: svm.cpp svm.h 23 | $(CXX) $(CFLAGS) -c svm.cpp 24 | clean: 25 | rm -f *~ svm.o svm-train svm-predict svm-scale libsvm.so.$(SHVER) 26 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/assign_cols.m: -------------------------------------------------------------------------------- 1 | function M = assign_cols(cols, vals, M) 2 | % ASSIGN_COLS Assign values to columns of a matrix 3 | % function M = assign_cols(M, cols, vals, M) 4 | % 5 | % Example: 6 | % M = assign_cols(data, ones(1,N)) 7 | % will construct a 1-of-K encoding of the data, where K=ncols=max(data) and N=nrows=length(data) 8 | % 9 | % Example: 10 | % M = zeros(3,2); 11 | % M = assign_cols([1 2 1], [10 20 30], M) 12 | % is equivalent to 13 | % M(1, 1) = 10 14 | % M(2, 2) = 20 15 | % M(3, 1) = 30 16 | % 17 | 18 | if nargin < 3 19 | nr = length(cols); 20 | nc = max(cols); 21 | M = zeros(nr, nc); 22 | else 23 | [nr nc] = size(M); 24 | end 25 | 26 | if 0 27 | for r=1:nr 28 | M(r, cols(r)) = vals(r); 29 | end 30 | end 31 | 32 | if 1 33 | rows = 1:nr; 34 | ndx = subv2ind([nr nc], [rows(:) cols(:)]); 35 | M(ndx) = vals; 36 | end 37 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/sqdist.m: -------------------------------------------------------------------------------- 1 | function m = sqdist(p, q, A) 2 | % SQDIST Squared Euclidean or Mahalanobis distance. 3 | % SQDIST(p,q) returns m(i,j) = (p(:,i) - q(:,j))'*(p(:,i) - q(:,j)). 4 | % SQDIST(p,q,A) returns m(i,j) = (p(:,i) - q(:,j))'*A*(p(:,i) - q(:,j)). 5 | 6 | % From Tom Minka's lightspeed toolbox 7 | 8 | [d, pn] = size(p); 9 | [d, qn] = size(q); 10 | 11 | if nargin == 2 12 | 13 | pmag = sum(p .* p, 1); 14 | qmag = sum(q .* q, 1); 15 | m = repmat(qmag, pn, 1) + repmat(pmag', 1, qn) - 2*p'*q; 16 | %m = ones(pn,1)*qmag + pmag'*ones(1,qn) - 2*p'*q; 17 | 18 | else 19 | 20 | if isempty(A) | isempty(p) 21 | error('sqdist: empty matrices'); 22 | end 23 | Ap = A*p; 24 | Aq = A*q; 25 | pmag = sum(p .* Ap, 1); 26 | qmag = sum(q .* Aq, 1); 27 | m = repmat(qmag, pn, 1) + repmat(pmag', 1, qn) - 2*p'*Aq; 28 | 29 | end 30 | -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/matlab/make.m: -------------------------------------------------------------------------------- 1 | % This make.m is for MATLAB and OCTAVE under Windows, Mac, and Unix 2 | 3 | try 4 | Type = ver; 5 | % This part is for OCTAVE 6 | if(strcmp(Type(1).Name, 'Octave') == 1) 7 | mex libsvmread.c 8 | mex libsvmwrite.c 9 | mex svmtrain.c ../svm.cpp svm_model_matlab.c 10 | mex svmpredict.c ../svm.cpp svm_model_matlab.c 11 | % This part is for MATLAB 12 | % Add -largeArrayDims on 64-bit machines of MATLAB 13 | else 14 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmread.c 15 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmwrite.c 16 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims svmtrain.c ../svm.cpp svm_model_matlab.c 17 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims svmpredict.c ../svm.cpp svm_model_matlab.c 18 | end 19 | catch 20 | fprintf('If make.m fails, please check README about detailed instructions.\n'); 21 | end 22 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/marg_table.m: -------------------------------------------------------------------------------- 1 | function smallT = marg_table(bigT, bigdom, bigsz, onto, maximize) 2 | % MARG_TABLE Marginalize a table 3 | % smallT = marg_table(bigT, bigdom, bigsz, onto, maximize) 4 | 5 | if nargin < 5, maximize = 0; end 6 | 7 | 8 | smallT = myreshape(bigT, bigsz); % make sure it is a multi-dim array 9 | sum_over = mysetdiff(bigdom, onto); 10 | ndx = find_equiv_posns(sum_over, bigdom); 11 | if maximize 12 | for i=1:length(ndx) 13 | smallT = max(smallT, [], ndx(i)); 14 | end 15 | else 16 | for i=1:length(ndx) 17 | smallT = sum(smallT, ndx(i)); 18 | end 19 | end 20 | 21 | 22 | ns = zeros(1, max(bigdom)); 23 | %ns(bigdom) = mysize(bigT); % ignores trailing dimensions of size 1 24 | ns(bigdom) = bigsz; 25 | 26 | smallT = squeeze(smallT); % remove all dimensions of size 1 27 | smallT = myreshape(smallT, ns(onto)); % put back relevant dims of size 1 28 | -------------------------------------------------------------------------------- /CoheGroupDetect/CoherentTrk/CF_neighbor2pair.m: -------------------------------------------------------------------------------- 1 | function [pairSet,correSet] = CF_neighbor2pair(neighborSet,correlationSet,d) 2 | 3 | zeroNeighborSet=neighborSet{1,1}; 4 | nPoint=size(zeroNeighborSet,1); 5 | 6 | 7 | pairSet=[]; 8 | correSet=[]; 9 | 10 | for i=1:nPoint 11 | 12 | curIntersect=zeroNeighborSet(i,:); 13 | curCorre=zeros(1,size(zeroNeighborSet,2)); 14 | for j=1:d 15 | nextNeighborSet=neighborSet{1,j}; 16 | nextCorreSet=correlationSet{1,j}; 17 | [curIntersect,ia,ib]=intersect(curIntersect,nextNeighborSet(i,:)); % the intersection of neighborhood 18 | curCorre=curCorre(1,ia)+nextCorreSet(i,ib); 19 | end 20 | 21 | if ~isempty(curIntersect) 22 | 23 | 24 | correSet=[correSet curCorre./d]; 25 | pairSet=[pairSet [i*ones(1,length(curIntersect));curIntersect]]; 26 | end 27 | end 28 | 29 | 30 | end 31 | 32 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/mc_stat_distrib.m: -------------------------------------------------------------------------------- 1 | function pi = mc_stat_distrib(P) 2 | % MC_STAT_DISTRIB Compute stationary distribution of a Markov chain 3 | % function pi = mc_stat_distrib(P) 4 | % 5 | % Each row of P should sum to one; pi is a column vector 6 | 7 | % Kevin Murphy, 16 Feb 2003 8 | 9 | % The stationary distribution pi satisfies pi P = pi 10 | % subject to sum_i pi(i) = 1, 0 <= pi(i) <= 1 11 | % Hence 12 | % (P' 0n (pi = (pi 13 | % 1n 0) 1) 1) 14 | % or P2 pi2 = pi2. 15 | % Naively we can solve this using (P2 - I(n+1)) pi2 = 0(n+1) 16 | % or P3 pi2 = 0(n+1), i.e., pi2 = P3 \ zeros(n+1,1) 17 | % but this is singular (because of the sum-to-one constraint). 18 | % Hence we replace the last row of P' with 1s instead of appending ones to create P2, 19 | % and similarly for pi. 20 | 21 | n = length(P); 22 | P4 = P'-eye(n); 23 | P4(end,:) = 1; 24 | pi = P4 \ [zeros(n-1,1);1]; 25 | 26 | 27 | -------------------------------------------------------------------------------- /util/fun_curX_preprocess.m: -------------------------------------------------------------------------------- 1 | function [cur_trk_ind, cur_gr_ind, data] = fun_curX_preprocess(data, cur_gr_ind, cur_trk_ind) 2 | % FUN_CURX_PREPROCESS: Summary of this function goes here 3 | % Detailed explanation goes here 4 | % --------------------------------------------------------------------- % 5 | % May 15, 2014, Jing Shao 6 | % If you use this code, please cite the paper: 7 | % J. Shao, C. C. Loy, X. Wang, "Scene-Independent Group Profiling in Crowd", CVPR, 2014. 8 | 9 | % preprocess 1 10 | cur_gr_ind(data(:,1)==0) = []; 11 | cur_trk_ind(data(:,1)==0) = []; 12 | data(data(:,1)==0,:) = []; 13 | 14 | % preprocess 2: delete duplicate data 15 | [data_temp,data_ind_1,data_ind_2] = unique(data,'rows','stable'); 16 | if length(data_ind_1) ~= length(data_ind_2) 17 | data = data_temp; 18 | cur_gr_ind = cur_gr_ind(data_ind_1); 19 | cur_trk_ind = cur_trk_ind(data_ind_1); 20 | end 21 | 22 | end 23 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/rectintSparseC.m: -------------------------------------------------------------------------------- 1 | function [overlap, normoverlap] = rectintSparseC(A,B) 2 | % 3 | % function [area, normarea] = rectintSparseC(A,B) 4 | % A(i,:) = [x y w h] 5 | % B(j,:) = [x y w h] 6 | % out(i,j) = area of intersection 7 | % 8 | % Same as built-in rectint, but uses less memory. 9 | % Also, returns area of overlap normalized by area of patch. 10 | % See rectintSparse 11 | 12 | if isempty(A) | isempty(B) 13 | overlap = []; 14 | normoverlap = []; 15 | return; 16 | end 17 | 18 | leftA = A(:,1); 19 | bottomA = A(:,2); 20 | rightA = leftA + A(:,3); 21 | topA = bottomA + A(:,4); 22 | 23 | leftB = B(:,1)'; 24 | bottomB = B(:,2)'; 25 | rightB = leftB + B(:,3)'; 26 | topB = bottomB + B(:,4)'; 27 | 28 | numRectA = size(A,1); 29 | numRectB = size(B,1); 30 | 31 | verbose = 0; 32 | [overlap, normoverlap] = rectintSparseLoopC(leftA, rightA, topA, bottomA, leftB, rightB, topB, bottomB, verbose); 33 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/code/demo_fast_sc.m: -------------------------------------------------------------------------------- 1 | function demo_fast_sc(opt_choice) 2 | % opt_choice = 1: use epslion-L1 penalty 3 | % opt_choice = 2: use L1 penalty 4 | 5 | if ~exist('opt_choice', 'var') 6 | opt_choice = 1; 7 | end 8 | 9 | % natural image data 10 | load ../data/IMAGES.mat 11 | X = getdata_imagearray(IMAGES, 14, 10000); 12 | 13 | % sparse coding parameters 14 | num_bases = 128; 15 | beta = 0.4; 16 | batch_size = 1000; 17 | num_iters = 100; 18 | if opt_choice==1 19 | sparsity_func= 'epsL1'; 20 | epsilon = 0.01; 21 | elseif opt_choice==2 22 | sparsity_func= 'L1'; 23 | epsilon = []; 24 | end 25 | 26 | Binit = []; 27 | fname_save = sprintf('../results/sc_%s_b%d_beta%g_%s', sparsity_func, num_bases, beta, datestr(now, 30)); 28 | 29 | % run fast sparse coding 30 | [B S stat] = sparse_coding(X, num_bases, beta, sparsity_func, epsilon, num_iters, batch_size, fname_save, Binit); 31 | -------------------------------------------------------------------------------- /util/dist2.m: -------------------------------------------------------------------------------- 1 | function n2 = dist2(x, c) 2 | %DIST2 Calculates squared distance between two sets of points. 3 | % 4 | % Description 5 | % D = DIST2(X, C) takes two matrices of vectors and calculates the 6 | % squared Euclidean distance between them. Both matrices must be of 7 | % the same column dimension. If X has M rows and N columns, and C has 8 | % L rows and N columns, then the result has M rows and L columns. The 9 | % I, Jth entry is the squared distance from the Ith row of X to the 10 | % Jth row of C. 11 | % 12 | % See also 13 | % GMMACTIV, KMEANS, RBFFWD 14 | % 15 | 16 | % Copyright (c) Christopher M Bishop, Ian T Nabney (1996, 1997) 17 | 18 | [ndata, dimx] = size(x); 19 | [ncentres, dimc] = size(c); 20 | if dimx ~= dimc 21 | error('Data dimension does not match dimension of centres') 22 | end 23 | 24 | n2 = (ones(ncentres, 1) * sum((x.^2)', 1))' + ... 25 | ones(ndata, 1) * sum((c.^2)',1) - ... 26 | 2.*(x*(c')); 27 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/litekmeans.m: -------------------------------------------------------------------------------- 1 | function [center, label] = litekmeans(X, k) 2 | % Perform k-means clustering. 3 | % X: d x n data matrix 4 | % k: number of seeds 5 | % Written by Michael Chen (sth4nth@gmail.com). 6 | n = size(X,2); 7 | last = 0; 8 | label = ceil(k*rand(1,n)); % random initialization 9 | kk = 0; 10 | while any(label ~= last) 11 | [u,~,label] = unique(label); % remove empty clusters 12 | k = length(u); 13 | E = sparse(1:n,label,1,n,k,n); % transform label into indicator matrix 14 | m = X*(E*spdiags(1./sum(E,1)',0,k,k)); % compute m of each cluster 15 | last = label'; % modification 16 | [~,label] = max(bsxfun(@minus,m'*X,dot(m,m,1)'/2),[],1); % assign samples to the nearest centers 17 | fprintf('.'); 18 | kk = kk+1; 19 | if mod(kk, 50) == 0, fprintf('\n'); end 20 | end 21 | [~,~,label] = unique(label); 22 | center = m; 23 | disp('k means clustering has been done!'); -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/plotROC.m: -------------------------------------------------------------------------------- 1 | function [falseAlarmRate, detectionRate, area, th] = plotROC(confidence, testClass, col, varargin) 2 | % function [falseAlarmRate, detectionRate, area, th] = plotroc(confidence, testClass, color) 3 | 4 | if nargin < 3, col = []; end 5 | 6 | [scale01] = process_options(varargin, 'scale01', 1); 7 | 8 | [falseAlarmRate detectionRate area th] = computeROC(confidence, testClass); 9 | 10 | if ~isempty(col) 11 | h=plot(falseAlarmRate, detectionRate, [col '-']); 12 | %set(h, 'linewidth', 2); 13 | ex = 0.05*max(falseAlarmRate); 14 | ey = 0.05; 15 | if scale01 16 | axis([0-ex max(falseAlarmRate)+ex 0-ey 1+ey]) 17 | else 18 | % zoom in on the top left corner 19 | axis([0-ex max(falseAlarmRate)*0.5+ex 0.5-ey 1+ey]) 20 | end 21 | grid on 22 | ylabel('detection rate') 23 | %xlabel('# false alarms') 24 | xlabel('false alarm rate') 25 | end 26 | 27 | -------------------------------------------------------------------------------- /main_gr.m: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %%%%%%%%%%%%% main function of group detection %%%%%%%%%%%%% 3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4 | % June 15, 2014, Jing Shao 5 | % If you use this code, please cite the paper: 6 | % J. Shao, C. C. Loy, X. Wang, "Scene-Independent Group Profiling in Crowd", CVPR, 2014. 7 | 8 | clc;clear;close all 9 | 10 | %% Please make sure add three folders and their subfolders to the path before running code 11 | % They are: CoheGroupDetect, descriptor, util 12 | % CoheGroupDetect contains group detection code, except main function 13 | % descriptor contains descriptor code, except main function 14 | % util contains some utilized code 15 | 16 | %% group detection 17 | main_gr_detection; 18 | 19 | %% group descriptor 20 | main_gr_collectiveness; 21 | main_gr_stability; 22 | main_gr_uniform; 23 | main_gr_conflict; 24 | main_gr_size; 25 | 26 | 27 | 28 | 29 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/mk_stochastic.m: -------------------------------------------------------------------------------- 1 | function [T,Z] = mk_stochastic(T) 2 | % MK_STOCHASTIC Ensure the argument is a stochastic matrix, i.e., the sum over the last dimension is 1. 3 | % [T,Z] = mk_stochastic(T) 4 | % 5 | % If T is a vector, it will sum to 1. 6 | % If T is a matrix, each row will sum to 1. 7 | % If T is a 3D array, then sum_k T(i,j,k) = 1 for all i,j. 8 | 9 | % Set zeros to 1 before dividing 10 | % This is valid since S(j) = 0 iff T(i,j) = 0 for all j 11 | 12 | if (ndims(T)==2) & (size(T,1)==1 | size(T,2)==1) % isvector 13 | [T,Z] = normalise(T); 14 | elseif ndims(T)==2 % matrix 15 | Z = sum(T,2); 16 | S = Z + (Z==0); 17 | norm = repmat(S, 1, size(T,2)); 18 | T = T ./ norm; 19 | else % multi-dimensional array 20 | ns = size(T); 21 | T = reshape(T, prod(ns(1:end-1)), ns(end)); 22 | Z = sum(T,2); 23 | S = Z + (Z==0); 24 | norm = repmat(S, 1, ns(end)); 25 | T = T ./ norm; 26 | T = reshape(T, ns); 27 | end 28 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/extend_domain_table.m: -------------------------------------------------------------------------------- 1 | function B = extend_domain_table(A, smalldom, smallsz, bigdom, bigsz) 2 | % EXTEND_DOMAIN_TABLE Expand an array so it has the desired size. 3 | % B = extend_domain_table(A, smalldom, smallsz, bigdom, bigsz) 4 | % 5 | % A is the array with domain smalldom and sizes smallsz. 6 | % bigdom is the desired domain, with sizes bigsz. 7 | % 8 | % Example: 9 | % smalldom = [1 3], smallsz = [2 4], bigdom = [1 2 3 4], bigsz = [2 1 4 5], 10 | % so B(i,j,k,l) = A(i,k) for i in 1:2, j in 1:1, k in 1:4, l in 1:5 11 | 12 | if isequal(size(A), [1 1]) % a scalar 13 | B = A; % * myones(bigsz); 14 | return; 15 | end 16 | 17 | map = find_equiv_posns(smalldom, bigdom); 18 | sz = ones(1, length(bigdom)); 19 | sz(map) = smallsz; 20 | B = myreshape(A, sz); % add dimensions for the stuff not in A 21 | sz = bigsz; 22 | sz(map) = 1; % don't replicate along A's dimensions 23 | B = myrepmat(B, sz(:)'); 24 | 25 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/collapse_mog.m: -------------------------------------------------------------------------------- 1 | function [new_mu, new_Sigma, new_Sigma2] = collapse_mog(mu, Sigma, coefs) 2 | % COLLAPSE_MOG Collapse a mixture of Gaussians to a single Gaussian by moment matching 3 | % [new_mu, new_Sigma] = collapse_mog(mu, Sigma, coefs) 4 | % 5 | % coefs(i) - weight of i'th mixture component 6 | % mu(:,i), Sigma(:,:,i) - params of i'th mixture component 7 | 8 | % S = sum_c w_c (S_c + m_c m_c' + m m' - 2 m_c m') 9 | % = sum_c w_c (S_c + m_c m_c') + m m' - 2 (sum_c m_c) m' 10 | % = sum_c w_c (S_c + m_c m_c') - m m' 11 | 12 | new_mu = sum(mu * diag(coefs), 2); % weighted sum of columns 13 | 14 | n = length(new_mu); 15 | new_Sigma = zeros(n,n); 16 | new_Sigma2 = zeros(n,n); 17 | for j=1:length(coefs) 18 | m = mu(:,j) - new_mu; 19 | new_Sigma = new_Sigma + coefs(j) * (Sigma(:,:,j) + m*m'); 20 | new_Sigma2 = new_Sigma2 + coefs(j) * (Sigma(:,:,j) + mu(:,j)*mu(:,j)'); 21 | end 22 | %assert(approxeq(new_Sigma, new_Sigma2 - new_mu*new_mu')) 23 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/partial_corr_coef.m: -------------------------------------------------------------------------------- 1 | function [r, c] = partial_corr_coef(S, i, j, Y) 2 | % PARTIAL_CORR_COEF Compute a partial correlation coefficient 3 | % [r, c] = partial_corr_coef(S, i, j, Y) 4 | % 5 | % S is the covariance (or correlation) matrix for X, Y, Z 6 | % where X=[i j], Y is conditioned on, and Z is marginalized out. 7 | % Let S2 = Cov[X | Y] be the partial covariance matrix. 8 | % Then c = S2(i,j) and r = c / sqrt( S2(i,i) * S2(j,j) ) 9 | % 10 | 11 | % Example: Anderson (1984) p129 12 | % S = [1.0 0.8 -0.4; 13 | % 0.8 1.0 -0.56; 14 | % -0.4 -0.56 1.0]; 15 | % r(1,3 | 2) = 0.0966 16 | % 17 | % Example: Van de Geer (1971) p111 18 | %S = [1 0.453 0.322; 19 | % 0.453 1.0 0.596; 20 | % 0.322 0.596 1]; 21 | % r(2,3 | 1) = 0.533 22 | 23 | X = [i j]; 24 | i2 = 1; % find_equiv_posns(i, X); 25 | j2 = 2; % find_equiv_posns(j, X); 26 | S2 = S(X,X) - S(X,Y)*inv(S(Y,Y))*S(Y,X); 27 | c = S2(i2,j2); 28 | r = c / sqrt(S2(i2,i2) * S2(j2,j2)); 29 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/Kalman/learn_AR.m: -------------------------------------------------------------------------------- 1 | function [coef, C] = learn_AR(data, k) 2 | % Find the ML parameters of a vector autoregressive process of order k. 3 | % [coef, C] = learn_AR(k, data) 4 | % data{l}(:,t) = the observations at time t in sequence l 5 | 6 | warning('learn_AR seems to be broken'); 7 | 8 | nex = length(data); 9 | obs = cell(1, nex); 10 | for l=1:nex 11 | obs{l} = convert_to_lagged_form(data{l}, k); 12 | end 13 | 14 | % The initial parameter values don't matter, since this is a perfectly observable problem. 15 | % However, the size of F must be set correctly. 16 | y = data{1}; 17 | [s T] = size(y); 18 | coef = rand(s,s,k); 19 | C = rand_psd(s); 20 | [F,H,Q,R,initx,initV] = AR_to_SS(coef, C, y); 21 | 22 | max_iter = 1; 23 | fully_observed = 1; 24 | diagQ = 0; 25 | diagR = 0; 26 | [F, H, Q, R, initx, initV, loglik] = ... 27 | learn_kalman(obs, F, H, Q, R, initx, initV, max_iter, diagQ, diagR, fully_observed); 28 | 29 | [coef, C] = SS_to_AR(F, Q, k); 30 | 31 | -------------------------------------------------------------------------------- /util/SVM/libsvm-3.17/java/libsvm/svm_model.java: -------------------------------------------------------------------------------- 1 | // 2 | // svm_model 3 | // 4 | package libsvm; 5 | public class svm_model implements java.io.Serializable 6 | { 7 | public svm_parameter param; // parameter 8 | public int nr_class; // number of classes, = 2 in regression/one class svm 9 | public int l; // total #SV 10 | public svm_node[][] SV; // SVs (SV[l]) 11 | public double[][] sv_coef; // coefficients for SVs in decision functions (sv_coef[k-1][l]) 12 | public double[] rho; // constants in decision functions (rho[k*(k-1)/2]) 13 | public double[] probA; // pariwise probability information 14 | public double[] probB; 15 | public int[] sv_indices; // sv_indices[0,...,nSV-1] are values in [1,...,num_traning_data] to indicate SVs in the training set 16 | 17 | // for classification only 18 | 19 | public int[] label; // label of each class (label[k]) 20 | public int[] nSV; // number of SVs for each class (nSV[k]) 21 | // nSV[0] + nSV[1] + ... + nSV[k-1] = l 22 | }; 23 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fast_sc/code/display_figures.m: -------------------------------------------------------------------------------- 1 | function display_figures(pars, stat, A, S, t) 2 | ws = sqrt(size(A,1)); 3 | figure(1), display_network_nonsquare2(A); % display_network(A,[],1); 4 | title(sprintf('%d iteration (%g min)', t, sum(stat.elapsed_time)/60)); 5 | 6 | figure(3); plot([1:t], stat.fobj_avg, [1:t], stat.fresidue_avg, [1:t], stat.fsparsity_avg); 7 | legend('fobj avg', 'fresidue avg', 'fsparsity avg'); 8 | title(sprintf('fobj=%f -> fobj=%f, %d iterations', stat.fobj_avg(1), stat.fobj_avg(end), length(stat.fobj_avg))); 9 | 10 | if ~isempty(S) 11 | figure(5); plot(sort(abs(S(:)))); 12 | if strcmp(pars.sparsity_func,'huberL1') 13 | figure(6); hist(pars.beta.*huber_func(S(:)/pars.sigma, pars.epsilon),30); 14 | elseif strcmp(pars.sparsity_func,'epsL1') 15 | figure(6); hist(pars.beta.*sqrt(pars.epsilon+(S(:)/pars.sigma).^2),30); 16 | else 17 | figure(6); hist(pars.beta.*log(1+(S(:)/pars.sigma).^2),30); 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/matlab/make.m: -------------------------------------------------------------------------------- 1 | % This make.m is for MATLAB and OCTAVE under Windows, Mac, and Unix 2 | 3 | try 4 | Type = ver; 5 | % This part is for OCTAVE 6 | if(strcmp(Type(1).Name, 'Octave') == 1) 7 | mex libsvmread.c 8 | mex libsvmwrite.c 9 | mex train.c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/*.c 10 | mex predict.c linear_model_matlab.c ../linear.cpp ../tron.cpp ../blas/*.c 11 | % This part is for MATLAB 12 | % Add -largeArrayDims on 64-bit machines of MATLAB 13 | else 14 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmread.c 15 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims libsvmwrite.c 16 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims train.c linear_model_matlab.c ../linear.cpp ../tron.cpp "../blas/*.c" 17 | mex CFLAGS="\$CFLAGS -std=c99" -largeArrayDims predict.c linear_model_matlab.c ../linear.cpp ../tron.cpp "../blas/*.c" 18 | end 19 | catch 20 | fprintf('If make.m fails, please check README about detailed instructions.\n'); 21 | end 22 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/image_rgb.m: -------------------------------------------------------------------------------- 1 | function image_rgb(M) 2 | % Show a matrix of integers as a color image. 3 | % This is like imagesc, except we know what the mapping is from integer to color. 4 | % If entries of M contain integers in {1,2,3}, we map 5 | % this to red/green/blue 6 | 7 | cmap = [1 0 0; % red 8 | 0 1 0; % green 9 | 0 0 1; % blue 10 | 127/255 1 212/255]; % aquamarine 11 | image(M) 12 | set(gcf,'colormap', cmap); 13 | 14 | if 1 15 | % make dummy handles, one per object type, for the legend 16 | str = {}; 17 | for i=1:size(cmap,1) 18 | dummy_handle(i) = line([0 0.1], [0 0.1]); 19 | set(dummy_handle(i), 'color', cmap(i,:)); 20 | set(dummy_handle(i), 'linewidth', 2); 21 | str{i} = num2str(i); 22 | end 23 | legend(dummy_handle, str, -1); 24 | end 25 | 26 | if 0 27 | [nrows ncols] = size(M); 28 | img = zeros(nrows, ncols, 3); 29 | for r=1:nrows 30 | for c=1:ncols 31 | q = M(r,c); 32 | img(r,c,q) = 1; 33 | end 34 | end 35 | image(img) 36 | end 37 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/mkdirKPM.m: -------------------------------------------------------------------------------- 1 | function mkdirKPM(dname) 2 | % function mkdirKPM(dname) 3 | % If directory does not exist, make it 4 | % 5 | % mkdirKPM('foo\bar\baz') makes subdirectories bar and baz 6 | % mkdirKPM('foo\bar\baz.txt') makes subdirectories bar 7 | 8 | % convert foo\bar\baz to pathstr=foo\bar, name=baz 9 | % convert foo\bar\baz.txt to pathstr=foo\bar, name=baz 10 | [pathstr, name, ext, versn] = fileparts(dname); 11 | if ~isempty(ext) % we stripped off something after final period 12 | % convert foo\bar to pathstr=foo, name=bar 13 | % convert foo\bar.bad to pathstr=foo, name=bar.bad 14 | [pathstr, name, ext, versn] = fileparts(pathstr); 15 | name = sprintf('%s%s', name, ext); % in case there is a period in the directory name 16 | end 17 | 18 | dname = fullfile(pathstr, name); 19 | if ~exist(dname, 'dir') 20 | %fprintf('mkdirKPM: making %s, %s \n', pathstr, name); 21 | mkdir(pathstr, name) 22 | else 23 | %fprintf('mkdirKPM: %s already exists\n', dname) 24 | end 25 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/strmatch_substr.m: -------------------------------------------------------------------------------- 1 | function ndx = strmatch_substr(str, strs) 2 | % STRMATCH_SUBSTR Like strmatch, except str can match any part of strs{i}, not just prefix. 3 | % ndx = strmatch_substr(str, strs) 4 | % 5 | % Example: 6 | % i = strmatch('max', {'max','minimax','maximum'}) 7 | % returns i = [1; 3] since only 1 and 3 begin with max, but 8 | % i = strmatch_substr('max', {'max','minimax','maximum'}) 9 | % returns i = [1;2;3]; 10 | % 11 | % If str is also a cell array, it is like calling strmatch_substr several times 12 | % and concatenating the results. 13 | % Example: 14 | % 15 | % i = strmatch_substr({'foo', 'dog'}, {'foo', 'hoofoo', 'dog'}) 16 | % returns i = [1;2;3] 17 | 18 | ndx = []; 19 | if ~iscell(str), str = {str}; end 20 | for j=1:length(str) 21 | for i=1:length(strs) 22 | %ind = strfind(strs{i}, str{j}); % not supported in 6.0 23 | ind = findstr(strs{i}, str{j}); 24 | if ~isempty(ind) 25 | ndx = [ndx; i]; 26 | end 27 | end 28 | end 29 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/normalise.m: -------------------------------------------------------------------------------- 1 | function [M, z] = normalise(A, dim) 2 | % NORMALISE Make the entries of a (multidimensional) array sum to 1 3 | % [M, c] = normalise(A) 4 | % c is the normalizing constant 5 | % 6 | % [M, c] = normalise(A, dim) 7 | % If dim is specified, we normalise the specified dimension only, 8 | % otherwise we normalise the whole array. 9 | 10 | if nargin < 2 11 | z = sum(A(:)); 12 | % Set any zeros to one before dividing 13 | % This is valid, since c=0 => all i. A(i)=0 => the answer should be 0/1=0 14 | s = z + (z==0); 15 | M = A / s; 16 | elseif dim==1 % normalize each column 17 | z = sum(A); 18 | s = z + (z==0); 19 | %M = A ./ (d'*ones(1,size(A,1)))'; 20 | M = A ./ repmatC(s, size(A,1), 1); 21 | else 22 | % Keith Battocchi - v. slow because of repmat 23 | z=sum(A,dim); 24 | s = z + (z==0); 25 | L=size(A,dim); 26 | d=length(size(A)); 27 | v=ones(d,1); 28 | v(dim)=L; 29 | %c=repmat(s,v); 30 | c=repmat(s,v'); 31 | M=A./c; 32 | end 33 | 34 | 35 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/normalize.m: -------------------------------------------------------------------------------- 1 | function [M, z] = normalise(A, dim) 2 | % NORMALISE Make the entries of a (multidimensional) array sum to 1 3 | % [M, c] = normalise(A) 4 | % c is the normalizing constant 5 | % 6 | % [M, c] = normalise(A, dim) 7 | % If dim is specified, we normalise the specified dimension only, 8 | % otherwise we normalise the whole array. 9 | 10 | if nargin < 2 11 | z = sum(A(:)); 12 | % Set any zeros to one before dividing 13 | % This is valid, since c=0 => all i. A(i)=0 => the answer should be 0/1=0 14 | s = z + (z==0); 15 | M = A / s; 16 | elseif dim==1 % normalize each column 17 | z = sum(A); 18 | s = z + (z==0); 19 | %M = A ./ (d'*ones(1,size(A,1)))'; 20 | M = A ./ repmatC(s, size(A,1), 1); 21 | else 22 | % Keith Battocchi - v. slow because of repmat 23 | z=sum(A,dim); 24 | s = z + (z==0); 25 | L=size(A,dim); 26 | d=length(size(A)); 27 | v=ones(d,1); 28 | v(dim)=L; 29 | %c=repmat(s,v); 30 | c=repmat(s,v'); 31 | M=A./c; 32 | end 33 | 34 | 35 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/gaussian_prob.m: -------------------------------------------------------------------------------- 1 | function p = gaussian_prob(x, m, C, use_log) 2 | % GAUSSIAN_PROB Evaluate a multivariate Gaussian density. 3 | % p = gaussian_prob(X, m, C) 4 | % p(i) = N(X(:,i), m, C) where C = covariance matrix and each COLUMN of x is a datavector 5 | 6 | % p = gaussian_prob(X, m, C, 1) returns log N(X(:,i), m, C) (to prevents underflow). 7 | % 8 | % If X has size dxN, then p has size Nx1, where N = number of examples 9 | 10 | if nargin < 4, use_log = 0; end 11 | 12 | if length(m)==1 % scalar 13 | x = x(:)'; 14 | end 15 | [d, N] = size(x); 16 | %assert(length(m)==d); % slow 17 | m = m(:); 18 | M = m*ones(1,N); % replicate the mean across columns 19 | C(3,3) = 1; 20 | denom = (2*pi)^(d/2)*sqrt(abs(det(C))); 21 | mahal = sum(((x-M)'*pinv(C)).*(x-M)',2); % Chris Bregler's trick 22 | if any(mahal<0) 23 | warning('mahal < 0 => C is not psd') 24 | end 25 | if use_log 26 | p = -0.5*mahal - log(denom); 27 | % p = -0.5*mahal; 28 | else 29 | p = exp(-0.5*mahal) / (denom+eps); 30 | end -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/approx_unique.m: -------------------------------------------------------------------------------- 1 | function [B, keep] = approx_unique(A, thresh, flag) 2 | % APPROX_UNIQUE Return elements of A that differ from the rest by less than thresh 3 | % B = approx_unique(A, thresh) 4 | % B = approx_unique(A, thresh, 'rows') 5 | 6 | keep = []; 7 | 8 | if nargin < 3 | isempty(flag) 9 | A = sort(A) 10 | B = A(1); 11 | for i=2:length(A) 12 | if ~approxeq(A(i), A(i-1), thresh) 13 | B = [B A(i)]; 14 | keep = [keep i]; 15 | end 16 | end 17 | else 18 | % A = sortrows(A); 19 | % B = A(1,:); 20 | % for i=2:size(A,1) 21 | % if ~approxeq(A(i,:), A(i-1,:), thresh) 22 | % B = [B; A(i,:)]; 23 | % keep = [keep i]; 24 | % end 25 | % end 26 | B = []; 27 | for i=1:size(A,1) 28 | duplicate = 0; 29 | for j=i+1:size(A,1) 30 | if approxeq(A(i,:), A(j,:), thresh) 31 | duplicate = 1; 32 | break; 33 | end 34 | end 35 | if ~duplicate 36 | B = [B; A(i,:)]; 37 | keep = [keep i]; 38 | end 39 | end 40 | end 41 | 42 | -------------------------------------------------------------------------------- /descriptor/gr_conflict/conflict_dict/fun_codebook_computation.m: -------------------------------------------------------------------------------- 1 | function CodeBook = fun_codebook_computation(param, descripMtx) 2 | 3 | % FUN_CODEBOOK_COMPUTATION: Compute codebook 4 | % Detailed explanation goes here 5 | % --------------------------------------------------------------------- % 6 | % May 15, 2014, Jing Shao 7 | % If you use this code, please cite the paper: 8 | % J. Shao, C. C. Loy, X. Wang, "Scene-Independent Group Profiling in Crowd", CVPR, 2014. 9 | 10 | if strcmp(param.codebook, 'sparse_coding') 11 | func = param.sc.func; 12 | num_basis = param.num_basis; 13 | num_trials = param.sc.trials; 14 | beta = param.sc.beta; 15 | batch_size = param.sc.batch; 16 | [CodeBook U stat] = sparse_coding(descripMtx, num_basis, beta, func, [], num_trials, batch_size); 17 | elseif strcmp(param.codebook, 'kmeans') 18 | num_basis = param.num_basis; 19 | [CodeBook, ~] = litekmeans(descripMtx, num_basis); 20 | param.num_basis = size(CodeBook, 2); 21 | end 22 | 23 | end -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMstats/condgaussTrainObserved.m: -------------------------------------------------------------------------------- 1 | function [mu, Sigma] = mixgaussTrainObserved(obsData, hiddenData, nstates, varargin); 2 | % mixgaussTrainObserved Max likelihood estimates of conditional Gaussian from raw data 3 | % function [mu, Sigma] = mixgaussTrainObserved(obsData, hiddenData, nstates, ...); 4 | % 5 | % Input: 6 | % obsData(:,i) 7 | % hiddenData(i) - this is the mixture component label for example i 8 | % Optional arguments - same as mixgauss_Mstep 9 | % 10 | % Output: 11 | % mu(:,q) 12 | % Sigma(:,:,q) - same as mixgauss_Mstep 13 | 14 | [D numex] = size(obsData); 15 | Y = zeros(D, nstates); 16 | YY = zeros(D,D,nstates); 17 | YTY = zeros(nstates,1); 18 | w = zeros(nstates, 1); 19 | for q=1:nstates 20 | ndx = find(hiddenData==q); 21 | w(q) = length(ndx); % each data point has probability 1 of being in this cluster 22 | data = obsData(:,ndx); 23 | Y(:,q) = sum(data,2); 24 | YY(:,:,q) = data*data'; 25 | YTY(q) = sum(diag(data'*data)); 26 | end 27 | [mu, Sigma] = mixgauss_Mstep(w, Y, YY, YTY, varargin{:}); 28 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/hash_lookup.m: -------------------------------------------------------------------------------- 1 | function [val, found, Nentries] = hash_lookup(key, fname) 2 | % HASH_LOOKUP Lookup a key in a hash table stored in a file using linear search 3 | % function [val, found, Nentries] = hash_lookup(key, filename) 4 | % 5 | % Example: 6 | % If htbl.mat does not exist, 7 | % [val,found,N] = hash_lookup('foo', 'htbl') 8 | % returns found val = [], found = 0, N = 0 9 | % hash_add('foo', 42, 'htbl') 10 | % hash_add('bar', [1:10], 'htbl') 11 | % [val,found,N] = hash_lookup('foo', 'htbl') 12 | % now returns val = 42, found = 1, N = 2 13 | % 14 | % Type 'delete htbl' to delete the file/ reset the hashtable 15 | 16 | 17 | val = []; 18 | found = 0; 19 | 20 | if exist(fname, 'file')==0 21 | % new hashtable 22 | Nentries = 0; 23 | else 24 | %hashtable = importdata(fname); 25 | load(fname); 26 | Nentries = length(hashtable.key); 27 | for i=1:Nentries 28 | if isequal(hashtable.key{i}, key) 29 | val = hashtable.value{i}; 30 | found = 1; 31 | break; 32 | end 33 | end 34 | end 35 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/rotate_xlabel.m: -------------------------------------------------------------------------------- 1 | function hText = rotate_xlabel(degrees, newlabels) 2 | 3 | % Posted to comp.soft-sys.matlab on 2003-05-01 13:45:36 PST 4 | % by David Borger (borger@ix.netcom.com) 5 | 6 | xtl = get(gca,'XTickLabel'); 7 | set(gca,'XTickLabel',''); 8 | lxtl = length(xtl); 9 | xtl = newlabels; 10 | if 0 % nargin>1 11 | lnl = length(newlabels); 12 | if lnl~=lxtl 13 | error('Number of new labels must equal number of old'); 14 | end; 15 | xtl = newlabels; 16 | end; 17 | 18 | 19 | hxLabel=get(gca,'XLabel'); 20 | xLP=get(hxLabel,'Position'); 21 | y=xLP(2); 22 | XTick=get(gca,'XTick'); 23 | y=repmat(y,length(XTick),1); 24 | %fs=get(gca,'fontsize'); 25 | fs = 12; 26 | hText=text(XTick,y,xtl,'fontsize',fs); 27 | set(hText,'Rotation',degrees,'HorizontalAlignment','right'); 28 | 29 | % Modifications by KPM 30 | 31 | ylim = get(gca,'ylim'); 32 | height = ylim(2)-ylim(1); 33 | N = length(hText); 34 | for i=1:N 35 | voffset = ylim(2) - 0*height; 36 | set(hText(i), 'position', [i voffset 0]); 37 | end 38 | -------------------------------------------------------------------------------- /util/SVM/liblinear-1.93/Makefile.win: -------------------------------------------------------------------------------- 1 | #You must ensure nmake.exe, cl.exe, link.exe are in system path. 2 | #VCVARS32.bat 3 | #Under dosbox prompt 4 | #nmake -f Makefile.win 5 | 6 | ########################################## 7 | CXX = cl.exe 8 | CFLAGS = -nologo -O2 -EHsc -I. -D __WIN32__ -D _CRT_SECURE_NO_DEPRECATE 9 | TARGET = windows 10 | 11 | all: $(TARGET)\train.exe $(TARGET)\predict.exe 12 | 13 | $(TARGET)\train.exe: tron.obj linear.obj train.c blas\*.c 14 | $(CXX) $(CFLAGS) -Fe$(TARGET)\train.exe tron.obj linear.obj train.c blas\*.c 15 | 16 | $(TARGET)\predict.exe: tron.obj linear.obj predict.c blas\*.c 17 | $(CXX) $(CFLAGS) -Fe$(TARGET)\predict.exe tron.obj linear.obj predict.c blas\*.c 18 | 19 | linear.obj: linear.cpp linear.h 20 | $(CXX) $(CFLAGS) -c linear.cpp 21 | 22 | tron.obj: tron.cpp tron.h 23 | $(CXX) $(CFLAGS) -c tron.cpp 24 | 25 | lib: linear.cpp linear.h linear.def tron.obj 26 | $(CXX) $(CFLAGS) -LD linear.cpp tron.obj blas\*.c -Fe$(TARGET)\liblinear -link -DEF:linear.def 27 | 28 | clean: 29 | -erase /Q *.obj $(TARGET)\. 30 | 31 | -------------------------------------------------------------------------------- /util/fun_trkInfo.m: -------------------------------------------------------------------------------- 1 | function [trkTime, lenTime, nTrks, trkTimeLine] = fun_trkInfo(trks) 2 | 3 | % FUN_TRKINFO: Summary of this function goes here 4 | % Detailed explanation goes here 5 | % --------------------------------------------------------------------- % 6 | % Output: trkTime -- store all trks' start_frame and end_frame 7 | % lenTime -- max frame 8 | % nTrks -- the number of trks 9 | % trkTimeLine -- record each track's period 10 | % --------------------------------------------------------------------- % 11 | % May 15, 2014, Jing Shao 12 | % If you use this code, please cite the paper: 13 | % J. Shao, C. C. Loy, X. Wang, "Scene-Independent Group Profiling in Crowd", CVPR, 2014. 14 | 15 | 16 | nTrks = length(trks); 17 | trkTime = zeros(2,nTrks); 18 | for i = 1 : length(trks) 19 | trkTime(:,i) = [trks(i).t(1); trks(i).t(end)]; 20 | end 21 | lenTime = max(trkTime(2,:)); 22 | 23 | trkTimeLine = zeros(nTrks,max(trkTime(:))); 24 | for i = 1 : nTrks 25 | trkTimeLine(i,trkTime(1,i):trkTime(2,i)) = 1; 26 | end 27 | 28 | end -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/set_xtick_label_demo.m: -------------------------------------------------------------------------------- 1 | 2 | % Generate some test data. Assume that the X-axis represents months. 3 | x = 1:12; 4 | y = 10*rand(1,length(x)); 5 | 6 | % Plot the data. 7 | h = plot(x,y,'+'); 8 | 9 | % Add a title. 10 | title('This is a title') 11 | 12 | % Set the X-Tick locations so that every other month is labeled. 13 | Xt = 1:2:11; 14 | Xl = [1 12]; 15 | set(gca,'XTick',Xt,'XLim',Xl); 16 | 17 | % Add the months as tick labels. 18 | months = ['Jan'; 19 | 'Feb'; 20 | 'Mar'; 21 | 'Apr'; 22 | 'May'; 23 | 'Jun'; 24 | 'Jul'; 25 | 'Aug'; 26 | 'Sep'; 27 | 'Oct'; 28 | 'Nov'; 29 | 'Dec']; 30 | 31 | set_xtick_label(months(1:2:12, :), 90, 'xaxis label'); 32 | 33 | 34 | 35 | if 0 36 | 37 | 38 | % Generate some test data. Assume that the X-axis represents months. 39 | x = 1:8; 40 | y = 10*rand(1,length(x)); 41 | 42 | % Plot the data. 43 | h = plot(x,y,'+'); 44 | 45 | S = subsets(1:3); 46 | str = cell(1,8); 47 | for i=1:2^3 48 | str{i} = num2str(S{i}); 49 | end 50 | set_xtick_label(str); 51 | 52 | end 53 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/initFigures.m~: -------------------------------------------------------------------------------- 1 | % initFigures 2 | % Position 6 figures on the edges of the screen. 3 | % [xmin ymin w h] where (0,0) = bottom left 4 | % Numbers assume screen resolution is 1024 x 1280 5 | 6 | global FIGNUM NUMFIGS 7 | FIGNUM = 1; NUMFIGS = 6; 8 | 9 | screenMain = true; % set to false if initializing figures for second screen 10 | 11 | if screenMain 12 | xoff = 0; 13 | else 14 | xoff = 1280; 15 | end 16 | 17 | % 2 x 3 design 18 | w = 400; h = 300; 19 | xs = [10 450 875] + xoff; 20 | ys = [650 40]; 21 | 22 | if 0 23 | % 3x3 design 24 | w = 350; h = 250; 25 | xs = [10 380 750]+xoff; 26 | ys = [700 350 10]; 27 | end 28 | 29 | 30 | Nfigs = length(xs)*length(ys); 31 | if screenMain 32 | fig = 1; 33 | else 34 | fig = Nfigs + 1; 35 | end 36 | 37 | for yi=1:length(ys) 38 | for xi=1:length(xs) 39 | figure(fig); 40 | set(gcf, 'position', [xs(xi) ys(yi) w h]); 41 | fig = fig + 1; 42 | end 43 | end 44 | 45 | % To plot something on the next available figure (with wrap around), use 46 | % sfigure(FIGNUM); clf; FIGNUM = wrap(FIGNUM+1, NUMFIGS); 47 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/nchoose2.m: -------------------------------------------------------------------------------- 1 | function c = nchoose2(v, f) 2 | %NCHOOSE2 All combinations of N elements taken two at a time. 3 | % 4 | % NCHOOSE2(1:N) or NCHOOSEK(V) where V is a vector of length N, 5 | % produces a matrix with N*(N-1)/2 rows and K columns. Each row of 6 | % the result has K of the elements in the vector V. 7 | % 8 | % NCHOOSE2(N,FLAG) is the same as NCHOOSE2(1:N) but faster. 9 | % 10 | % NCHOOSE2(V) is much faster than NCHOOSEK(V,2). 11 | % 12 | % See also NCHOOSEK, PERMS. 13 | 14 | % Author: Peter J. Acklam 15 | % Time-stamp: 2000-03-03 13:03:59 16 | % E-mail: jacklam@math.uio.no 17 | % URL: http://www.math.uio.no/~jacklam 18 | 19 | nargs = nargin; 20 | if nargs < 1 21 | error('Not enough input arguments.'); 22 | elseif nargs == 1 23 | v = v(:); 24 | n = length(v); 25 | elseif nargs == 2 26 | n = v; 27 | else 28 | error('Too many input arguments.'); 29 | end 30 | 31 | [ c(:,2), c(:,1) ] = find( tril( ones(n), -1 ) ); 32 | 33 | if nargs == 1 34 | c = v(c); 35 | end 36 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/bipartiteMatchingIntProg.m~: -------------------------------------------------------------------------------- 1 | function [a,ass] = optimalMatchingIntProg(dst) 2 | % OPTIMALMATCHINGINTPROG Use binary integer programming to solve for optimal linear assignment 3 | % function a = optimalMatchingIntProg(dst) 4 | % a(i) = best matching column for row i 5 | % 6 | % See also optimalMatching, which calls Hungarian algorithm 7 | 8 | [p1 p2] = size(dst); 9 | c = dst(:); % vectorize cost matrix 10 | 11 | % Constraints - See Marciel & Costeira paper 12 | % row sum 13 | A2 = kron(eye(p1), ones(1,p2)); 14 | b2 = ones(p1,1); 15 | 16 | % col sum 17 | A3 = kron(ones(1,p1), eye(p2)); 18 | b3 = ones(p2,1); 19 | 20 | if p1 < p2 21 | A = A2; b = b2; 22 | elseif p1 > p2 23 | A = A3; b = b3; 24 | else 25 | % enforce doubly stochastic 26 | A = [A2;A3]; 27 | b = [b2; b3]; 28 | end 29 | 30 | Aineq = zeros(1, p1*p2); 31 | bineq = 0; 32 | ass = bintprog(c, Aineq, bineq, A, b); 33 | ass = reshape(ass, p1, p2); 34 | 35 | a = zeros(1, p1); 36 | for i=1:p1 37 | ndx = find(ass(i,:)==1); 38 | if ~isempty(ndx) 39 | a(i) = ndx; 40 | end 41 | end 42 | 43 | keyboard 44 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/subsets1.m: -------------------------------------------------------------------------------- 1 | function sub_s=subsets1(s,k) 2 | % SUBSETS1 creates sub-sets of a specific from a given set 3 | % SS = subsets1(S, k) 4 | % 5 | % S is the given set 6 | % k is the required sub-sets size 7 | % 8 | % Example: 9 | % 10 | % >> ss=subsets1([1:4],3); 11 | % >> ss{:} 12 | % ans = 13 | % 1 2 3 14 | % ans = 15 | % 1 2 4 16 | % ans = 17 | % 1 3 4 18 | % ans = 19 | % 2 3 4 20 | % 21 | % Written by Raanan Yehezkel, 2004 22 | 23 | if k<0 % special case 24 | error('subset size must be positive'); 25 | elseif k==0 % special case 26 | sub_s={[]}; 27 | else 28 | l=length(s); 29 | ss={}; 30 | if l>=k 31 | if k==1 % Exit condition 32 | for I=1:l 33 | ss{I}=s(I); 34 | end 35 | else 36 | for I=1:l 37 | ss1=subsets1(s([(I+1):l]),k-1); 38 | for J=1:length(ss1) 39 | ss{end+1}=[s(I),ss1{J}]; 40 | end 41 | end 42 | end 43 | end 44 | sub_s=ss; 45 | end 46 | -------------------------------------------------------------------------------- /CoheGroupDetect/KalmanFilter/KPMtools/subsets1.m~: -------------------------------------------------------------------------------- 1 | function sub_s=subsets1(s,k) 2 | % SUBSETS1 creates sub-sets of a specific from a given set 3 | % SS = subsets1(S, k) 4 | % 5 | % S is the given set 6 | % k is the required sub-sets size 7 | % 8 | % Example: 9 | % 10 | % >> ss=subsets1([1:4],3); 11 | % >> ss{:} 12 | % ans = 13 | % 1 2 3 14 | % ans = 15 | % 1 2 4 16 | % ans = 17 | % 1 3 4 18 | % ans = 19 | % 2 3 4 20 | % 21 | % Written by Raanan Yehezkel, 2004 22 | 23 | if k<0 % special case 24 | error('subset size must be positive'); 25 | elseif k==0 % special case 26 | sub_s={[]}; 27 | else 28 | l=length(s); 29 | ss={}; 30 | if l>=k 31 | if k==1 % Exit condition 32 | for I=1:l 33 | ss{I}=s(I); 34 | end 35 | else 36 | for I=1:l 37 | ss1=subsets1(s([(I+1):l]),k-1); 38 | for J=1:length(ss1) 39 | ss{end+1}=[s(I),ss1{J}]; 40 | end 41 | end 42 | end 43 | end 44 | sub_s=ss; 45 | end 46 | -------------------------------------------------------------------------------- /descriptor/gactoolbox/gdlfiles/gdlAffinity.m: -------------------------------------------------------------------------------- 1 | function [L_i, L_j] = gdlAffinity (graphW, cluster_i, cluster_j) 2 | %% Compute conditional complexity from the subpart of the weighted adjacency matrix 3 | % Inputs: 4 | % - graphW: the matrix P 5 | % - cluster_i: index vector of cluster i 6 | % - cluster_j: index vector of cluster j 7 | % Output: 8 | % - L_ij - the sum of conditional complexities of cluster i and j after merging. 9 | % by Wei Zhang (wzhang009 at gmail.com), Nov., 7, 2011 10 | % 11 | % This file is the matlab version of gdlAffinity_c.cpp, to help you understand the code 12 | % 13 | % j1 -> i -> j2, j2 -> i -> j1 14 | 15 | num_i = numel(cluster_i); 16 | num_j = numel(cluster_j); 17 | 18 | % detecting cross elements (this check costs much and is unnecessary) 19 | % if length(unique([cluster_i(:); cluster_j(:)])) ~= (num_i + num_j), error('GAC: two clusters have overlaps!'); end 20 | 21 | L_ij = graphW(cluster_i, cluster_j); 22 | L_ji = graphW(cluster_j, cluster_i); 23 | L_i = sum(L_ij,1)*sum(L_ji,2) / (num_i*num_i); 24 | L_j = sum(L_ji,1)*sum(L_ij,2) / (num_j*num_j); 25 | % L_ij = L_i + L_j; 26 | 27 | end 28 | --------------------------------------------------------------------------------