├── +solver ├── adadelta.m ├── adagrad.m ├── adam.m └── rmsprop.m ├── .gitattributes ├── .gitignore ├── LICENSE ├── README.md ├── adnet_compile.m ├── adnet_demo.m ├── adnet_test.m ├── adnet_train.m ├── data └── Freeman1 │ ├── groundtruth_rect.txt │ └── img │ ├── 0001.jpg │ ├── 0002.jpg │ ├── 0003.jpg │ ├── 0004.jpg │ ├── 0005.jpg │ ├── 0006.jpg │ ├── 0007.jpg │ ├── 0008.jpg │ ├── 0009.jpg │ ├── 0010.jpg │ ├── 0011.jpg │ ├── 0012.jpg │ ├── 0013.jpg │ ├── 0014.jpg │ ├── 0015.jpg │ ├── 0016.jpg │ ├── 0017.jpg │ ├── 0018.jpg │ ├── 0019.jpg │ ├── 0020.jpg │ ├── 0021.jpg │ ├── 0022.jpg │ ├── 0023.jpg │ ├── 0024.jpg │ ├── 0025.jpg │ ├── 0026.jpg │ ├── 0027.jpg │ ├── 0028.jpg │ ├── 0029.jpg │ ├── 0030.jpg │ ├── 0031.jpg │ ├── 0032.jpg │ ├── 0033.jpg │ ├── 0034.jpg │ ├── 0035.jpg │ ├── 0036.jpg │ ├── 0037.jpg │ ├── 0038.jpg │ ├── 0039.jpg │ ├── 0040.jpg │ ├── 0041.jpg │ ├── 0042.jpg │ ├── 0043.jpg │ ├── 0044.jpg │ ├── 0045.jpg │ ├── 0046.jpg │ ├── 0047.jpg │ ├── 0048.jpg │ ├── 0049.jpg │ ├── 0050.jpg │ ├── 0051.jpg │ ├── 0052.jpg │ ├── 0053.jpg │ ├── 0054.jpg │ ├── 0055.jpg │ ├── 0056.jpg │ ├── 0057.jpg │ ├── 0058.jpg │ ├── 0059.jpg │ ├── 0060.jpg │ ├── 0061.jpg │ ├── 0062.jpg │ ├── 0063.jpg │ ├── 0064.jpg │ ├── 0065.jpg │ ├── 0066.jpg │ ├── 0067.jpg │ ├── 0068.jpg │ ├── 0069.jpg │ ├── 0070.jpg │ ├── 0071.jpg │ ├── 0072.jpg │ ├── 0073.jpg │ ├── 0074.jpg │ ├── 0075.jpg │ ├── 0076.jpg │ ├── 0077.jpg │ ├── 0078.jpg │ ├── 0079.jpg │ ├── 0080.jpg │ ├── 0081.jpg │ ├── 0082.jpg │ ├── 0083.jpg │ ├── 0084.jpg │ ├── 0085.jpg │ ├── 0086.jpg │ ├── 0087.jpg │ ├── 0088.jpg │ ├── 0089.jpg │ ├── 0090.jpg │ ├── 0091.jpg │ ├── 0092.jpg │ ├── 0093.jpg │ ├── 0094.jpg │ ├── 0095.jpg │ ├── 0096.jpg │ ├── 0097.jpg │ ├── 0098.jpg │ ├── 0099.jpg │ ├── 0100.jpg │ ├── 0101.jpg │ ├── 0102.jpg │ ├── 0103.jpg │ ├── 0104.jpg │ ├── 0105.jpg │ ├── 0106.jpg │ ├── 0107.jpg │ ├── 0108.jpg │ ├── 0109.jpg │ ├── 0110.jpg │ ├── 0111.jpg │ ├── 0112.jpg │ ├── 0113.jpg │ ├── 0114.jpg │ ├── 0115.jpg │ ├── 0116.jpg │ ├── 0117.jpg │ ├── 0118.jpg │ ├── 0119.jpg │ ├── 0120.jpg │ ├── 0121.jpg │ ├── 0122.jpg │ ├── 0123.jpg │ ├── 0124.jpg │ ├── 0125.jpg │ ├── 0126.jpg │ ├── 0127.jpg │ ├── 0128.jpg │ ├── 0129.jpg │ ├── 0130.jpg │ ├── 0131.jpg │ ├── 0132.jpg │ ├── 0133.jpg │ ├── 0134.jpg │ ├── 0135.jpg │ ├── 0136.jpg │ ├── 0137.jpg │ ├── 0138.jpg │ ├── 0139.jpg │ ├── 0140.jpg │ ├── 0141.jpg │ ├── 0142.jpg │ ├── 0143.jpg │ ├── 0144.jpg │ ├── 0145.jpg │ ├── 0146.jpg │ ├── 0147.jpg │ ├── 0148.jpg │ ├── 0149.jpg │ ├── 0150.jpg │ ├── 0151.jpg │ ├── 0152.jpg │ ├── 0153.jpg │ ├── 0154.jpg │ ├── 0155.jpg │ ├── 0156.jpg │ ├── 0157.jpg │ ├── 0158.jpg │ ├── 0159.jpg │ ├── 0160.jpg │ ├── 0161.jpg │ ├── 0162.jpg │ ├── 0163.jpg │ ├── 0164.jpg │ ├── 0165.jpg │ ├── 0166.jpg │ ├── 0167.jpg │ ├── 0168.jpg │ ├── 0169.jpg │ ├── 0170.jpg │ ├── 0171.jpg │ ├── 0172.jpg │ ├── 0173.jpg │ ├── 0174.jpg │ ├── 0175.jpg │ ├── 0176.jpg │ ├── 0177.jpg │ ├── 0178.jpg │ ├── 0179.jpg │ ├── 0180.jpg │ ├── 0181.jpg │ ├── 0182.jpg │ ├── 0183.jpg │ ├── 0184.jpg │ ├── 0185.jpg │ ├── 0186.jpg │ ├── 0187.jpg │ ├── 0188.jpg │ ├── 0189.jpg │ ├── 0190.jpg │ ├── 0191.jpg │ ├── 0192.jpg │ ├── 0193.jpg │ ├── 0194.jpg │ ├── 0195.jpg │ ├── 0196.jpg │ ├── 0197.jpg │ ├── 0198.jpg │ ├── 0199.jpg │ ├── 0200.jpg │ ├── 0201.jpg │ ├── 0202.jpg │ ├── 0203.jpg │ ├── 0204.jpg │ ├── 0205.jpg │ ├── 0206.jpg │ ├── 0207.jpg │ ├── 0208.jpg │ ├── 0209.jpg │ ├── 0210.jpg │ ├── 0211.jpg │ ├── 0212.jpg │ ├── 0213.jpg │ ├── 0214.jpg │ ├── 0215.jpg │ ├── 0216.jpg │ ├── 0217.jpg │ ├── 0218.jpg │ ├── 0219.jpg │ ├── 0220.jpg │ ├── 0221.jpg │ ├── 0222.jpg │ ├── 0223.jpg │ ├── 0224.jpg │ ├── 0225.jpg │ ├── 0226.jpg │ ├── 0227.jpg │ ├── 0228.jpg │ ├── 0229.jpg │ ├── 0230.jpg │ ├── 0231.jpg │ ├── 0232.jpg │ ├── 0233.jpg │ ├── 0234.jpg │ ├── 0235.jpg │ ├── 0236.jpg │ ├── 0237.jpg │ ├── 0238.jpg │ ├── 0239.jpg │ ├── 0240.jpg │ ├── 0241.jpg │ ├── 0242.jpg │ ├── 0243.jpg │ ├── 0244.jpg │ ├── 0245.jpg │ ├── 0246.jpg │ ├── 0247.jpg │ ├── 0248.jpg │ ├── 0249.jpg │ ├── 0250.jpg │ ├── 0251.jpg │ ├── 0252.jpg │ ├── 0253.jpg │ ├── 0254.jpg │ ├── 0255.jpg │ ├── 0256.jpg │ ├── 0257.jpg │ ├── 0258.jpg │ ├── 0259.jpg │ ├── 0260.jpg │ ├── 0261.jpg │ ├── 0262.jpg │ ├── 0263.jpg │ ├── 0264.jpg │ ├── 0265.jpg │ ├── 0266.jpg │ ├── 0267.jpg │ ├── 0268.jpg │ ├── 0269.jpg │ ├── 0270.jpg │ ├── 0271.jpg │ ├── 0272.jpg │ ├── 0273.jpg │ ├── 0274.jpg │ ├── 0275.jpg │ ├── 0276.jpg │ ├── 0277.jpg │ ├── 0278.jpg │ ├── 0279.jpg │ ├── 0280.jpg │ ├── 0281.jpg │ ├── 0282.jpg │ ├── 0283.jpg │ ├── 0284.jpg │ ├── 0285.jpg │ ├── 0286.jpg │ ├── 0287.jpg │ ├── 0288.jpg │ ├── 0289.jpg │ ├── 0290.jpg │ ├── 0291.jpg │ ├── 0292.jpg │ ├── 0293.jpg │ ├── 0294.jpg │ ├── 0295.jpg │ ├── 0296.jpg │ ├── 0297.jpg │ ├── 0298.jpg │ ├── 0299.jpg │ ├── 0300.jpg │ ├── 0301.jpg │ ├── 0302.jpg │ ├── 0303.jpg │ ├── 0304.jpg │ ├── 0305.jpg │ ├── 0306.jpg │ ├── 0307.jpg │ ├── 0308.jpg │ ├── 0309.jpg │ ├── 0310.jpg │ ├── 0311.jpg │ ├── 0312.jpg │ ├── 0313.jpg │ ├── 0314.jpg │ ├── 0315.jpg │ ├── 0316.jpg │ ├── 0317.jpg │ ├── 0318.jpg │ ├── 0319.jpg │ ├── 0320.jpg │ ├── 0321.jpg │ ├── 0322.jpg │ ├── 0323.jpg │ ├── 0324.jpg │ ├── 0325.jpg │ └── 0326.jpg ├── matconvnet └── matlab │ ├── +dagnn │ ├── @DagNN │ │ ├── DagNN.m │ │ ├── addLayer.m │ │ ├── eval.m │ │ ├── fromSimpleNN.m │ │ ├── getVarReceptiveFields.m │ │ ├── getVarSizes.m │ │ ├── initParams.m │ │ ├── loadobj.m │ │ ├── move.m │ │ ├── print.m │ │ ├── rebuild.m │ │ ├── removeLayer.m │ │ ├── renameLayer.m │ │ ├── renameVar.m │ │ ├── reset.m │ │ ├── saveobj.m │ │ ├── setExecutionOrder.m │ │ ├── setLayerInputs.m │ │ ├── setLayerOutputs.m │ │ └── setLayerParams.m │ ├── AffineGridGenerator.m │ ├── BatchNorm.m │ ├── BilinearSampler.m │ ├── Concat.m │ ├── Conv.m │ ├── ConvTranspose.m │ ├── Crop.m │ ├── DropOut.m │ ├── ElementWise.m │ ├── Filter.m │ ├── LRN.m │ ├── Layer.m │ ├── Loss.m │ ├── NormOffset.m │ ├── Pooling.m │ ├── ReLU.m │ ├── Scale.m │ ├── Sigmoid.m │ ├── SoftMax.m │ ├── SpatialNorm.m │ ├── Sum.m │ └── UniformScalingGridGenerator.m │ ├── ParameterServer.m │ ├── compatibility │ └── parallel │ │ ├── gather.m │ │ ├── labindex.m │ │ └── numlabs.m │ ├── simplenn │ ├── vl_simplenn.m │ ├── vl_simplenn_diagnose.m │ ├── vl_simplenn_display.m │ ├── vl_simplenn_move.m │ ├── vl_simplenn_start_parserv.m │ └── vl_simplenn_tidy.m │ ├── src │ ├── bits │ │ ├── data.cpp │ │ ├── data.cu │ │ ├── data.hpp │ │ ├── datacu.cu │ │ ├── datacu.hpp │ │ ├── datamex.cpp │ │ ├── datamex.cu │ │ ├── datamex.hpp │ │ ├── impl │ │ │ ├── bilinearsampler.hpp │ │ │ ├── bilinearsampler_cpu.cpp │ │ │ ├── bilinearsampler_gpu.cu │ │ │ ├── blashelper.hpp │ │ │ ├── bnorm.hpp │ │ │ ├── bnorm_cpu.cpp │ │ │ ├── bnorm_gpu.cu │ │ │ ├── copy.hpp │ │ │ ├── copy_cpu.cpp │ │ │ ├── copy_gpu.cu │ │ │ ├── cudnnhelper.hpp │ │ │ ├── fast_mutex.h │ │ │ ├── im2row.hpp │ │ │ ├── im2row_cpu.cpp │ │ │ ├── im2row_gpu.cu │ │ │ ├── imread_gdiplus.cpp │ │ │ ├── imread_helpers.hpp │ │ │ ├── imread_libjpeg.cpp │ │ │ ├── imread_quartz.cpp │ │ │ ├── nnbias_blas.hpp │ │ │ ├── nnbias_cudnn.cu │ │ │ ├── nnbias_cudnn.hpp │ │ │ ├── nnbilinearsampler_cudnn.cu │ │ │ ├── nnbilinearsampler_cudnn.hpp │ │ │ ├── nnbnorm_cudnn.cu │ │ │ ├── nnbnorm_cudnn.hpp │ │ │ ├── nnconv_blas.hpp │ │ │ ├── nnconv_cudnn.cu │ │ │ ├── nnconv_cudnn.hpp │ │ │ ├── nnpooling_cudnn.cu │ │ │ ├── nnpooling_cudnn.hpp │ │ │ ├── normalize.hpp │ │ │ ├── normalize_cpu.cpp │ │ │ ├── normalize_gpu.cu │ │ │ ├── pooling.hpp │ │ │ ├── pooling_cpu.cpp │ │ │ ├── pooling_gpu.cu │ │ │ ├── sharedmem.cuh │ │ │ ├── subsample.hpp │ │ │ ├── subsample_cpu.cpp │ │ │ ├── subsample_gpu.cu │ │ │ ├── tinythread.cpp │ │ │ └── tinythread.h │ │ ├── imread.cpp │ │ ├── imread.hpp │ │ ├── mexutils.h │ │ ├── nnbias.cpp │ │ ├── nnbias.cu │ │ ├── nnbias.hpp │ │ ├── nnbilinearsampler.cpp │ │ ├── nnbilinearsampler.cu │ │ ├── nnbilinearsampler.hpp │ │ ├── nnbnorm.cpp │ │ ├── nnbnorm.cu │ │ ├── nnbnorm.hpp │ │ ├── nnconv.cpp │ │ ├── nnconv.cu │ │ ├── nnconv.hpp │ │ ├── nnfullyconnected.cpp │ │ ├── nnfullyconnected.cu │ │ ├── nnfullyconnected.hpp │ │ ├── nnnormalize.cpp │ │ ├── nnnormalize.cu │ │ ├── nnnormalize.hpp │ │ ├── nnpooling.cpp │ │ ├── nnpooling.cu │ │ ├── nnpooling.hpp │ │ ├── nnsubsample.cpp │ │ ├── nnsubsample.cu │ │ └── nnsubsample.hpp │ ├── config │ │ ├── mex_CUDA_glnxa64.sh │ │ ├── mex_CUDA_glnxa64.xml │ │ ├── mex_CUDA_maci64.sh │ │ └── mex_CUDA_maci64.xml │ ├── vl_cudatool.cpp │ ├── vl_cudatool.cu │ ├── vl_imreadjpeg.cpp │ ├── vl_imreadjpeg.cu │ ├── vl_imreadjpeg_old.cpp │ ├── vl_imreadjpeg_old.cu │ ├── vl_nnbilinearsampler.cpp │ ├── vl_nnbilinearsampler.cu │ ├── vl_nnbnorm.cpp │ ├── vl_nnbnorm.cu │ ├── vl_nnconv.cpp │ ├── vl_nnconv.cu │ ├── vl_nnconvt.cpp │ ├── vl_nnconvt.cu │ ├── vl_nnnormalize.cpp │ ├── vl_nnnormalize.cu │ ├── vl_nnpool.cpp │ ├── vl_nnpool.cu │ ├── vl_taccummex.cpp │ ├── vl_taccummex.cu │ ├── vl_tmove.cpp │ └── vl_tmove.cu │ ├── vl_argparse.m │ ├── vl_compilenn.m │ ├── vl_imreadjpeg.m │ ├── vl_nnbilinearsampler.m │ ├── vl_nnbnorm.m │ ├── vl_nnconcat.m │ ├── vl_nnconv.m │ ├── vl_nnconvt.m │ ├── vl_nncrop.m │ ├── vl_nndropout.m │ ├── vl_nnloss.m │ ├── vl_nnnoffset.m │ ├── vl_nnnormalize.m │ ├── vl_nnnormalizelp.m │ ├── vl_nnpdist.m │ ├── vl_nnpool.m │ ├── vl_nnrelu.m │ ├── vl_nnsigmoid.m │ ├── vl_nnsoftmax.m │ ├── vl_nnsoftmaxloss.m │ ├── vl_nnspnorm.m │ ├── vl_rootnn.m │ ├── vl_setupnn.m │ ├── vl_taccum.m │ ├── vl_tmove.m │ └── xtest │ ├── suite │ ├── Scale.m │ ├── nnbilinearsampler.m │ ├── nnbnorm.m │ ├── nnconcat.m │ ├── nnconv.m │ ├── nnconvt.m │ ├── nndagnn.m │ ├── nndropout.m │ ├── nnloss.m │ ├── nnmnist.m │ ├── nnnormalize.m │ ├── nnnormalizelp.m │ ├── nnoffset.m │ ├── nnpdist.m │ ├── nnpool.m │ ├── nnrelu.m │ ├── nnsigmoid.m │ ├── nnsimplenn.m │ ├── nnsoftmax.m │ ├── nnsoftmaxloss.m │ ├── nnspnorm.m │ ├── nntest.m │ └── tmovemex.m │ ├── vl_bench_bnorm.m │ ├── vl_bench_imreadjpeg.m │ ├── vl_nnbnorm_old.m │ ├── vl_test_bnorm.m │ ├── vl_test_economic_relu.m │ ├── vl_test_gpureset.m │ ├── vl_test_imreadjpeg.m │ └── vl_testnn.m ├── models └── net_rl.mat ├── test ├── accumulate_gradients_dagnn.m ├── split_dagNN.m └── train_fc_finetune_hem.m ├── train ├── accumulate_gradients_dagnn.m ├── adnet_train_RL.m ├── adnet_train_SL.m ├── get_train_dbs.m ├── init_model.m ├── init_model_networks.m ├── modify_model.m ├── split_dagNN.m └── tracker_rl.m └── utils ├── cropRectanglesMex.mexa64 ├── cropRectanglesMex.mexw64 ├── cropRectanglesMex ├── LICENSE ├── README.txt ├── build_cropRectanglesMex.m ├── build_cropRectanglesMex_on_windows.m ├── cropRectanglesMex.cu ├── cropRectanglesMex.m ├── cropRectanglesMex.mexa64 └── cropRectanglesMex.obj ├── do_action.m ├── gen_action_labels.m ├── gen_samples.m ├── get_action_history_onehot.m ├── get_benchmark_info.m ├── get_benchmark_path.m ├── get_conv_feature.m ├── get_extract_regions.m ├── get_train_videos.m ├── get_video_infos.m ├── init_params.m ├── init_settings.m ├── overlap_ratio.m ├── precision_plot.m ├── split_dagNN.m └── videolist ├── vot13-otb.txt ├── vot14-otb.txt └── vot15-otb.txt /+solver/adadelta.m: -------------------------------------------------------------------------------- 1 | function [w, state] = adadelta(w, state, grad, opts, ~) 2 | %ADADELTA 3 | % Example AdaDelta solver, for use with CNN_TRAIN and CNN_TRAIN_DAG. 4 | % 5 | % AdaDelta sets its own learning rate, so any learning rate set in the 6 | % options of CNN_TRAIN and CNN_TRAIN_DAG will be ignored. 7 | % 8 | % If called without any input argument, returns the default options 9 | % structure. 10 | % 11 | % Solver options: (opts.train.solverOpts) 12 | % 13 | % `epsilon`:: 1e-6 14 | % Small additive constant to regularize variance estimate. 15 | % 16 | % `rho`:: 0.9 17 | % Moving average window for variance update, between 0 and 1 (larger 18 | % values result in slower/more stable updating). 19 | 20 | % Copyright (C) 2016 Joao F. Henriques. 21 | % All rights reserved. 22 | % 23 | % This file is part of the VLFeat library and is made available under 24 | % the terms of the BSD license (see the COPYING file). 25 | 26 | if nargin == 0 % Return the default solver options 27 | w = struct('epsilon', 1e-6, 'rho', 0.9) ; 28 | return ; 29 | end 30 | 31 | if isequal(state, 0) % First iteration, initialize state struct 32 | state = struct('g_sqr', 0, 'delta_sqr', 0) ; 33 | end 34 | 35 | rho = opts.rho ; 36 | 37 | state.g_sqr = state.g_sqr * rho + grad.^2 * (1 - rho) ; 38 | new_delta = -sqrt((state.delta_sqr + opts.epsilon) ./ ... 39 | (state.g_sqr + opts.epsilon)) .* grad ; 40 | state.delta_sqr = state.delta_sqr * rho + new_delta.^2 * (1 - rho) ; 41 | 42 | w = w + new_delta ; 43 | -------------------------------------------------------------------------------- /+solver/adagrad.m: -------------------------------------------------------------------------------- 1 | function [w, g_sqr] = adagrad(w, g_sqr, grad, opts, lr) 2 | %ADAGRAD 3 | % Example AdaGrad solver, for use with CNN_TRAIN and CNN_TRAIN_DAG. 4 | % 5 | % Set the initial learning rate for AdaGrad in the options for 6 | % CNN_TRAIN and CNN_TRAIN_DAG. Note that a learning rate that works for 7 | % SGD may be inappropriate for AdaGrad; the default is 0.001. 8 | % 9 | % If called without any input argument, returns the default options 10 | % structure. 11 | % 12 | % Solver options: (opts.train.solverOpts) 13 | % 14 | % `epsilon`:: 1e-10 15 | % Small additive constant to regularize variance estimate. 16 | % 17 | % `rho`:: 1 18 | % Moving average window for variance update, between 0 and 1 (larger 19 | % values result in slower/more stable updating). This is similar to 20 | % RHO in AdaDelta and RMSProp. Standard AdaGrad is obtained with a RHO 21 | % value of 1 (use total average instead of a moving average). 22 | % 23 | % A possibly undesirable effect of standard AdaGrad is that the update 24 | % will monotonically decrease to 0, until training eventually stops. This 25 | % is because the AdaGrad update is inversely proportional to the total 26 | % variance of the gradients seen so far. 27 | % With RHO smaller than 1, a moving average is used instead. This 28 | % prevents the final update from monotonically decreasing to 0. 29 | 30 | % Copyright (C) 2016 Joao F. Henriques. 31 | % All rights reserved. 32 | % 33 | % This file is part of the VLFeat library and is made available under 34 | % the terms of the BSD license (see the COPYING file). 35 | 36 | if nargin == 0 % Return the default solver options 37 | w = struct('epsilon', 1e-10, 'rho', 1) ; 38 | return ; 39 | end 40 | 41 | g_sqr = g_sqr * opts.rho + grad.^2 ; 42 | 43 | w = w - lr * grad ./ (sqrt(g_sqr) + opts.epsilon) ; 44 | -------------------------------------------------------------------------------- /+solver/rmsprop.m: -------------------------------------------------------------------------------- 1 | function [w, g_sqr] = rmsprop(w, g_sqr, grad, opts, lr) 2 | %RMSPROP 3 | % Example RMSProp solver, for use with CNN_TRAIN and CNN_TRAIN_DAG. 4 | % 5 | % Set the initial learning rate for RMSProp in the options for 6 | % CNN_TRAIN and CNN_TRAIN_DAG. Note that a learning rate that works for 7 | % SGD may be inappropriate for RMSProp; the default is 0.001. 8 | % 9 | % If called without any input argument, returns the default options 10 | % structure. 11 | % 12 | % Solver options: (opts.train.solverOpts) 13 | % 14 | % `epsilon`:: 1e-8 15 | % Small additive constant to regularize variance estimate. 16 | % 17 | % `rho`:: 0.99 18 | % Moving average window for variance update, between 0 and 1 (larger 19 | % values result in slower/more stable updating). 20 | 21 | % Copyright (C) 2016 Joao F. Henriques. 22 | % All rights reserved. 23 | % 24 | % This file is part of the VLFeat library and is made available under 25 | % the terms of the BSD license (see the COPYING file). 26 | 27 | if nargin == 0 % Return the default solver options 28 | w = struct('epsilon', 1e-8, 'rho', 0.99) ; 29 | return ; 30 | end 31 | 32 | g_sqr = g_sqr * opts.rho + grad.^2 * (1 - opts.rho) ; 33 | 34 | w = w - lr * grad ./ (sqrt(g_sqr) + opts.epsilon) ; 35 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | *.obj 3 | *.mexw64 4 | *.exp 5 | *.obj 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ADNet-cvpr2017 2 | 3 | - ADNet: Action-Decision Networks for Visual Tracking with Deep Reinforcement Learning [[Paper]](https://drive.google.com/open?id=0B34VXh5mZ22cZUs2Umc1cjlBMFU) 4 | - [[Project Page]](https://sites.google.com/view/cvpr2017-adnet) 5 | - Contact: yunsd101@snu.ac.kr [[Homepage]](https://sites.google.com/view/sdyunhome/) 6 | 7 | ### Other implementations 8 | Tensorflow: (tf-adnet) https://github.com/ildoonet/tf-adnet-tracking 9 | 10 | ### News 11 | - Major bug fixes (31 Mar. 2018). 12 | - Training codes are uploaded (4 Sep, 2017). 13 | - Test codes are uploaded (15 July, 2017). 14 | 15 | ### Citation 16 | ``` 17 | @InProceedings{yun2017adnet, 18 | title={Action-Decision Networks for Visual Tracking with Deep Reinforcement Learning}, 19 | author={Yun, Sangdoo and Choi, Jongwon and Yoo, Youngjoon and Yun, Kimin and Young Choi, Jin}, 20 | booktitle={The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)}, 21 | year={2017} 22 | } 23 | ``` 24 | 25 | ### Installation 26 | - This code is tested on Linux os (ubuntu 14.04) 64bit, MATLAB 2017a, and Cuda-8.0 with NVIDIA GTX 1080 TI. 27 | - Run `adnet_compile.m` to compile MatConvNet. 28 | 29 | ### Run tracking 30 | - Run `adnet_demo.m`. 31 | 32 | 33 | 34 | -------------------------------------------------------------------------------- /adnet_compile.m: -------------------------------------------------------------------------------- 1 | function adnet_compile 2 | % ADNET_COMPILE 3 | % 4 | % Sangdoo Yun, 2017. 5 | if ispc 6 | cudaRoot = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0'; 7 | else 8 | cudaRoot = '/usr/local/cuda-8.0'; 9 | end 10 | 11 | fprintf('compile matconvnet\n'); 12 | run matconvnet/matlab/vl_setupnn.m 13 | cd matconvnet/ 14 | vl_compilenn('enableGpu', true, ... 15 | 'cudaRoot', cudaRoot, ... 16 | 'cudaMethod', 'nvcc'); 17 | % vl_compilenn('enableGpu', true); 18 | cd .. 19 | 20 | cd utils/ 21 | addpath cropRectanglesMex 22 | if ispc 23 | run build_cropRectanglesMex_on_windows.m 24 | else 25 | run build_cropRectanglesMex.m 26 | end 27 | cd .. 28 | 29 | -------------------------------------------------------------------------------- /adnet_demo.m: -------------------------------------------------------------------------------- 1 | function [t,p, results] = adnet_demo (vid_path) 2 | % ADNET_DEMO Demonstrate `action-decision network' 3 | % 4 | % Sangdoo Yun, 2017. 5 | 6 | if nargin < 1 7 | vid_path = 'data/Freeman1'; 8 | end 9 | 10 | addpath('test/'); 11 | addpath(genpath('utils/')); 12 | 13 | init_settings; 14 | 15 | run(matconvnet_path); 16 | 17 | load('models/net_rl.mat'); 18 | 19 | opts.visualize = true; 20 | opts.printscreen = true; 21 | 22 | rng(1004); 23 | [results, t, p] = adnet_test(net, vid_path, opts); 24 | fprintf('precision: %f, fps: %f\n', p(20), size(results, 1)/t); 25 | 26 | -------------------------------------------------------------------------------- /adnet_train.m: -------------------------------------------------------------------------------- 1 | function adnet_train() 2 | % ADNET_TRAIN Train the ADNet 3 | % 4 | % Sangdoo Yun, 2017. 5 | 6 | addpath('train/'); 7 | addpath(genpath('utils/')); 8 | init_settings; 9 | run(matconvnet_path); 10 | 11 | rng(1004); 12 | 13 | % Training stage 1: SL 14 | opts.vgg_m_path = vgg_m_path; 15 | [net, train_videos] = adnet_train_SL(opts); 16 | save('./models/net_sl.mat', 'net') 17 | 18 | % Training stage 2: RL 19 | net = adnet_train_RL(net, train_videos, opts); 20 | save('./models/net.mat', 'net') 21 | 22 | 23 | -------------------------------------------------------------------------------- /data/Freeman1/img/0001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0001.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0002.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0003.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0003.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0004.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0004.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0005.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0005.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0006.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0006.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0007.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0007.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0008.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0008.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0009.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0009.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0010.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0010.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0011.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0011.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0012.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0012.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0013.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0013.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0014.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0014.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0015.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0015.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0016.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0016.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0017.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0017.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0018.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0018.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0019.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0019.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0020.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0020.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0021.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0021.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0022.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0022.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0023.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0023.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0024.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0024.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0025.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0025.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0026.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0026.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0027.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0027.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0028.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0028.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0029.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0029.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0030.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0030.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0031.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0031.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0032.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0032.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0033.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0033.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0034.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0034.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0035.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0035.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0036.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0036.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0037.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0037.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0038.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0038.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0039.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0039.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0040.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0040.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0041.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0041.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0042.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0042.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0043.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0043.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0044.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0044.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0045.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0045.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0046.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0046.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0047.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0047.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0048.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0048.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0049.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0049.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0050.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0050.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0051.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0051.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0052.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0052.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0053.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0053.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0054.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0054.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0055.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0055.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0056.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0056.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0057.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0057.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0058.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0058.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0059.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0059.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0060.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0060.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0061.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0061.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0062.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0062.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0063.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0063.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0064.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0064.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0065.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0065.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0066.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0066.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0067.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0067.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0068.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0068.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0069.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0069.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0070.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0070.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0071.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0071.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0072.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0072.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0073.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0073.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0074.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0074.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0075.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0075.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0076.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0076.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0077.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0077.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0078.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0078.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0079.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0079.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0080.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0080.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0081.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0081.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0082.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0082.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0083.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0083.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0084.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0084.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0085.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0085.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0086.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0086.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0087.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0087.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0088.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0088.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0089.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0089.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0090.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0090.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0091.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0091.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0092.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0092.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0093.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0093.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0094.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0094.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0095.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0095.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0096.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0096.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0097.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0097.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0098.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0098.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0099.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0099.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0100.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0100.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0101.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0101.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0102.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0102.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0103.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0103.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0104.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0104.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0105.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0105.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0106.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0106.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0107.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0107.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0108.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0108.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0109.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0109.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0110.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0110.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0111.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0111.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0112.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0112.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0113.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0113.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0114.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0114.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0115.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0115.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0116.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0116.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0117.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0117.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0118.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0118.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0119.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0119.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0120.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0120.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0121.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0121.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0122.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0122.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0123.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0123.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0124.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0124.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0125.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0125.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0126.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0126.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0127.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0127.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0128.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0128.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0129.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0129.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0130.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0130.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0131.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0131.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0132.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0132.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0133.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0133.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0134.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0134.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0135.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0135.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0136.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0136.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0137.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0137.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0138.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0138.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0139.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0139.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0140.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0140.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0141.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0141.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0142.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0142.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0143.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0143.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0144.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0144.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0145.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0145.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0146.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0146.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0147.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0147.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0148.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0148.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0149.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0149.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0150.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0150.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0151.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0151.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0152.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0152.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0153.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0153.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0154.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0154.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0155.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0155.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0156.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0156.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0157.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0157.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0158.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0158.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0159.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0159.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0160.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0160.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0161.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0161.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0162.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0162.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0163.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0163.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0164.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0164.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0165.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0165.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0166.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0166.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0167.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0167.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0168.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0168.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0169.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0169.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0170.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0170.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0171.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0171.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0172.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0172.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0173.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0173.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0174.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0174.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0175.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0175.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0176.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0176.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0177.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0177.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0178.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0178.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0179.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0179.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0180.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0180.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0181.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0181.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0182.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0182.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0183.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0183.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0184.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0184.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0185.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0185.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0186.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0186.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0187.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0187.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0188.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0188.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0189.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0189.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0190.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0190.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0191.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0191.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0192.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0192.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0193.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0193.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0194.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0194.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0195.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0195.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0196.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0196.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0197.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0197.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0198.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0198.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0199.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0199.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0200.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0200.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0201.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0201.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0202.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0202.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0203.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0203.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0204.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0204.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0205.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0205.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0206.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0206.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0207.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0207.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0208.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0208.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0209.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0209.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0210.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0210.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0211.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0211.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0212.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0212.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0213.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0213.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0214.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0214.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0215.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0215.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0216.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0216.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0217.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0217.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0218.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0218.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0219.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0219.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0220.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0220.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0221.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0221.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0222.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0222.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0223.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0223.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0224.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0224.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0225.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0225.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0226.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0226.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0227.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0227.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0228.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0228.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0229.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0229.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0230.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0230.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0231.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0231.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0232.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0232.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0233.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0233.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0234.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0234.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0235.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0235.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0236.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0236.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0237.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0237.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0238.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0238.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0239.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0239.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0240.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0240.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0241.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0241.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0242.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0242.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0243.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0243.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0244.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0244.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0245.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0245.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0246.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0246.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0247.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0247.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0248.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0248.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0249.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0249.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0250.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0250.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0251.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0251.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0252.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0252.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0253.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0253.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0254.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0254.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0255.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0255.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0256.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0256.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0257.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0257.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0258.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0258.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0259.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0259.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0260.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0260.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0261.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0261.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0262.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0262.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0263.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0263.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0264.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0264.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0265.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0265.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0266.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0266.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0267.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0267.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0268.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0268.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0269.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0269.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0270.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0270.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0271.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0271.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0272.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0272.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0273.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0273.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0274.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0274.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0275.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0275.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0276.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0276.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0277.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0277.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0278.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0278.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0279.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0279.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0280.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0280.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0281.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0281.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0282.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0282.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0283.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0283.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0284.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0284.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0285.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0285.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0286.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0286.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0287.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0287.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0288.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0288.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0289.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0289.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0290.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0290.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0291.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0291.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0292.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0292.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0293.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0293.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0294.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0294.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0295.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0295.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0296.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0296.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0297.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0297.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0298.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0298.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0299.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0299.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0300.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0300.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0301.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0301.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0302.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0302.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0303.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0303.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0304.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0304.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0305.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0305.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0306.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0306.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0307.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0307.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0308.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0308.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0309.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0309.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0310.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0310.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0311.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0311.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0312.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0312.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0313.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0313.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0314.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0314.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0315.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0315.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0316.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0316.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0317.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0317.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0318.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0318.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0319.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0319.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0320.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0320.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0321.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0321.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0322.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0322.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0323.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0323.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0324.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0324.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0325.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0325.jpg -------------------------------------------------------------------------------- /data/Freeman1/img/0326.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/data/Freeman1/img/0326.jpg -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/@DagNN/addLayer.m: -------------------------------------------------------------------------------- 1 | function addLayer(obj, name, block, inputs, outputs, params, varargin) 2 | %ADDLAYER Adds a layer to a DagNN 3 | % ADDLAYER(NAME, LAYER, INPUTS, OUTPUTS, PARAMS) adds the 4 | % specified layer to the network. NAME is a string with the layer 5 | % name, used as a unique indentifier. BLOCK is the object 6 | % implementing the layer, which should be a subclass of the 7 | % Layer. INPUTS, OUTPUTS are cell arrays of variable names, and 8 | % PARAMS of parameter names. 9 | % 10 | % See Also REMOVELAYER(). 11 | opts.skipRebuild = false; 12 | opts = vl_argparse(opts, varargin); 13 | 14 | index = find(strcmp(name, {obj.layers.name})) ; 15 | if ~isempty(index), error('There is already a layer with name ''%s''.', name), end 16 | index = numel(obj.layers) + 1 ; 17 | 18 | if nargin < 6, params = {} ; end 19 | if ischar(inputs), inputs = {inputs} ; end 20 | if ischar(outputs), outputs = {outputs} ; end 21 | if ischar(params), params = {params} ; end 22 | 23 | obj.layers(index) = struct(... 24 | 'name', {name}, ... 25 | 'inputs', {inputs}, ... 26 | 'outputs', {outputs}, ... 27 | 'params', {params}, ... 28 | 'inputIndexes', {[]}, ... 29 | 'outputIndexes', {[]}, ... 30 | 'paramIndexes', {[]}, ... 31 | 'forwardTime', {[]}, ... 32 | 'backwardTime', {[]}, ... 33 | 'block', {block}) ; 34 | obj.layers(index).block.attach(obj, index) ; 35 | if ~opts.skipRebuild, obj.rebuild() ; end ; 36 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/@DagNN/getVarSizes.m: -------------------------------------------------------------------------------- 1 | function sizes = getVarSizes(obj, inputSizes) 2 | %GETVARSIZES Get the size of the variables 3 | % SIZES = GETVARSIZES(OBJ, INPUTSIZES) computes the SIZES of the 4 | % DagNN variables given the size of the inputs. `inputSizes` is 5 | % a cell array of the type `{'inputName', inputSize, ...}` 6 | % Returns a cell array with sizes of all network variables. 7 | % 8 | % Example, compute the storage needed for a batch size of 256 for an 9 | % imagenet-like network: 10 | % ``` 11 | % batch_size = 256; single_num_bytes = 4; 12 | % input_size = [net.meta.normalization.imageSize, batch_size]; 13 | % var_sizes = net.getVarSizes({'data', input_size}); 14 | % fprintf('Network activations will take %.2fMiB in single.\n', ... 15 | % sum(prod(cell2mat(var_sizes, 1))) * single_num_bytes ./ 1024^3); 16 | % ``` 17 | 18 | % Copyright (C) 2015 Andrea Vedaldi, Karel Lenc. 19 | % All rights reserved. 20 | % 21 | % This file is part of the VLFeat library and is made available under 22 | % the terms of the BSD license (see the COPYING file). 23 | 24 | nv = numel(obj.vars) ; 25 | sizes = num2cell(NaN(nv, 4),2)' ; 26 | 27 | for i = 1:2:numel(inputSizes) 28 | v = obj.getVarIndex(inputSizes{i}) ; 29 | if isnan(v) 30 | error('Variable `%s` not found in the network.', inputSizes{i}); 31 | end; 32 | sizes{v} = [inputSizes{i+1}(:)' ones(1, 4 - numel(inputSizes{i+1}))] ; 33 | end 34 | 35 | for layer = obj.layers(obj.executionOrder) 36 | in = layer.inputIndexes ; 37 | out = layer.outputIndexes ; 38 | sizes(out) = layer.block.getOutputSizes(sizes(in)) ; 39 | end 40 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/@DagNN/initParams.m: -------------------------------------------------------------------------------- 1 | function initParams(obj) 2 | % INITPARAM Initialize the paramers of the DagNN 3 | % OBJ.INITPARAM() uses the INIT() method of each layer to initialize 4 | % the corresponding parameters (usually randomly). 5 | 6 | % Copyright (C) 2015 Karel Lenc and Andrea Vedaldi. 7 | % All rights reserved. 8 | % 9 | % This file is part of the VLFeat library and is made available under 10 | % the terms of the BSD license (see the COPYING file). 11 | 12 | for l = 1:numel(obj.layers) 13 | p = obj.getParamIndex(obj.layers(l).params) ; 14 | params = obj.layers(l).block.initParams() ; 15 | switch obj.device 16 | case 'cpu' 17 | params = cellfun(@gather, params, 'UniformOutput', false) ; 18 | case 'gpu' 19 | params = cellfun(@gpuArray, params, 'UniformOutput', false) ; 20 | end 21 | [obj.params(p).value] = deal(params{:}) ; 22 | end 23 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/@DagNN/move.m: -------------------------------------------------------------------------------- 1 | function move(obj, device) 2 | %MOVE Move the DagNN to either CPU or GPU 3 | % MOVE(obj, 'cpu') moves the DagNN obj to the CPU. 4 | % 5 | % MOVE(obj, 'gpu') moves the DagNN obj to the GPU. 6 | 7 | % Copyright (C) 2015 Karel Lenc and Andrea Vedaldi. 8 | % All rights reserved. 9 | % 10 | % This file is part of the VLFeat library and is made available under 11 | % the terms of the BSD license (see the COPYING file). 12 | 13 | obj.reset() ; 14 | obj.device = device ; 15 | switch device 16 | case 'gpu' 17 | for i=1:numel(obj.params) 18 | obj.params(i).value = gpuArray(obj.params(i).value) ; 19 | end 20 | case 'cpu' 21 | for i=1:numel(obj.params) 22 | obj.params(i).value = gather(obj.params(i).value) ; 23 | end 24 | otherwise 25 | error('DEVICE must be either ''cpu'' or ''gpu''.') ; 26 | end 27 | for l = 1:numel(obj.layers) 28 | obj.layers(l).block.move(device) ; 29 | end 30 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/@DagNN/removeLayer.m: -------------------------------------------------------------------------------- 1 | function removeLayer(obj, layerName) 2 | %REMOVELAYER Remove a layer from the network 3 | % REMOVELAYER(OBJ, NAME) removes the layer NAME from the DagNN object 4 | % OBJ. NAME can be a string or a cell array of strings. 5 | 6 | % Copyright (C) 2015 Karel Lenc and Andrea Vedaldi. 7 | % All rights reserved. 8 | % 9 | % This file is part of the VLFeat library and is made available under 10 | % the terms of the BSD license (see the COPYING file). 11 | 12 | if ischar(layerName), layerName = {layerName}; end; 13 | idxs = obj.getLayerIndex(layerName); 14 | if any(isnan(idxs)) 15 | error('Invalid layer name `%s`', ... 16 | strjoin(layerName(isnan(idxs)), ', ')); 17 | end 18 | obj.layers(idxs) = [] ; 19 | obj.rebuild() ; 20 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/@DagNN/renameLayer.m: -------------------------------------------------------------------------------- 1 | function renameLayer(obj, oldName, newName, varargin) 2 | %RENAMELAYER Rename a layer 3 | % RENAMELAYER(OLDNAME, NEWNAME) changes the name of the layer 4 | % OLDNAME into NEWNAME. NEWNAME should not be the name of an 5 | % existing layer. 6 | 7 | opts.quiet = false ; 8 | opts = vl_argparse(opts, varargin) ; 9 | 10 | % Find the layer to rename 11 | v = obj.getLayerIndex(oldName) ; 12 | if isnan(v) 13 | % There is no such layer, nothing to do 14 | if ~opts.quiet 15 | warning('There is no layer ''%s''.', oldName) ; 16 | end 17 | return ; 18 | end 19 | 20 | % Check if newName is an existing layer 21 | newNameExists = any(strcmp(newName, {obj.layers.name})) ; 22 | if newNameExists 23 | error('There is already a layer ''%s''.', newName) ; 24 | end 25 | 26 | % Replace oldName with newName in all the layers 27 | obj.layers(v).name = newName ; 28 | obj.rebuild() ; 29 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/@DagNN/renameVar.m: -------------------------------------------------------------------------------- 1 | function renameVar(obj, oldName, newName, varargin) 2 | %RENAMEVAR Rename a variable 3 | % RENAMEVAR(OLDNAME, NEWNAME) changes the name of the variable 4 | % OLDNAME into NEWNAME. NEWNAME should not be the name of an 5 | % existing variable. 6 | 7 | opts.quiet = false ; 8 | opts = vl_argparse(opts, varargin) ; 9 | 10 | % Find the variable to rename 11 | v = obj.getVarIndex(oldName) ; 12 | if isnan(v) 13 | % There is no such a variable, nothing to do 14 | if ~opts.quiet 15 | warning('There is no variable ''%s''.', oldName) ; 16 | end 17 | return ; 18 | end 19 | 20 | % Check if newName is an existing variable 21 | newNameExists = any(strcmp(newName, {obj.vars.name})) ; 22 | 23 | % Replace oldName with newName in all the layers 24 | for l = 1:numel(obj.layers) 25 | for f = {'inputs', 'outputs'} 26 | f = char(f) ; 27 | sel = find(strcmp(oldName, obj.layers(l).(f))) ; 28 | [obj.layers(l).(f){sel}] = deal(newName) ; 29 | end 30 | end 31 | 32 | % If newVariable is a variable in the graph, then there is not 33 | % anything else to do. obj.rebuild() will remove the slot 34 | % in obj.vars() for oldName as that variable becomes unused. 35 | % 36 | % If, however, newVariable is not in the graph already, then 37 | % the slot in obj.vars() is preserved and only the variable name 38 | % is changed. 39 | 40 | if ~newNameExists 41 | obj.vars(v).name = newName ; 42 | % update variable name hash otherwise rebuild() won't find this var 43 | % corectly 44 | obj.varNames.(newName) = v ; 45 | end 46 | 47 | obj.rebuild() ; 48 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/@DagNN/reset.m: -------------------------------------------------------------------------------- 1 | function reset(obj) 2 | %RESET Reset the DagNN 3 | % RESET(obj) resets the DagNN obj. The function clears any intermediate value stored in the DagNN 4 | % object, including parameter gradients. It also calls the reset 5 | % function of every layer. 6 | 7 | obj.clearParameterServer() ; 8 | [obj.vars.value] = deal([]) ; 9 | [obj.vars.der] = deal([]) ; 10 | [obj.params.der] = deal([]) ; 11 | for l = 1:numel(obj.layers) 12 | obj.layers(l).block.reset() ; 13 | end 14 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/@DagNN/saveobj.m: -------------------------------------------------------------------------------- 1 | function s = saveobj(obj) 2 | %SAVEOBJ Save a DagNN to a vanilla MATLAB structure 3 | % S = OBJ.SAVEOBJ() saves the DagNN OBJ to a vanilla MATLAB 4 | % structure S. This is particularly convenient to preserve future 5 | % compatibility and to ship networks that are pure structures, 6 | % instead of embedding dependencies to code. 7 | % 8 | % The object can be reconstructe by `obj = DagNN.loadobj(s)`. 9 | % 10 | % As a side-effect the network is being reset (all variables are cleared) 11 | % and is transfered to CPU. 12 | % 13 | % See Also: dagnn.DagNN.loadobj, dagnn.DagNN.reset 14 | 15 | % Copyright (C) 2015-2016 Karel Lenc and Andrea Vedaldi. 16 | % All rights reserved. 17 | % 18 | % This file is part of the VLFeat library and is made available under 19 | % the terms of the BSD license (see the COPYING file). 20 | 21 | device = obj.device ; 22 | obj.move('cpu') ; 23 | s.vars = struct(... 24 | 'name', {obj.vars.name}, ... 25 | 'precious', {obj.vars.precious}) ; 26 | s.params = struct(... 27 | 'name', {obj.params.name}, ... 28 | 'value', {obj.params.value}, ... 29 | 'learningRate', {obj.params.learningRate}, ... 30 | 'weightDecay', {obj.params.weightDecay}) ; 31 | s.layers = struct(... 32 | 'name', {obj.layers.name}, ... 33 | 'type', {[]}, ... 34 | 'inputs', {obj.layers.inputs}, ... 35 | 'outputs', {obj.layers.outputs}, ... 36 | 'params', {obj.layers.params}, ... 37 | 'block', {[]}) ; 38 | s.meta = obj.meta ; 39 | 40 | for l = 1:numel(obj.layers) 41 | block = obj.layers(l).block ; 42 | slayer = block.save() ; 43 | s.layers(l).type = class(block) ; 44 | s.layers(l).block = slayer ; 45 | end 46 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/@DagNN/setExecutionOrder.m: -------------------------------------------------------------------------------- 1 | function ord = setExecutionOrder(obj, order) 2 | % purpose: to modify execution order 3 | % 4 | 5 | obj.executionOrder = order; 6 | ord = obj.getLayerExecutionOrder; -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/@DagNN/setLayerInputs.m: -------------------------------------------------------------------------------- 1 | function v = setLayerInputs(obj, layer, inputs) 2 | %SETLAYERINPUTS Set or change the inputs to a layer 3 | % Example: NET.SETLAYERINPUTS('layerName', {'input1', 'input2', ...}) 4 | 5 | v = [] ; 6 | l = obj.getLayerIndex(layer) ; 7 | for input = inputs 8 | v(end+1) = obj.addVar(char(input)) ; 9 | end 10 | obj.layers(l).inputs = inputs ; 11 | obj.rebuild() ; 12 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/@DagNN/setLayerOutputs.m: -------------------------------------------------------------------------------- 1 | function v = setLayerOutputs(obj, layer, outputs) 2 | %SETLAYEROUTPUTS Set or change the outputs of a layer 3 | % Example: NET.SETLAYEROUTPUTS('layerName', {'output1', 'output2', ...}) 4 | 5 | v = [] ; 6 | l = obj.getLayerIndex(layer) ; 7 | for output = outputs 8 | v(end+1) = obj.addVar(char(output)) ; 9 | end 10 | obj.layers(l).outputs = outputs ; 11 | obj.rebuild() ; 12 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/@DagNN/setLayerParams.m: -------------------------------------------------------------------------------- 1 | function v = setLayerParams(obj, layer, params) 2 | %SETLAYEPARAMS Set or change the parameters of a layer 3 | % Example: NET.SETLAYERPARAMS('layerName', {'param1', 'param2', ...}) 4 | 5 | v = [] ; 6 | l = obj.getLayerIndex(layer) ; 7 | for param = params 8 | v(end+1) = obj.addParam(char(param)) ; 9 | end 10 | obj.layers(l).params = params ; 11 | obj.rebuild() ; 12 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/BilinearSampler.m: -------------------------------------------------------------------------------- 1 | % Wrapper for BilinearSampler block: 2 | % (c) 2016 Ankush Gupta 3 | 4 | classdef BilinearSampler < dagnn.Layer 5 | methods 6 | function outputs = forward(obj, inputs, params) 7 | outputs = vl_nnbilinearsampler(inputs{1}, inputs{2}); 8 | outputs = {outputs}; 9 | end 10 | 11 | function [derInputs, derParams] = backward(obj, inputs, param, derOutputs) 12 | [dX,dG] = vl_nnbilinearsampler(inputs{1}, inputs{2}, derOutputs{1}); 13 | derInputs = {dX,dG}; 14 | derParams = {}; 15 | end 16 | 17 | function outputSizes = getOutputSizes(obj, inputSizes) 18 | xSize = inputSizes{1}; 19 | gSize = inputSizes{2}; 20 | outputSizes = {[gSize(2), gSize(3), xSize(3), xSize(4)]}; 21 | end 22 | 23 | function obj = BilinearSampler(varargin) 24 | obj.load(varargin); 25 | end 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/Concat.m: -------------------------------------------------------------------------------- 1 | classdef Concat < dagnn.ElementWise 2 | properties 3 | dim = 3 4 | end 5 | 6 | properties (Transient) 7 | inputSizes = {} 8 | end 9 | 10 | methods 11 | function outputs = forward(obj, inputs, params) 12 | outputs{1} = vl_nnconcat(inputs, obj.dim) ; 13 | obj.inputSizes = cellfun(@size, inputs, 'UniformOutput', false) ; 14 | end 15 | 16 | function [derInputs, derParams] = backward(obj, inputs, params, derOutputs) 17 | derInputs = vl_nnconcat(inputs, obj.dim, derOutputs{1}, 'inputSizes', obj.inputSizes) ; 18 | derParams = {} ; 19 | end 20 | 21 | function reset(obj) 22 | obj.inputSizes = {} ; 23 | end 24 | 25 | function outputSizes = getOutputSizes(obj, inputSizes) 26 | sz = inputSizes{1} ; 27 | for k = 2:numel(inputSizes) 28 | sz(obj.dim) = sz(obj.dim) + inputSizes{k}(obj.dim) ; 29 | end 30 | outputSizes{1} = sz ; 31 | end 32 | 33 | function rfs = getReceptiveFields(obj) 34 | numInputs = numel(obj.net.layers(obj.layerIndex).inputs) ; 35 | if obj.dim == 3 || obj.dim == 4 36 | rfs = getReceptiveFields@dagnn.ElementWise(obj) ; 37 | rfs = repmat(rfs, numInputs, 1) ; 38 | else 39 | for i = 1:numInputs 40 | rfs(i,1).size = [NaN NaN] ; 41 | rfs(i,1).stride = [NaN NaN] ; 42 | rfs(i,1).offset = [NaN NaN] ; 43 | end 44 | end 45 | end 46 | 47 | function load(obj, varargin) 48 | s = dagnn.Layer.argsToStruct(varargin{:}) ; 49 | % backward file compatibility 50 | if isfield(s, 'numInputs'), s = rmfield(s, 'numInputs') ; end 51 | load@dagnn.Layer(obj, s) ; 52 | end 53 | 54 | function obj = Concat(varargin) 55 | obj.load(varargin{:}) ; 56 | end 57 | end 58 | end 59 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/DropOut.m: -------------------------------------------------------------------------------- 1 | classdef DropOut < dagnn.ElementWise 2 | properties 3 | rate = 0.5 4 | frozen = false 5 | end 6 | 7 | properties (Transient) 8 | mask 9 | end 10 | 11 | methods 12 | function outputs = forward(obj, inputs, params) 13 | if strcmp(obj.net.mode, 'test') 14 | outputs = inputs ; 15 | return ; 16 | end 17 | if obj.frozen & ~isempty(obj.mask) 18 | outputs{1} = vl_nndropout(inputs{1}, 'mask', obj.mask) ; 19 | else 20 | [outputs{1}, obj.mask] = vl_nndropout(inputs{1}, 'rate', obj.rate) ; 21 | end 22 | end 23 | 24 | function [derInputs, derParams] = backward(obj, inputs, params, derOutputs) 25 | if strcmp(obj.net.mode, 'test') 26 | derInputs = derOutputs ; 27 | derParams = {} ; 28 | return ; 29 | end 30 | derInputs{1} = vl_nndropout(inputs{1}, derOutputs{1}, 'mask', obj.mask) ; 31 | derParams = {} ; 32 | end 33 | 34 | % --------------------------------------------------------------------- 35 | function obj = DropOut(varargin) 36 | obj.load(varargin{:}) ; 37 | end 38 | 39 | function obj = reset(obj) 40 | reset@dagnn.ElementWise(obj) ; 41 | obj.mask = [] ; 42 | obj.frozen = false ; 43 | end 44 | end 45 | end 46 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/ElementWise.m: -------------------------------------------------------------------------------- 1 | classdef ElementWise < dagnn.Layer 2 | %ELEMENTWISE DagNN layers that operate at individual spatial locations 3 | methods 4 | function [outputSizes, transforms] = forwardGeometry(self, inputSizes, paramSizes) 5 | outputSizes = inputSizes ; 6 | transforms = {eye(6)} ; 7 | end 8 | 9 | function rfs = getReceptiveFields(obj) 10 | rfs.size = [1 1] ; 11 | rfs.stride = [1 1] ; 12 | rfs.offset = [1 1] ; 13 | end 14 | 15 | function outputSizes = getOutputSizes(obj, inputSizes) 16 | outputSizes = inputSizes ; 17 | end 18 | end 19 | end 20 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/Filter.m: -------------------------------------------------------------------------------- 1 | classdef Filter < dagnn.Layer 2 | properties 3 | pad = [0 0 0 0] 4 | stride = [1 1] 5 | dilate = [1 1] 6 | end 7 | methods 8 | function set.pad(obj, pad) 9 | if numel(pad) == 1 10 | obj.pad = [pad pad pad pad] ; 11 | elseif numel(pad) == 2 12 | obj.pad = pad([1 1 2 2]) ; 13 | else 14 | obj.pad = pad ; 15 | end 16 | end 17 | 18 | function set.stride(obj, stride) 19 | if numel(stride) == 1 20 | obj.stride = [stride stride] ; 21 | else 22 | obj.stride = stride ; 23 | end 24 | end 25 | 26 | function set.dilate(obj, dilate) 27 | if numel(dilate) == 1 28 | obj.dilate = [dilate dilate] ; 29 | else 30 | obj.dilate = dilate ; 31 | end 32 | end 33 | 34 | function kernelSize = getKernelSize(obj) 35 | kernelSize = [1 1] ; 36 | end 37 | 38 | function outputSizes = getOutputSizes(obj, inputSizes) 39 | ks = obj.getKernelSize() ; 40 | ke = (ks - 1) .* obj.dilate + 1 ; 41 | outputSizes{1} = [... 42 | fix((inputSizes{1}(1) + obj.pad(1) + obj.pad(2) - ke(1)) / obj.stride(1)) + 1, ... 43 | fix((inputSizes{1}(2) + obj.pad(3) + obj.pad(4) - ke(2)) / obj.stride(2)) + 1, ... 44 | 1, ... 45 | inputSizes{1}(4)] ; 46 | end 47 | 48 | function rfs = getReceptiveFields(obj) 49 | ks = obj.getKernelSize() ; 50 | ke = (ks - 1) .* obj.dilate + 1 ; 51 | y1 = 1 - obj.pad(1) ; 52 | y2 = 1 - obj.pad(1) + ke(1) - 1 ; 53 | x1 = 1 - obj.pad(3) ; 54 | x2 = 1 - obj.pad(3) + ke(2) - 1 ; 55 | h = y2 - y1 + 1 ; 56 | w = x2 - x1 + 1 ; 57 | rfs.size = [h, w] ; 58 | rfs.stride = obj.stride ; 59 | rfs.offset = [y1+y2, x1+x2]/2 ; 60 | end 61 | end 62 | end 63 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/LRN.m: -------------------------------------------------------------------------------- 1 | classdef LRN < dagnn.ElementWise 2 | properties 3 | param = [5 1 0.0001/5 0.75] 4 | end 5 | 6 | methods 7 | function outputs = forward(obj, inputs, params) 8 | outputs{1} = vl_nnnormalize(inputs{1}, obj.param) ; 9 | end 10 | 11 | function [derInputs, derParams] = backward(obj, inputs, param, derOutputs) 12 | derInputs{1} = vl_nnnormalize(inputs{1}, obj.param, derOutputs{1}) ; 13 | derParams = {} ; 14 | end 15 | 16 | function obj = LRN(varargin) 17 | obj.load(varargin) ; 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/Loss.m: -------------------------------------------------------------------------------- 1 | classdef Loss < dagnn.ElementWise 2 | properties 3 | loss = 'softmaxlog' 4 | opts = {} 5 | end 6 | 7 | properties (Transient) 8 | average = 0 9 | numAveraged = 0 10 | end 11 | 12 | methods 13 | function outputs = forward(obj, inputs, params) 14 | outputs{1} = vl_nnloss(inputs{1}, inputs{2}, [], 'loss', obj.loss, obj.opts{:}) ; 15 | n = obj.numAveraged ; 16 | m = n + size(inputs{1},4) ; 17 | obj.average = (n * obj.average + gather(outputs{1})) / m ; 18 | obj.numAveraged = m ; 19 | end 20 | 21 | function [derInputs, derParams] = backward(obj, inputs, params, derOutputs) 22 | derInputs{1} = vl_nnloss(inputs{1}, inputs{2}, derOutputs{1}, 'loss', obj.loss, obj.opts{:}) ; 23 | derInputs{2} = [] ; 24 | derParams = {} ; 25 | end 26 | 27 | function reset(obj) 28 | obj.average = 0 ; 29 | obj.numAveraged = 0 ; 30 | end 31 | 32 | function outputSizes = getOutputSizes(obj, inputSizes, paramSizes) 33 | outputSizes{1} = [1 1 1 inputSizes{1}(4)] ; 34 | end 35 | 36 | function rfs = getReceptiveFields(obj) 37 | % the receptive field depends on the dimension of the variables 38 | % which is not known until the network is run 39 | rfs(1,1).size = [NaN NaN] ; 40 | rfs(1,1).stride = [NaN NaN] ; 41 | rfs(1,1).offset = [NaN NaN] ; 42 | rfs(2,1) = rfs(1,1) ; 43 | end 44 | 45 | function obj = Loss(varargin) 46 | obj.load(varargin) ; 47 | end 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/NormOffset.m: -------------------------------------------------------------------------------- 1 | classdef NormOffset < dagnn.ElementWise 2 | properties 3 | param = [1 0.5] 4 | end 5 | 6 | methods 7 | function outputs = forward(obj, inputs, params) 8 | outputs{1} = vl_nnnoffset(inputs{1}, obj.param) ; 9 | end 10 | 11 | function [derInputs, derParams] = backward(obj, inputs, param, derOutputs) 12 | derInputs{1} = vl_nnnoffset(inputs{1}, obj.param, derOutputs{1}) ; 13 | derParams = {} ; 14 | end 15 | 16 | function obj = NormOffset(varargin) 17 | obj.load(varargin) ; 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/Pooling.m: -------------------------------------------------------------------------------- 1 | classdef Pooling < dagnn.Filter 2 | properties 3 | method = 'max' 4 | poolSize = [1 1] 5 | opts = {'cuDNN'} 6 | end 7 | 8 | methods 9 | function outputs = forward(self, inputs, params) 10 | outputs{1} = vl_nnpool(inputs{1}, self.poolSize, ... 11 | 'pad', self.pad, ... 12 | 'stride', self.stride, ... 13 | 'method', self.method, ... 14 | self.opts{:}) ; 15 | end 16 | 17 | function [derInputs, derParams] = backward(self, inputs, params, derOutputs) 18 | derInputs{1} = vl_nnpool(inputs{1}, self.poolSize, derOutputs{1}, ... 19 | 'pad', self.pad, ... 20 | 'stride', self.stride, ... 21 | 'method', self.method, ... 22 | self.opts{:}) ; 23 | derParams = {} ; 24 | end 25 | 26 | function kernelSize = getKernelSize(obj) 27 | kernelSize = obj.poolSize ; 28 | end 29 | 30 | function outputSizes = getOutputSizes(obj, inputSizes) 31 | outputSizes = getOutputSizes@dagnn.Filter(obj, inputSizes) ; 32 | outputSizes{1}(3) = inputSizes{1}(3) ; 33 | end 34 | 35 | function obj = Pooling(varargin) 36 | obj.load(varargin) ; 37 | end 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/Scale.m: -------------------------------------------------------------------------------- 1 | classdef Scale < dagnn.ElementWise 2 | properties 3 | size 4 | hasBias = true 5 | end 6 | 7 | methods 8 | 9 | function outputs = forward(obj, inputs, params) 10 | args = horzcat(inputs, params) ; 11 | outputs{1} = bsxfun(@times, args{1}, args{2}) ; 12 | if obj.hasBias 13 | outputs{1} = bsxfun(@plus, outputs{1}, args{3}) ; 14 | end 15 | end 16 | 17 | function [derInputs, derParams] = backward(obj, inputs, params, derOutputs) 18 | args = horzcat(inputs, params) ; 19 | sz = [size(args{2}) 1 1 1 1] ; 20 | sz = sz(1:4) ; 21 | dargs{1} = bsxfun(@times, derOutputs{1}, args{2}) ; 22 | dargs{2} = derOutputs{1} .* args{1} ; 23 | for k = find(sz == 1) 24 | dargs{2} = sum(dargs{2}, k) ; 25 | end 26 | if obj.hasBias 27 | dargs{3} = derOutputs{1} ; 28 | for k = find(sz == 1) 29 | dargs{3} = sum(dargs{3}, k) ; 30 | end 31 | end 32 | derInputs = dargs(1:numel(inputs)) ; 33 | derParams = dargs(numel(inputs)+(1:numel(params))) ; 34 | end 35 | 36 | function obj = Scale(varargin) 37 | obj.load(varargin) ; 38 | end 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/Sigmoid.m: -------------------------------------------------------------------------------- 1 | classdef Sigmoid < dagnn.ElementWise 2 | methods 3 | function outputs = forward(obj, inputs, params) 4 | outputs{1} = vl_nnsigmoid(inputs{1}) ; 5 | end 6 | 7 | function [derInputs, derParams] = backward(obj, inputs, params, derOutputs) 8 | derInputs{1} = vl_nnsigmoid(inputs{1}, derOutputs{1}) ; 9 | derParams = {} ; 10 | end 11 | end 12 | end 13 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/SoftMax.m: -------------------------------------------------------------------------------- 1 | classdef SoftMax < dagnn.ElementWise 2 | methods 3 | function outputs = forward(self, inputs, params) 4 | outputs{1} = vl_nnsoftmax(inputs{1}) ; 5 | end 6 | 7 | function [derInputs, derParams] = backward(self, inputs, params, derOutputs) 8 | derInputs{1} = vl_nnsoftmax(inputs{1}, derOutputs{1}) ; 9 | derParams = {} ; 10 | end 11 | 12 | function obj = SoftMax(varargin) 13 | obj.load(varargin) ; 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/SpatialNorm.m: -------------------------------------------------------------------------------- 1 | classdef SpatialNorm < dagnn.ElementWise 2 | properties 3 | param = [2 2 10 2] 4 | end 5 | 6 | methods 7 | function outputs = forward(obj, inputs, params) 8 | outputs{1} = vl_nnspnorm(inputs{1}, obj.param) ; 9 | end 10 | 11 | function [derInputs, derParams] = backward(obj, inputs, param, derOutputs) 12 | derInputs{1} = vl_nnspnorm(inputs{1}, obj.param, derOutputs{1}) ; 13 | derParams = {} ; 14 | end 15 | 16 | function obj = SpatialNorm(varargin) 17 | obj.load(varargin) ; 18 | end 19 | end 20 | end 21 | -------------------------------------------------------------------------------- /matconvnet/matlab/+dagnn/Sum.m: -------------------------------------------------------------------------------- 1 | classdef Sum < dagnn.ElementWise 2 | %SUM DagNN sum layer 3 | % The SUM layer takes the sum of all its inputs and store the result 4 | % as its only output. 5 | 6 | properties (Transient) 7 | numInputs 8 | end 9 | 10 | methods 11 | function outputs = forward(obj, inputs, params) 12 | obj.numInputs = numel(inputs) ; 13 | outputs{1} = inputs{1} ; 14 | for k = 2:obj.numInputs 15 | outputs{1} = outputs{1} + inputs{k} ; 16 | end 17 | end 18 | 19 | function [derInputs, derParams] = backward(obj, inputs, params, derOutputs) 20 | for k = 1:obj.numInputs 21 | derInputs{k} = derOutputs{1} ; 22 | end 23 | derParams = {} ; 24 | end 25 | 26 | function outputSizes = getOutputSizes(obj, inputSizes) 27 | outputSizes{1} = inputSizes{1} ; 28 | for k = 2:numel(inputSizes) 29 | if all(~isnan(inputSizes{k})) && all(~isnan(outputSizes{1})) 30 | if ~isequal(inputSizes{k}, outputSizes{1}) 31 | warning('Sum layer: the dimensions of the input variables is not the same.') ; 32 | end 33 | end 34 | end 35 | end 36 | 37 | function rfs = getReceptiveFields(obj) 38 | numInputs = numel(obj.net.layers(obj.layerIndex).inputs) ; 39 | rfs.size = [1 1] ; 40 | rfs.stride = [1 1] ; 41 | rfs.offset = [1 1] ; 42 | rfs = repmat(rfs, numInputs, 1) ; 43 | end 44 | 45 | function obj = Sum(varargin) 46 | obj.load(varargin) ; 47 | end 48 | end 49 | end 50 | -------------------------------------------------------------------------------- /matconvnet/matlab/compatibility/parallel/gather.m: -------------------------------------------------------------------------------- 1 | function x=gather(x) 2 | % GATHER Compatibility stub for the GATHER() function 3 | % GATHER() is a function in the Parallel MATLAB toolbox. MATCONVNET 4 | % can work without it. 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/compatibility/parallel/labindex.m: -------------------------------------------------------------------------------- 1 | function i = labindex() 2 | i = 1 ; 3 | -------------------------------------------------------------------------------- /matconvnet/matlab/compatibility/parallel/numlabs.m: -------------------------------------------------------------------------------- 1 | function n = numlabs() 2 | n = 1 ; 3 | -------------------------------------------------------------------------------- /matconvnet/matlab/simplenn/vl_simplenn_move.m: -------------------------------------------------------------------------------- 1 | function net = vl_simplenn_move(net, destination) 2 | %VL_SIMPLENN_MOVE Move a SimpleNN network between CPU and GPU. 3 | % NET = VL_SIMPLENN_MOVE(NET, 'gpu') moves the network to the 4 | % current GPU device. NET = VL_SIMPLENN_MOVE(NET, 'cpu') moves the 5 | % network to the CPU. 6 | % 7 | % See also: VL_SIMPLENN(). 8 | 9 | % Copyright (C) 2014-15 Andrea Vedaldi. 10 | % All rights reserved. 11 | % 12 | % This file is part of the VLFeat library and is made available under 13 | % the terms of the BSD license (see the COPYING file). 14 | 15 | switch destination 16 | case 'gpu', moveop = @(x) gpuArray(x) ; 17 | case 'cpu', moveop = @(x) gather(x) ; 18 | otherwise, error('Unknown destination ''%s''.', destination) ; 19 | end 20 | for l=1:numel(net.layers) 21 | switch net.layers{l}.type 22 | case {'conv', 'convt', 'bnorm'} 23 | for f = {'filters', 'biases', 'filtersMomentum', 'biasesMomentum'} 24 | f = char(f) ; 25 | if isfield(net.layers{l}, f) 26 | net.layers{l}.(f) = moveop(net.layers{l}.(f)) ; 27 | end 28 | end 29 | for f = {'weights', 'momentum'} 30 | f = char(f) ; 31 | if isfield(net.layers{l}, f) 32 | for j=1:numel(net.layers{l}.(f)) 33 | net.layers{l}.(f){j} = moveop(net.layers{l}.(f){j}) ; 34 | end 35 | end 36 | end 37 | otherwise 38 | % nothing to do ? 39 | end 40 | end 41 | -------------------------------------------------------------------------------- /matconvnet/matlab/simplenn/vl_simplenn_start_parserv.m: -------------------------------------------------------------------------------- 1 | function vl_simplenn_start_parserv(net, ps) 2 | %VL_SIMPLENN_START_PARSERV Setup a parameter server for this network 3 | % VL_SIMPLENN_START_PARSERV(NET, PS) registers the network 4 | % parameter derivatives with the specified ParameterServer instance 5 | % PS and then starts the server. 6 | 7 | for i = 1:numel(net.layers) 8 | for j = 1:numel(net.layers{i}.weights) 9 | value = net.layers{i}.weights{j} ; 10 | name = sprintf('l%d_%d',i,j) ; 11 | if strcmp(class(value),'gpuArray') 12 | deviceType = 'gpu' ; 13 | dataType = classUnderlying(value) ; 14 | else 15 | deviceType = 'cpu' ; 16 | dataType = class(value) ; 17 | end 18 | ps.register(... 19 | name, ... 20 | size(value), ... 21 | dataType, ... 22 | deviceType) ; 23 | end 24 | end 25 | ps.start() ; 26 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/data.cpp: -------------------------------------------------------------------------------- 1 | #if ENABLE_GPU 2 | #error This file should not be compiled with GPU support enabled 3 | #endif 4 | #include "data.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/datamex.cpp: -------------------------------------------------------------------------------- 1 | #if ENABLE_GPU 2 | #error This file should not be compiled with GPU support enabled 3 | #endif 4 | #include "datamex.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/impl/bilinearsampler.hpp: -------------------------------------------------------------------------------- 1 | // @file bilinearsampler.hpp 2 | // @brief Bilinear sampler implementation 3 | // @author Ankush Gupta 4 | // @author Andrea Vedaldi 5 | 6 | /* 7 | Copyright (C) 2016- Ankush Gupta and Andrea Vedaldi. 8 | All rights reserved. 9 | 10 | This file is part of the VLFeat library and is made available under 11 | the terms of the BSD license (see the COPYING file). 12 | */ 13 | 14 | #ifndef VL_BILINEARSAMPLER_H 15 | #define VL_BILINEARSAMPLER_H 16 | 17 | #include "../data.hpp" 18 | #include 19 | 20 | // defines the dispatcher for CUDA kernels: 21 | namespace vl { namespace impl { 22 | 23 | template 24 | struct bilinearsampler { 25 | 26 | static vl::ErrorCode 27 | forward(Context& context, 28 | type* output, 29 | type const* data, 30 | type const* grid, 31 | size_t outHeight, size_t outWidth, size_t outDepth, size_t outCardinality, 32 | size_t inHeight, size_t inWidth, size_t inCardinality) ; 33 | 34 | 35 | static vl::ErrorCode 36 | backward(Context& context, 37 | type* derData, 38 | type* derGrid, 39 | type const* data, 40 | type const* grid, 41 | type const* derOutput, 42 | size_t outHeight, size_t outWidth, size_t outDepth, size_t outCardinality, 43 | size_t inHeight, size_t inWidth, size_t inCardinality) ; 44 | } ; 45 | 46 | } } 47 | 48 | #endif /* defined(VL_BILINEARSAMPLER_H) */ 49 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/impl/copy.hpp: -------------------------------------------------------------------------------- 1 | // @file copy.hpp 2 | // @brief Copy and other data operations 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2015-16 Andrea Vedaldi. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #ifndef __vl__copy__ 14 | #define __vl__copy__ 15 | 16 | #include "../data.hpp" 17 | 18 | namespace vl { namespace impl { 19 | 20 | template 21 | struct operations 22 | { 23 | typedef type data_type ; 24 | static vl::ErrorCode copy(data_type * dest, data_type const * src, size_t numElements) ; 25 | static vl::ErrorCode fill(data_type * dest, size_t numElements, data_type value) ; 26 | } ; 27 | } } 28 | 29 | #endif /* defined(__vl__copy__) */ 30 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/impl/copy_cpu.cpp: -------------------------------------------------------------------------------- 1 | // @file copy_cpu.cpp 2 | // @brief Copy and other data operations (CPU) 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2015-16 Andrea Vedaldi. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #include "copy.hpp" 14 | #include 15 | 16 | namespace vl { namespace impl { 17 | 18 | template 19 | struct operations 20 | { 21 | typedef type data_type ; 22 | 23 | static vl::ErrorCode 24 | copy(data_type * dest, 25 | data_type const * src, 26 | size_t numElements) 27 | { 28 | memcpy(dest, src, numElements * sizeof(data_type)) ; 29 | return VLE_Success ; 30 | } 31 | 32 | static vl::ErrorCode 33 | fill(data_type * dest, 34 | size_t numElements, 35 | data_type value) 36 | { 37 | for (size_t k = 0 ; k < numElements ; ++k) { 38 | dest[k] = value ; 39 | } 40 | return VLE_Success ; 41 | } 42 | } ; 43 | 44 | } } 45 | 46 | template struct vl::impl::operations ; 47 | 48 | #ifdef ENABLE_DOUBLE 49 | template struct vl::impl::operations ; 50 | #endif 51 | 52 | 53 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/impl/copy_gpu.cu: -------------------------------------------------------------------------------- 1 | // @file copy_gpu.cu 2 | // @brief Copy and other data operations (GPU) 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2015-16 Andrea Vedaldi. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #include "copy.hpp" 14 | #include "../datacu.hpp" 15 | #include 16 | 17 | template __global__ void 18 | fill_kernel (type * data, type value, size_t size) 19 | { 20 | int index = threadIdx.x + blockIdx.x * blockDim.x ; 21 | if (index < size) data[index] = value ; 22 | } 23 | 24 | namespace vl { namespace impl { 25 | 26 | template 27 | struct operations 28 | { 29 | typedef type data_type ; 30 | 31 | static vl::ErrorCode 32 | copy(data_type * dest, 33 | data_type const * src, 34 | size_t numElements) 35 | { 36 | cudaMemcpy(dest, src, numElements * sizeof(data_type), cudaMemcpyDeviceToDevice) ; 37 | return VLE_Success ; 38 | } 39 | 40 | static vl::ErrorCode 41 | fill(data_type * dest, 42 | size_t numElements, 43 | data_type value) 44 | { 45 | fill_kernel 46 | <<>> 47 | (dest, numElements, value) ; 48 | 49 | cudaError_t error = cudaGetLastError() ; 50 | if (error != cudaSuccess) { 51 | return VLE_Cuda ; 52 | } 53 | return VLE_Success ; 54 | } 55 | } ; 56 | 57 | } } 58 | 59 | template struct vl::impl::operations ; 60 | 61 | #ifdef ENABLE_DOUBLE 62 | template struct vl::impl::operations ; 63 | #endif -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/impl/im2row.hpp: -------------------------------------------------------------------------------- 1 | // @file im2row.hpp 2 | // @brief Stack image patches as matrix rows 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2014-16 Andrea Vedaldi. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #ifndef __vl__im2row__ 14 | #define __vl__im2row__ 15 | 16 | #include "../data.hpp" 17 | #include 18 | 19 | namespace vl { namespace impl { 20 | 21 | template 22 | struct im2row { 23 | 24 | static vl::ErrorCode 25 | forward(vl::Context& context, 26 | type* stacked, 27 | type const* data, 28 | size_t height, size_t width, size_t depth, 29 | size_t windowHeight, size_t windowWidth, 30 | size_t strideY, size_t strideX, 31 | size_t padTop, size_t padBottom, size_t padLeft, size_t padRight, 32 | int dilateY, int dialteX) ; 33 | 34 | static vl::ErrorCode 35 | backward(vl::Context& context, 36 | type* data, 37 | type const* stacked, 38 | size_t height, size_t width, size_t depth, 39 | size_t windowHeight, size_t windowWidth, 40 | size_t strideY, size_t strideX, 41 | size_t padTop, size_t padBottom, size_t padLeft, size_t padRight, 42 | int dilateY, int dilateX) ; 43 | } ; 44 | 45 | } } 46 | 47 | #endif /* defined(__vl__im2row__) */ 48 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/impl/nnbias_cudnn.hpp: -------------------------------------------------------------------------------- 1 | // @file nnbias_blas.hpp 2 | // @brief biasolution block CuDNN-based implementation. 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2015 Andrea Vedaldi. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #ifndef __vl__nnbias_cudnn__ 14 | #define __vl__nnbias_cudnn__ 15 | 16 | #include "../data.hpp" 17 | #include "cudnn.h" 18 | 19 | namespace vl { namespace impl { 20 | 21 | // todo: data type should be handled internally? 22 | 23 | template 24 | struct nnbias_cudnn 25 | { 26 | static vl::ErrorCode 27 | forward(vl::Context& context, 28 | vl::Tensor output, double outputMult, 29 | vl::Tensor data, double dataMult, 30 | vl::Tensor biases, double biasesMult) ; 31 | 32 | static vl::ErrorCode 33 | backward(vl::Context& context, 34 | vl::Tensor derData, double derDataMult, 35 | vl::Tensor derBiases, double derBiasesMult, 36 | vl::Tensor derOutput, double derOutputMult) ; 37 | } ; 38 | 39 | } } 40 | 41 | #endif /* defined(__vl__nnbias_cudnn__) */ 42 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/impl/nnbilinearsampler_cudnn.hpp: -------------------------------------------------------------------------------- 1 | // @file nnbilinearsampler_cudnn.hpp 2 | // @brief BilinearSampler CuDNN-based implementation. 3 | // @author Ankush Gupta, Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2016 Ankush Gupta and Andrea Vedaldi. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #ifndef __vl__bilinearsampler_cudnn__ 14 | #define __vl__bilinearsampler_cudnn__ 15 | 16 | #include "../data.hpp" 17 | #include "cudnn.h" 18 | 19 | namespace vl { namespace impl { 20 | 21 | template 22 | struct nnbilinearsampler_cudnn 23 | { 24 | static vl::ErrorCode 25 | forward(Context& context, 26 | Tensor output, 27 | Tensor data, 28 | Tensor grid) ; 29 | 30 | static vl::ErrorCode 31 | backward(Context& context, 32 | Tensor derData, 33 | Tensor derGrid, 34 | Tensor data, 35 | Tensor grid, 36 | Tensor derOutput) ; 37 | } ; 38 | 39 | } } 40 | 41 | #endif /* defined(__vl__nnbilinearsampler_cudnn__) */ 42 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/impl/nnconv_cudnn.hpp: -------------------------------------------------------------------------------- 1 | // @file nnconv_blas.hpp 2 | // @brief Convolution block CuDNN-based implementation. 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2015-16 Andrea Vedaldi. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #ifndef __vl__nnconv_cudnn__ 14 | #define __vl__nnconv_cudnn__ 15 | 16 | #include "../data.hpp" 17 | #include "cudnn.h" 18 | 19 | namespace vl { namespace impl { 20 | 21 | template 22 | struct nnconv_cudnn 23 | { 24 | static vl::ErrorCode 25 | forward(Context& context, 26 | Tensor output, double outputMult, 27 | Tensor data, double dataMult, 28 | Tensor filters, 29 | Tensor biases, 30 | int strideX, int strideY, 31 | int padLeft, int padRight, 32 | int padTop, int padBottom, 33 | int dilateX, int dilateY) ; 34 | 35 | static vl::ErrorCode 36 | backward(Context& context, 37 | Tensor derData, 38 | Tensor derFilters, 39 | Tensor derBiases, 40 | Tensor data, 41 | Tensor filters, 42 | Tensor derOutput, 43 | int strideX, int strideY, 44 | int padLeft, int padRight, 45 | int padTop, int padBottom, 46 | int dilateX, int dilateY) ; 47 | } ; 48 | 49 | } } 50 | #endif /* defined(__vl__nnconv_cudnn__) */ 51 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/impl/nnpooling_cudnn.hpp: -------------------------------------------------------------------------------- 1 | // @file nnpooling_blas.hpp 2 | // @brief Pooling block CuDNN-based implementation. 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2015-16 Andrea Vedaldi. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #ifndef __vl__nnpooling_cudnn__ 14 | #define __vl__nnpooling_cudnn__ 15 | 16 | #include "../nnpooling.hpp" 17 | #include "../data.hpp" 18 | #include "cudnn.h" 19 | 20 | 21 | namespace vl { namespace impl { 22 | 23 | // todo: data type should be handled internally? 24 | 25 | template 26 | struct nnpooling_cudnn 27 | { 28 | static vl::ErrorCode 29 | forward(Context& context, 30 | Tensor output, 31 | Tensor data, 32 | vl::PoolingMethod method, 33 | int poolHeight, int poolWidth, 34 | int strideY, int strideX, 35 | int padTop, int padBottom, 36 | int padLeft, int padRight) ; 37 | 38 | static vl::ErrorCode 39 | backward(Context& context, 40 | Tensor derData, 41 | Tensor data, 42 | Tensor output, 43 | Tensor derOutput, 44 | vl::PoolingMethod method, 45 | int poolHeight, int poolWidth, 46 | int strideY, int strideX, 47 | int padTop, int padBottom, 48 | int padLeft, int padRight) ; 49 | }; 50 | 51 | } } 52 | 53 | #endif /* defined(__vl__nnpooling_cudnn__) */ 54 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/impl/normalize.hpp: -------------------------------------------------------------------------------- 1 | // @file normalize.hpp 2 | // @brief Normalize block implementation 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2014-16 Andrea Vedaldi. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #ifndef __vl__normalize__ 14 | #define __vl__normalize__ 15 | 16 | #include "../data.hpp" 17 | #include 18 | 19 | namespace vl { namespace impl { 20 | 21 | template 22 | struct lrn 23 | { 24 | static vl::ErrorCode 25 | forward(type* output, 26 | type const* data, 27 | size_t height, size_t width, size_t depth, size_t size, 28 | size_t normDetph, 29 | type kappa, type alpha, type beta) ; 30 | 31 | static vl::ErrorCode 32 | backward(type* derData, 33 | type const* data, 34 | type const* derOutput, 35 | size_t height, size_t width, size_t depth, size_t size, 36 | size_t normDetph, 37 | type kappa, type alpha, type beta) ; 38 | } ; 39 | 40 | } } 41 | 42 | #endif /* __vl__normalize__ */ 43 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/impl/subsample.hpp: -------------------------------------------------------------------------------- 1 | // @file subsampling.hpp 2 | // @brief Subsampling block implementation 3 | // @author Andrea Vedaldi 4 | // @author Karel Lenc 5 | 6 | /* 7 | Copyright (C) 2014-16 Andrea Vedaldi and Karel Lenc. 8 | All rights reserved. 9 | 10 | This file is part of the VLFeat library and is made available under 11 | the terms of the BSD license (see the COPYING file). 12 | */ 13 | 14 | #ifndef VL_NNSUBSAMPLE_H 15 | #define VL_NNSUBSAMPLE_H 16 | 17 | #include "../data.hpp" 18 | #include 19 | 20 | namespace vl { namespace impl { 21 | 22 | template 23 | struct subsample { 24 | 25 | static vl::ErrorCode 26 | forward(vl::Context& context, 27 | type* output, 28 | type const* data, 29 | size_t height, size_t width, size_t depth, 30 | size_t strideY, size_t strideX, 31 | size_t padTop, size_t padBottom, size_t padLeft, size_t padRight) ; 32 | 33 | static vl::ErrorCode 34 | backward(vl::Context& context, 35 | type* derData, 36 | type const* derOutput, 37 | size_t height, size_t width, size_t depth, 38 | size_t strideY, size_t strideX, 39 | size_t padTop, size_t padBottom, size_t padLeft, size_t padRight) ; 40 | } ; 41 | 42 | } } 43 | 44 | #endif /* defined(VL_NNSUBSAMPLE_H) */ 45 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/imread.cpp: -------------------------------------------------------------------------------- 1 | // @file imread.cpp 2 | // @brief Image reader 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2015-16 Andrea Vedaldi. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #include "imread.hpp" 14 | #include 15 | 16 | vl::ImageShape::ImageShape() 17 | : height(0), width(0), depth(0) 18 | { } 19 | 20 | vl::ImageShape::ImageShape(size_t height, size_t width, size_t depth) 21 | : height(height), width(width), depth(depth) 22 | { } 23 | 24 | vl::ImageShape::ImageShape(ImageShape const & im) 25 | : height(im.height), width(im.width), depth(im.depth) 26 | { } 27 | 28 | vl::ImageShape & vl::ImageShape::operator =(vl::ImageShape const & im) 29 | { 30 | height = im.height ; 31 | width = im.width ; 32 | depth = im.depth ; 33 | return *this ; 34 | } 35 | 36 | bool vl::ImageShape::operator == (vl::ImageShape const & im) 37 | { 38 | return 39 | (height == im.height) & 40 | (width == im.width) & 41 | (depth == im.depth) ; 42 | } 43 | 44 | size_t vl::ImageShape::getNumElements() const 45 | { 46 | return height*width*depth ; 47 | } 48 | 49 | void vl::ImageShape::clear() 50 | { 51 | height = 0 ; 52 | width = 0 ; 53 | depth = 0 ; 54 | } 55 | 56 | vl::Image::Image() 57 | : shape(), memory(NULL) 58 | { } 59 | 60 | vl::Image::Image(Image const & im) 61 | : shape(im.shape), memory(im.memory) 62 | { } 63 | 64 | vl::Image::Image(vl::ImageShape const & shape, float * memory) 65 | : shape(shape), memory(memory) 66 | { } 67 | 68 | vl::ImageShape const & vl::Image::getShape() const { return shape ; } 69 | float * vl::Image::getMemory() const { return memory ; } 70 | 71 | void vl::Image::clear() 72 | { 73 | shape.clear() ; 74 | memory = 0 ; 75 | } 76 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/imread.hpp: -------------------------------------------------------------------------------- 1 | // @file imread.hpp 2 | // @brief Image reader 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2015-16 Andrea Vedaldi. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #ifndef __vl__imread__ 14 | #define __vl__imread__ 15 | 16 | #include "data.hpp" 17 | 18 | namespace vl { 19 | 20 | #define VL_IMAGE_ERROR_MSG_MAX_LENGTH 256 21 | 22 | struct ImageShape 23 | { 24 | size_t height ; 25 | size_t width ; 26 | size_t depth ; 27 | 28 | ImageShape() ; 29 | ImageShape(size_t height, size_t width, size_t depth) ; 30 | ImageShape(ImageShape const & im) ; 31 | ImageShape & operator = (ImageShape const & im) ; 32 | bool operator == (ImageShape const & im) ; 33 | 34 | size_t getNumElements() const ; 35 | void clear() ; 36 | } ; 37 | 38 | class Image 39 | { 40 | public: 41 | Image() ; 42 | Image(Image const & im) ; 43 | Image(ImageShape const & shape, float * memory = NULL) ; 44 | ImageShape const & getShape() const ; 45 | float * getMemory() const ; 46 | void clear() ; 47 | 48 | protected: 49 | ImageShape shape ; 50 | float * memory ; 51 | } ; 52 | 53 | class ImageReader 54 | { 55 | public: 56 | ImageReader() ; 57 | ~ImageReader() ; 58 | vl::ErrorCode readShape(ImageShape & image, char const * fileName) ; 59 | vl::ErrorCode readPixels(float * memory, char const * fileName) ; 60 | char const * getLastErrorMessage() const ; 61 | 62 | private: 63 | class Impl ; 64 | Impl * impl ; 65 | } ; 66 | } 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/nnbias.cpp: -------------------------------------------------------------------------------- 1 | #ifdef ENABLE_GPU 2 | #error "The file nnsubsample.cu should be compiled instead" 3 | #endif 4 | #include "nnbias.cu" 5 | 6 | /** 7 | @brief nnbias_forward 8 | @param context context. 9 | @param output output tensor $\by$ [output]. 10 | @param outputMult output tensor multiplier $\alpha$. 11 | @param data data tensor $\bx$. 12 | @param dataMult data tensor multiplier $\beta$. 13 | @param biases biases tensor $\bb$. 14 | @param biasesMult biases tensor multiplier $\gamma$. 15 | 16 | The function computes 17 | @f[ 18 | y_{ijkd} \leftarrow 19 | \alpha y_{ijkd} + 20 | \beta x_{ijkd} + 21 | \gamma b_k. 22 | @f] 23 | 24 | @a data can be the null tensor, in which case this tensor 25 | is dropped in the summation. 26 | */ 27 | 28 | /** 29 | @brief nnbias_backward 30 | @param context context. 31 | @param derData data derivative tensor $d\bx$ [output]. 32 | @param derDataMult data derivative tensor multiplier $\eta$. 33 | @param derBiases biases derivative tensor $d\bb$ [output]. 34 | @param derBiasesMult biased derivative tensor multiplier $\tau$. 35 | @param data data tensor $\bx$. 36 | @param dataMult data tensor multiplier $\beta$. 37 | @param biases biases tensor $\bb$. 38 | @param biasesMult biases tensor multiplier $\gamma$. 39 | 40 | If @a derData is the null tensor, this derivative is not comptued and 41 | @param biases can also be null. 42 | 43 | If @a derBiases is the null tensor, this derivative is not computed and 44 | @param data can also be null. 45 | */ 46 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/nnbias.hpp: -------------------------------------------------------------------------------- 1 | // @file nnbias.hpp 2 | // @brief Bias block 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2015 Andrea Vedaldi. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #ifndef __vl__nnbias__ 14 | #define __vl__nnbias__ 15 | 16 | #include "data.hpp" 17 | 18 | namespace vl { 19 | 20 | vl::ErrorCode 21 | nnbias_forward(vl::Context& context, 22 | vl::Tensor output, double outputMult, 23 | vl::Tensor data, double dataMult, 24 | vl::Tensor biases, double biasesMult) ; 25 | 26 | vl::ErrorCode 27 | nnbias_backward(vl::Context& context, 28 | vl::Tensor derData, double derDataMult, 29 | vl::Tensor derBiases, double derBiasesMult, 30 | vl::Tensor derOutput, double derOutputMult) ; 31 | } 32 | 33 | #endif /* defined(__vl__nnbias__) */ 34 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/nnbilinearsampler.cpp: -------------------------------------------------------------------------------- 1 | #ifdef ENABLE_GPU 2 | #error "The file nnbnorm.cu should be compiled instead" 3 | #endif 4 | #include "nnbilinearsampler.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/nnbilinearsampler.hpp: -------------------------------------------------------------------------------- 1 | // @file nnbilinearsampler.hpp 2 | // @brief Bilinear sampler block 3 | // @author Ankush Gupta 4 | // @author Andrea Vedaldi 5 | 6 | /* 7 | Copyright (C) 2016- Ankush Gupta and Andrea Vedaldi. 8 | All rights reserved. 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #ifndef __vl__nnbilinearsampler__ 14 | #define __vl__nnbilinearsampler__ 15 | 16 | #include "data.hpp" 17 | #include 18 | 19 | namespace vl { 20 | vl::ErrorCode 21 | nnbilinearsampler_forward(vl::Context& context, 22 | vl::Tensor output, 23 | vl::Tensor data, 24 | vl::Tensor grid) ; 25 | 26 | vl::ErrorCode 27 | nnbilinearsampler_backward(vl::Context& context, 28 | vl::Tensor derData, 29 | vl::Tensor derGrid, 30 | vl::Tensor data, 31 | vl::Tensor grid, 32 | vl::Tensor derOutput) ; 33 | } 34 | 35 | #endif /* defined(__vl__nnbilinearsampler__) */ 36 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/nnbnorm.cpp: -------------------------------------------------------------------------------- 1 | #ifdef ENABLE_GPU 2 | #error "The file nnbnorm.cu should be compiled instead" 3 | #endif 4 | #include "nnbnorm.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/nnconv.cpp: -------------------------------------------------------------------------------- 1 | #ifdef ENABLE_GPU 2 | #error "The file nnconv.cu should be compiled instead" 3 | #endif 4 | #include "nnconv.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/nnfullyconnected.cpp: -------------------------------------------------------------------------------- 1 | #ifdef ENABLE_GPU 2 | #error "The file nnfullyconnected.cu should be compiled instead" 3 | #endif 4 | #include "nnfullyconnected.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/nnfullyconnected.hpp: -------------------------------------------------------------------------------- 1 | // @file nnfullyconnected.hpp 2 | // @brief Fully-connected block 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2014-16 Andrea Vedaldi. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | 14 | #ifndef __vl__nnfullyconnected__ 15 | #define __vl__nnfullyconnected__ 16 | 17 | #include "data.hpp" 18 | 19 | namespace vl { 20 | 21 | vl::ErrorCode 22 | nnfullyconnected_forward(vl::Context& context, 23 | vl::Tensor output, 24 | vl::Tensor data, 25 | vl::Tensor filters, 26 | vl::Tensor biases) ; 27 | 28 | vl::ErrorCode 29 | nnfullyconnected_backward(vl::Context& context, 30 | vl::Tensor derData, 31 | vl::Tensor derFilters, 32 | vl::Tensor derBiases, 33 | vl::Tensor data, 34 | vl::Tensor filters, 35 | vl::Tensor derOutput) ; 36 | } 37 | 38 | 39 | #endif /* defined(__vl__nnfullyconnected__) */ 40 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/nnnormalize.cpp: -------------------------------------------------------------------------------- 1 | #ifdef ENABLE_GPU 2 | #error "The file nnnormalize.cu should be compiled instead" 3 | #endif 4 | #include "nnnormalize.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/nnnormalize.hpp: -------------------------------------------------------------------------------- 1 | // @file nnnormalize.hpp 2 | // @brief Normalization block 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2014-16 Andrea Vedaldi. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #ifndef __vl__nnnormalize__ 14 | #define __vl__nnnormalize__ 15 | 16 | #include "data.hpp" 17 | #include 18 | 19 | namespace vl { 20 | 21 | vl::ErrorCode 22 | nnlrn_forward(vl::Context& context, 23 | vl::Tensor output, 24 | vl::Tensor data, 25 | size_t normDetph, 26 | double kappa, double alpha, double beta) ; 27 | 28 | vl::ErrorCode 29 | nnlrn_backward(vl::Context& context, 30 | vl::Tensor derData, 31 | vl::Tensor data, 32 | vl::Tensor derOutput, 33 | size_t normDetph, 34 | double kappa, double alpha, double beta) ; 35 | } 36 | 37 | #endif /* defined(__vl__nnnormalize__) */ 38 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/nnpooling.cpp: -------------------------------------------------------------------------------- 1 | #ifdef ENABLE_GPU 2 | #error "The file nnpooling.cu should be compiled instead" 3 | #endif 4 | #include "nnpooling.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/nnpooling.hpp: -------------------------------------------------------------------------------- 1 | // @file nnpooling.hpp 2 | // @brief Pooling block 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2014-16 Andrea Vedaldi and Karel Lenc. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #ifndef __vl__nnpooling__ 14 | #define __vl__nnpooling__ 15 | 16 | #include "data.hpp" 17 | #include 18 | 19 | namespace vl { 20 | 21 | enum PoolingMethod { vlPoolingMax, vlPoolingAverage } ; 22 | 23 | vl::ErrorCode 24 | nnpooling_forward(vl::Context& context, 25 | vl::Tensor output, 26 | vl::Tensor data, 27 | PoolingMethod method, 28 | int poolHeight, int poolWidth, 29 | int strideY, int strideX, 30 | int padTop, int padBottom, 31 | int padLeft, int padRight) ; 32 | 33 | vl::ErrorCode 34 | nnpooling_backward(vl::Context& context, 35 | vl::Tensor derData, 36 | vl::Tensor data, 37 | vl::Tensor derOutput, 38 | PoolingMethod method, 39 | int poolHeight, int poolWidth, 40 | int strideY, int strideX, 41 | int padTop, int padBottom, 42 | int padLeft, int padRight) ; 43 | } 44 | 45 | #endif /* defined(__vl__nnpooling__) */ 46 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/nnsubsample.cpp: -------------------------------------------------------------------------------- 1 | #ifdef ENABLE_GPU 2 | #error "The file nnsubsample.cu should be compiled instead" 3 | #endif 4 | #include "nnsubsample.cu" 5 | 6 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/bits/nnsubsample.hpp: -------------------------------------------------------------------------------- 1 | // @file nnsubsample.hpp 2 | // @brief Subsamping block 3 | // @author Andrea Vedaldi 4 | 5 | /* 6 | Copyright (C) 2014-16 Andrea Vedaldi and Karel Lenc. 7 | All rights reserved. 8 | 9 | This file is part of the VLFeat library and is made available under 10 | the terms of the BSD license (see the COPYING file). 11 | */ 12 | 13 | #ifndef __vl__nnsubsample__ 14 | #define __vl__nnsubsample__ 15 | 16 | #include "data.hpp" 17 | 18 | namespace vl { 19 | 20 | vl::ErrorCode 21 | nnsubsample_forward(vl::Context& context, 22 | vl::Tensor output, 23 | vl::Tensor data, 24 | vl::Tensor biases, 25 | int strideY, int strideX, 26 | int padTop, int padBottom, 27 | int padLeft, int padRight) ; 28 | 29 | vl::ErrorCode 30 | nnsubsample_backward(vl::Context& context, 31 | vl::Tensor derData, 32 | vl::Tensor derBiases, 33 | vl::Tensor derOutput, 34 | int strideY, int strideX, 35 | int padTop, int padBottom, 36 | int padLeft, int padRight) ; 37 | } 38 | 39 | #endif /* defined(__vl__nnsubsample__) */ 40 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/vl_cudatool.cpp: -------------------------------------------------------------------------------- 1 | #if ENABLE_GPU 2 | #error This file should not be compiled with GPU support enabled 3 | #endif 4 | #include "vl_cudatool.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/vl_imreadjpeg.cpp: -------------------------------------------------------------------------------- 1 | #if ENABLE_GPU 2 | #error This file should not be compiled with GPU support enabled 3 | #endif 4 | #include "vl_imreadjpeg.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/vl_imreadjpeg_old.cpp: -------------------------------------------------------------------------------- 1 | #if ENABLE_GPU 2 | #error This file should not be compiled with GPU support enabled 3 | #endif 4 | #include "vl_imreadjpeg.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/vl_nnbilinearsampler.cpp: -------------------------------------------------------------------------------- 1 | #if ENABLE_GPU 2 | #error This file should not be compiled with GPU support enabled 3 | #endif 4 | #include "vl_nnbilinearsampler.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/vl_nnbnorm.cpp: -------------------------------------------------------------------------------- 1 | #if ENABLE_GPU 2 | #error This file should not be compiled with GPU support enabled 3 | #endif 4 | #include "vl_nnbnorm.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/vl_nnconv.cpp: -------------------------------------------------------------------------------- 1 | #if ENABLE_GPU 2 | #error This file should not be compiled with GPU support enabled 3 | #endif 4 | #include "vl_nnconv.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/vl_nnconvt.cpp: -------------------------------------------------------------------------------- 1 | #if ENABLE_GPU 2 | #error This file should not be compiled with GPU support enabled 3 | #endif 4 | #include "vl_nnconvt.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/vl_nnnormalize.cpp: -------------------------------------------------------------------------------- 1 | #if ENABLE_GPU 2 | #error This file should not be compiled with GPU support enabled 3 | #endif 4 | #include "vl_nnnormalize.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/vl_nnpool.cpp: -------------------------------------------------------------------------------- 1 | #if ENABLE_GPU 2 | #error This file should not be compiled with GPU support enabled 3 | #endif 4 | #include "vl_nnpool.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/vl_taccummex.cpp: -------------------------------------------------------------------------------- 1 | #if ENABLE_GPU 2 | #error This file should not be compiled with GPU support enabled 3 | #endif 4 | #include "vl_taccummex.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/src/vl_tmove.cpp: -------------------------------------------------------------------------------- 1 | #if ENABLE_GPU 2 | #error This file should not be compiled with GPU support enabled 3 | #endif 4 | #include "vl_tmove.cu" 5 | -------------------------------------------------------------------------------- /matconvnet/matlab/vl_nnconcat.m: -------------------------------------------------------------------------------- 1 | function y = vl_nnconcat(inputs, dim, dzdy, varargin) 2 | %VL_NNCONCAT CNN concatenate multiple inputs. 3 | % Y = VL_NNCONCAT(INPUTS, DIM) concatenates the inputs in the cell 4 | % array INPUTS along dimension DIM generating an output Y. 5 | % 6 | % DZDINPUTS = VL_NNCONCAT(INPUTS, DIM, DZDY) computes the derivatives 7 | % of the block projected onto DZDY. DZDINPUTS has one element for 8 | % each element of INPUTS, each of which is an array that has the same 9 | % dimensions of the corresponding array in INPUTS. 10 | 11 | % Copyright (C) 2015 Karel Lenc and Andrea Vedaldi. 12 | % All rights reserved. 13 | % 14 | % This file is part of the VLFeat library and is made available under 15 | % the terms of the BSD license (see the COPYING file). 16 | 17 | opts.inputSizes = [] ; 18 | opts = vl_argparse(opts, varargin, 'nonrecursive') ; 19 | 20 | if nargin < 2, dim = 3; end; 21 | if nargin < 3, dzdy = []; end; 22 | 23 | if isempty(dzdy) 24 | y = cat(dim, inputs{:}); 25 | else 26 | if isempty(opts.inputSizes) 27 | opts.inputSizes = cellfun(@(inp) [size(inp,1),size(inp,2),size(inp,3),size(inp,4)], inputs, 'UniformOutput', false) ; 28 | end 29 | start = 1 ; 30 | y = cell(1, numel(opts.inputSizes)) ; 31 | s.type = '()' ; 32 | s.subs = {':', ':', ':', ':'} ; 33 | for i = 1:numel(opts.inputSizes) 34 | stop = start + opts.inputSizes{i}(dim) ; 35 | s.subs{dim} = start:stop-1 ; 36 | y{i} = subsref(dzdy,s) ; 37 | start = stop ; 38 | end 39 | end 40 | -------------------------------------------------------------------------------- /matconvnet/matlab/vl_nncrop.m: -------------------------------------------------------------------------------- 1 | function y = vl_nncrop(x, crop, dzdy, inputSize) 2 | %VL_NNCROP CNN crop. 3 | % Y = VL_NNCROP(X, CROP) crops the input X spatially. CROP specifies the 4 | % amount of cropping as [TOP, BOTTOM, LEFT, RIGHT]. 5 | % 6 | % DZDX = VL_NNCROP(X, CROP, DZDY) computes the derivative DZDX of the 7 | % function projected on the output derivative DZDY. DZDX has the same 8 | % dimension as X and DZDY the same dimension as Y. 9 | % 10 | % DZDX = VL_NNCROP([], CROP, DZDY, INPUTSIZE) is an alternative to 11 | % the previous call in which X is omitted and its size is passed as 12 | % INPUTSIZE. 13 | 14 | % Copyright (C) 2015 Sebastien Ehrhardt and Andrea Vedaldi. 15 | % All rights reserved. 16 | % 17 | % This file is part of the VLFeat library and is made available under 18 | % the terms of the BSD license (see the COPYING file). 19 | 20 | if nargin < 4 21 | sz = [size(x,1) size(x,2) size(x,3) size(x,4)] ; 22 | else 23 | sz = inputSize ; 24 | end 25 | 26 | sv = 1 + crop(1) : sz(1) - crop(2) ; 27 | su = 1 + crop(3) : sz(2) - crop(4) ; 28 | 29 | if nargin <= 2 || isempty(dzdy) 30 | y = x(sv, su, :, :) ; 31 | else 32 | if isa(dzdy, 'gpuArray') 33 | y = gpuArray.zeros(sz, classUnderlying(dzdy)) ; 34 | else 35 | y = zeros(sz, class(dzdy)) ; 36 | end 37 | y(sv, su, :, :) = dzdy ; 38 | end 39 | -------------------------------------------------------------------------------- /matconvnet/matlab/vl_nnnoffset.m: -------------------------------------------------------------------------------- 1 | function y = vl_nnnoffset(x, param, dzdy) 2 | %VL_NNNOFFSET CNN norm-dependent offset. 3 | % Y = VL_NNNOFFSET(X, PARAM) subtracts from each element of X the 4 | % weighted norm of the feature channels: 5 | % 6 | % X(i,j,k) = X(i,j,k) - PARAM(1) * L(i,j) ^ PARAM(2) 7 | % 8 | % where 9 | % 10 | % L(i,j) = sum_K X(i,j,k)^2 11 | % 12 | % DZDX = VL_NNNOFFSET(X, PARAM, DZDY) computes the derivative of the 13 | % block projected onto DZDY. DZDX and DZDY have the same dimensions 14 | % as X and Y respectively. 15 | 16 | % Copyright (C) 2014 Andrea Vedaldi. 17 | % All rights reserved. 18 | % 19 | % This file is part of the VLFeat library and is made available under 20 | % the terms of the BSD license (see the COPYING file). 21 | 22 | L = sum(x.^2,3) ; 23 | L = max(L, 1e-8) ; 24 | 25 | if nargin <= 2 26 | y = bsxfun(@minus, x, param(1)*L.^param(2)) ; 27 | else 28 | y = dzdy - bsxfun(@times, (2*param(1)*param(2))* x, sum(dzdy,3) .* (L.^(param(2)-1))) ; 29 | end 30 | -------------------------------------------------------------------------------- /matconvnet/matlab/vl_nnnormalize.m: -------------------------------------------------------------------------------- 1 | %VL_NNNORMALIZE CNN Local Response Normalization (LRN) 2 | % Y = VL_NNORMALIZE(X, PARAM) computes the so-called Local Response 3 | % Normalization (LRN) operator. This operator performs a 4 | % channel-wise sliding window normalization of each column of the 5 | % input array X. The normalized output is given by: 6 | % 7 | % Y(i,j,k) = X(i,j,k) / L(i,j,k)^BETA 8 | % 9 | % where the normalization factor is given by 10 | % 11 | % L(i,j,k) = KAPPA + ALPHA * (sum_{q in Q(k)} X(i,j,k)^2, 12 | % 13 | % PARAM = [N KAPPA ALPHA BETA], and N is the size of the window. The 14 | % window Q(k) is defined as: 15 | % 16 | % Q(k) = [max(1, k-FLOOR((N-1)/2)), min(D, k+CEIL((N-1)/2))]. 17 | % 18 | % where D is the number of feature channels in X. Note in particular 19 | % that, by setting N >= 2D, the function can be used to normalize 20 | % all the channels as a single group (useful to achieve L2 21 | % normalization). 22 | % 23 | % DZDX = VL_NNORMALIZE(X, PARAM, DZDY) computes the derivative of 24 | % the block projected onto DZDY. DZDX and DZDY have the same 25 | % dimensions as X and Y respectively. 26 | % 27 | % **Remark:** Some CNN libraries (e.g. Caffe) use a slightly 28 | % different convention for the parameters of the LRN. Caffe in 29 | % particular uses the convention: 30 | % 31 | % PARAM_CAFFE = [N KAPPA N*ALPHA BETA] 32 | % 33 | % i.e. the ALPHA paramter is multiplied by N. 34 | 35 | % Copyright (C) 2014 Andrea Vedaldi. 36 | % All rights reserved. 37 | % 38 | % This file is part of the VLFeat library and is made available under 39 | % the terms of the BSD license (see the COPYING file). 40 | -------------------------------------------------------------------------------- /matconvnet/matlab/vl_nnnormalizelp.m: -------------------------------------------------------------------------------- 1 | function y = vl_nnnormalizelp(x,dzdy,varargin) 2 | %VL_NNNORMALIZELP CNN Lp normalization 3 | % Y = VL_NNNORMALIZELP(X) normalizes in Lp norm each spatial 4 | % location in the array X: 5 | % 6 | % Y(i,j,k) = X(i,j,k) / sum_q (X(i,j,q).^p + epsilon)^(1/p) 7 | % 8 | % DZDX = VL_NNNORMALIZELP(X, DZDY) computes the derivative of the 9 | % function with respect to X projected onto DZDY. 10 | % 11 | % VL_NNNORMALIZE(___, 'opts', val, ...) takes the following options: 12 | % 13 | % `p`:: 2 14 | % The exponent of the Lp norm. Warning: currently only even 15 | % exponents are supported. 16 | % 17 | % `epsilon`:: 0.01 18 | % The constant added to the sum of p-powers before taking the 19 | % 1/p square root (see the formula above). 20 | % 21 | % `spatial`:: `false` 22 | % If `true`, sum along the two spatial dimensions instead of 23 | % along the feature channels. 24 | % 25 | % See also: VL_NNNORMALIZE(). 26 | 27 | opts.epsilon = 1e-2 ; 28 | opts.p = 2 ; 29 | opts.spatial = false ; 30 | opts = vl_argparse(opts, varargin, 'nonrecursive') ; 31 | 32 | if ~opts.spatial 33 | massp = sum(x.^opts.p,3) + opts.epsilon ; 34 | else 35 | massp = sum(sum(x.^opts.p,1),2) + opts.epsilon ; 36 | end 37 | mass = massp.^(1/opts.p) ; 38 | y = bsxfun(@rdivide, x, mass) ; 39 | 40 | if nargin < 2 || isempty(dzdy) 41 | return ; 42 | else 43 | dzdy = bsxfun(@rdivide, dzdy, mass) ; 44 | if ~opts.spatial 45 | tmp = sum(dzdy .* x, 3) ; 46 | else 47 | tmp = sum(sum(dzdy .* x, 1),2); 48 | end 49 | y = dzdy - bsxfun(@times, tmp, bsxfun(@rdivide, x.^(opts.p-1), massp)) ; 50 | end 51 | -------------------------------------------------------------------------------- /matconvnet/matlab/vl_nnrelu.m: -------------------------------------------------------------------------------- 1 | function y = vl_nnrelu(x,dzdy,varargin) 2 | %VL_NNRELU CNN rectified linear unit. 3 | % Y = VL_NNRELU(X) applies the rectified linear unit to the data 4 | % X. X can have arbitrary size. 5 | % 6 | % DZDX = VL_NNRELU(X, DZDY) computes the derivative of the block 7 | % projected onto DZDY. DZDX and DZDY have the same dimensions as 8 | % X and Y respectively. 9 | % 10 | % VL_NNRELU(...,'OPT',VALUE,...) takes the following options: 11 | % 12 | % `Leak`:: 0 13 | % Set the leak factor, a non-negative number. Y is equal to X if 14 | % X is not smaller than zero; otherwise, Y is equal to X 15 | % multipied by the leak factor. By default, the leak factor is 16 | % zero; for values greater than that one obtains the leaky ReLU 17 | % unit. 18 | % 19 | % ADVANCED USAGE 20 | % 21 | % As a further optimization, in the backward computation it is 22 | % possible to replace X with Y, namely, if Y = VL_NNRELU(X), then 23 | % VL_NNRELU(X,DZDY) gives the same result as VL_NNRELU(Y,DZDY). 24 | % This is useful because it means that the buffer X does not need to 25 | % be remembered in the backward pass. 26 | 27 | % Copyright (C) 2014-15 Andrea Vedaldi. 28 | % All rights reserved. 29 | % 30 | % This file is part of the VLFeat library and is made available under 31 | % the terms of the BSD license (see the COPYING file). 32 | 33 | opts.leak = 0 ; 34 | opts = vl_argparse(opts, varargin, 'nonrecursive') ; 35 | 36 | if opts.leak == 0 37 | if nargin <= 1 || isempty(dzdy) 38 | y = max(x, 0) ; 39 | else 40 | y = dzdy .* (x > 0) ; 41 | end 42 | else 43 | if nargin <= 1 || isempty(dzdy) 44 | y = x .* (opts.leak + (1 - opts.leak) * (x > 0)) ; 45 | else 46 | y = dzdy .* (opts.leak + (1 - opts.leak) * (x > 0)) ; 47 | end 48 | end 49 | -------------------------------------------------------------------------------- /matconvnet/matlab/vl_nnsigmoid.m: -------------------------------------------------------------------------------- 1 | function out = vl_nnsigmoid(x,dzdy) 2 | %VL_NNSIGMOID CNN sigmoid nonlinear unit. 3 | % Y = VL_NNSIGMOID(X) computes the sigmoid of the data X. X can 4 | % have an arbitrary size. The sigmoid is defined as follows: 5 | % 6 | % SIGMOID(X) = 1 / (1 + EXP(-X)). 7 | % 8 | % DZDX = VL_NNSIGMOID(X, DZDY) computes the derivative of the 9 | % block projected onto DZDY. DZDX and DZDY have the same 10 | % dimensions as X and Y respectively. 11 | 12 | % Copyright (C) 2015 Karel Lenc. 13 | % All rights reserved. 14 | % 15 | % This file is part of the VLFeat library and is made available under 16 | % the terms of the BSD license (see the COPYING file). 17 | 18 | y = 1 ./ (1 + exp(-x)); 19 | 20 | if nargin <= 1 || isempty(dzdy) 21 | out = y ; 22 | else 23 | out = dzdy .* (y .* (1 - y)) ; 24 | end 25 | -------------------------------------------------------------------------------- /matconvnet/matlab/vl_nnsoftmax.m: -------------------------------------------------------------------------------- 1 | function Y = vl_nnsoftmax(X,dzdY) 2 | %VL_NNSOFTMAX CNN softmax. 3 | % Y = VL_NNSOFTMAX(X) applies the softmax operator the data X. X 4 | % has dimension H x W x D x N, packing N arrays of W x H 5 | % D-dimensional vectors. 6 | % 7 | % D can be thought of as the number of possible classes and the 8 | % function computes the softmax along the D dimension. Often W=H=1, 9 | % but this is not a requirement, as the operator is applied 10 | % convolutionally at all spatial locations. 11 | % 12 | % DZDX = VL_NNSOFTMAX(X, DZDY) computes the derivative of the block 13 | % projected onto DZDY. DZDX and DZDY have the same dimensions as 14 | % X and Y respectively. 15 | 16 | % Copyright (C) 2014 Andrea Vedaldi. 17 | % All rights reserved. 18 | % 19 | % This file is part of the VLFeat library and is made available under 20 | % the terms of the BSD license (see the COPYING file). 21 | 22 | E = exp(bsxfun(@minus, X, max(X,[],3))) ; 23 | L = sum(E,3) ; 24 | Y = bsxfun(@rdivide, E, L) ; 25 | 26 | if nargin <= 1, return ; end 27 | 28 | % backward 29 | Y = Y .* bsxfun(@minus, dzdY, sum(dzdY .* Y, 3)) ; 30 | -------------------------------------------------------------------------------- /matconvnet/matlab/vl_nnspnorm.m: -------------------------------------------------------------------------------- 1 | function y = vl_nnspnorm(x, param, dzdy) 2 | %VL_NNSPNORM CNN spatial normalization. 3 | % Y = VL_NNSPNORM(X, PARAM) computes the spatial normalization of 4 | % the data X with parameters PARAM = [PH PW ALPHA BETA]. Here PH and 5 | % PW define the size of the spatial neighbourhood used for 6 | % nomalization. 7 | % 8 | % For each feature channel, the function computes the sum of squares 9 | % of X inside each rectangle, N2(i,j). It then divides each element 10 | % of X as follows: 11 | % 12 | % Y(i,j) = X(i,j) / (1 + ALPHA * N2(i,j))^BETA. 13 | % 14 | % DZDX = VL_NNSPNORM(X, PARAM, DZDY) computes the derivative of the 15 | % block projected onto DZDY. DZDX and DZDY have the same dimensions 16 | % as X and Y respectively. 17 | 18 | % Copyright (C) 2015 Karel Lenc and Andrea Vedaldi. 19 | % All rights reserved. 20 | % 21 | % This file is part of the VLFeat library and is made available under 22 | % the terms of the BSD license (see the COPYING file). 23 | 24 | pad = floor((param(1:2)-1)/2) ; 25 | pad = [pad ; param(1:2)-1-pad] ; 26 | 27 | n2 = vl_nnpool(x.*x, param(1:2), 'method', 'avg', 'pad', pad) ; 28 | f = 1 + param(3) * n2 ; 29 | 30 | if nargin <= 2 || isempty(dzdy) 31 | y = f.^(-param(4)) .* x ; 32 | else 33 | t = vl_nnpool(x.*x, param(1:2), f.^(-param(4)-1) .* dzdy .* x, 'method', 'avg', 'pad', pad) ; 34 | y = f.^(-param(4)) .* dzdy - 2 * param(3)*param(4) * x .* t ; 35 | end -------------------------------------------------------------------------------- /matconvnet/matlab/vl_rootnn.m: -------------------------------------------------------------------------------- 1 | function root = vl_rootnn() 2 | %VL_ROOTNN Get the root path of the MatConvNet toolbox. 3 | % VL_ROOTNN() returns the path to the MatConvNet toolbox. 4 | 5 | % Copyright (C) 2014 Andrea Vedaldi. 6 | % All rights reserved. 7 | % 8 | % This file is part of the VLFeat library and is made available under 9 | % the terms of the BSD license (see the COPYING file). 10 | 11 | root = fileparts(fileparts(mfilename('fullpath'))) ; 12 | -------------------------------------------------------------------------------- /matconvnet/matlab/vl_setupnn.m: -------------------------------------------------------------------------------- 1 | function vl_setupnn() 2 | %VL_SETUPNN Setup the MatConvNet toolbox. 3 | % VL_SETUPNN() function adds the MatConvNet toolbox to MATLAB path. 4 | 5 | % Copyright (C) 2014-15 Andrea Vedaldi. 6 | % All rights reserved. 7 | % 8 | % This file is part of the VLFeat library and is made available under 9 | % the terms of the BSD license (see the COPYING file). 10 | 11 | root = vl_rootnn() ; 12 | addpath(fullfile(root, 'matlab')) ; 13 | addpath(fullfile(root, 'matlab', 'mex')) ; 14 | addpath(fullfile(root, 'matlab', 'simplenn')) ; 15 | addpath(fullfile(root, 'matlab', 'xtest')) ; 16 | addpath(fullfile(root, 'examples')) ; 17 | 18 | if ~exist('gather') 19 | warning('The MATLAB Parallel Toolbox does not seem to be installed. Activating compatibility functions.') ; 20 | addpath(fullfile(root, 'matlab', 'compatibility', 'parallel')) ; 21 | end 22 | 23 | if numel(dir(fullfile(root, 'matlab', 'mex', 'vl_nnconv.mex*'))) == 0 24 | warning('MatConvNet is not compiled. Consider running `vl_compilenn`.'); 25 | end 26 | -------------------------------------------------------------------------------- /matconvnet/matlab/vl_taccum.m: -------------------------------------------------------------------------------- 1 | function a = vl_taccum(alpha, a, beta, b) 2 | %VL_TACCUM Compute A = alpha A + beta B 3 | % A = VL_TACCUM(ALPHA, A, BETA, B) computes efficiently A = alpha A 4 | % + beta B. For GPU arrays, it performs its computation in place, by 5 | % modifiying A without creating an additional copy. 6 | 7 | % Copyright (C) 2016 Andrea Vedaldi. 8 | % All rights reserved. 9 | % 10 | % This file is part of the VLFeat library and is made available under 11 | % the terms of the BSD license (see the COPYING file). 12 | 13 | if isscalar(a) 14 | a = alpha * a + beta * b ; 15 | return ; 16 | elseif isa(a, 'gpuArray') 17 | vl_taccummex(alpha, a, beta, b, 'inplace') ; 18 | else 19 | a = vl_taccummex(alpha, a, beta, b) ; 20 | end 21 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/suite/nnbnorm.m: -------------------------------------------------------------------------------- 1 | classdef nnbnorm < nntest 2 | properties (TestParameter) 3 | rows = {2 8 13} 4 | cols = {2 8 17} 5 | numDims = {1 3 4} 6 | batchSize = {2 7} 7 | end 8 | methods (Test) 9 | function basic(test, rows, cols, numDims, batchSize) 10 | r = rows ; 11 | c = cols ; 12 | nd = numDims ; 13 | bs = batchSize ; 14 | x = test.randn(r, c, nd, bs) ; 15 | %g = test.randn(1, 1, nd, 1) ; 16 | %b = test.randn(1, 1, nd, 1) ; 17 | g = test.randn(nd, 1) / test.range ; 18 | b = test.randn(nd, 1) / test.range ; 19 | 20 | y = vl_nnbnorm(x,g,b) ; 21 | dzdy = test.randn(size(y)) ; 22 | [dzdx,dzdg,dzdb] = vl_nnbnorm(x,g,b,dzdy) ; 23 | 24 | test.der(@(x) vl_nnbnorm(x,g,b), x, dzdy, dzdx, test.range * 1e-3) ; 25 | test.der(@(g) vl_nnbnorm(x,g,b), g, dzdy, dzdg, 1e-2) ; 26 | test.der(@(b) vl_nnbnorm(x,g,b), b, dzdy, dzdb, 1e-3) ; 27 | end 28 | end 29 | end -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/suite/nndropout.m: -------------------------------------------------------------------------------- 1 | classdef nndropout < nntest 2 | methods (Test) 3 | function basic(test) 4 | x = test.randn(4,5,10,3) ; 5 | [y,mask] = vl_nndropout(x) ; 6 | dzdy = test.randn(size(y)) ; 7 | dzdx = vl_nndropout(x,dzdy,'mask',mask) ; 8 | test.der(@(x) vl_nndropout(x,'mask',mask), x, dzdy, dzdx, 1e-3*test.range) ; 9 | end 10 | end 11 | end 12 | 13 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/suite/nnmnist.m: -------------------------------------------------------------------------------- 1 | classdef nnmnist < nntest 2 | properties (TestParameter) 3 | networkType = {'dagnn', 'simplenn'} 4 | end 5 | 6 | methods (TestClassSetup) 7 | function init(test) 8 | addpath(fullfile(vl_rootnn, 'examples', 'mnist')); 9 | end 10 | end 11 | 12 | methods (Test) 13 | function valErrorRate(test, networkType) 14 | clear mex ; % will reset GPU, remove MCN to avoid crashing 15 | % MATLAB on exit (BLAS issues?) 16 | if strcmp(test.dataType, 'double'), return ; end 17 | switch test.currentDevice 18 | case 'cpu' 19 | gpus = []; 20 | case 'gpu' 21 | gpus = 1; 22 | end 23 | trainOpts = struct('numEpochs', 1, 'continue', false, 'gpus', gpus, ... 24 | 'plotStatistics', false); 25 | if strcmp(networkType, 'simplenn') 26 | trainOpts.errorLabels = {'error', 'top5err'} ; 27 | end 28 | [~, info] = cnn_mnist('train', trainOpts, 'networkType', networkType); 29 | test.verifyLessThan(info.train.error, 0.08); 30 | test.verifyLessThan(info.val.error, 0.025); 31 | end 32 | end 33 | end 34 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/suite/nnnormalize.m: -------------------------------------------------------------------------------- 1 | classdef nnnormalize < nntest 2 | properties (TestParameter) 3 | group = {2 3 4 5 6 8 9 10 11 12 13 14 15 16 17} 4 | sgroup = {2 3 4 5 6 7} 5 | end 6 | 7 | methods (Test) 8 | function basic(test, group) 9 | param = [group, .1, .5, .75] ; 10 | x = test.randn(3,2,10,4) ; 11 | y = vl_nnnormalize(x,param) ; 12 | dzdy = test.rand(size(y))-0.5 ; 13 | dzdx = vl_nnnormalize(x,param,dzdy) ; 14 | test.der(@(x) vl_nnnormalize(x,param), x, dzdy, dzdx, test.range * 1e-3, 0.3) ; 15 | end 16 | 17 | function compare_to_naive(test, sgroup) 18 | param = [sgroup, .1, .5, .75] ; 19 | x = test.randn(3,2,10,4) ; 20 | y = vl_nnnormalize(gather(x),param) ; 21 | y_ = test.zeros(size(y)) ; 22 | x_ = gather(x) ; 23 | for i=1:size(x,1) 24 | for j=1:size(x,2) 25 | for n=1:size(x,4) 26 | t = test.zeros(1,1,size(x,3),1) ; 27 | t(1,1,:,1) = (param(2) + param(3)*conv(squeeze(x_(i,j,:,n)).^2, ... 28 | ones(param(1),1), 'same')).^(-param(4)) ; 29 | y_(i,j,:,n) = x_(i,j,:,n) .* t ; 30 | end 31 | end 32 | end 33 | test.eq(y,y_) ; 34 | end 35 | 36 | function l2(test) 37 | x = test.randn(1,1,10,1) ; 38 | y = vl_nnnormalize(x, [20, 0, 1, .5]) ; 39 | test.eq(sum(y(:).^2), test.toDataType(1), 1e-2) ; 40 | end 41 | end 42 | end 43 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/suite/nnnormalizelp.m: -------------------------------------------------------------------------------- 1 | classdef nnnormalizelp < nntest 2 | properties (TestParameter) 3 | h = {1 2 3 4} 4 | w = {1 2 3 4} 5 | d = {2 3 4} 6 | p = {2 4} 7 | end 8 | 9 | methods (Test) 10 | function basicl2(test, h,w,d) 11 | x = test.randn(h,w,d,3) ; 12 | y = vl_nnnormalizelp(x) ; 13 | dzdy = test.rand(size(y))-0.5 ; 14 | dzdx = vl_nnnormalizelp(x,dzdy) ; 15 | test.der(@(x) vl_nnnormalizelp(x), x, dzdy, dzdx, 1e-4, 0.3) ; 16 | end 17 | 18 | function lp(test, p) 19 | x = test.randn(2,3,5,3) / test.range ; 20 | y = vl_nnnormalizelp(x, [], 'p', p) ; 21 | dzdy = test.rand(size(y))-0.5 ; 22 | dzdx = vl_nnnormalizelp(x,dzdy, 'p', p) ; 23 | test.der(@(x) vl_nnnormalizelp(x,[],'p',p), x, dzdy, dzdx, 1e-4, 0.3) ; 24 | end 25 | 26 | end 27 | end 28 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/suite/nnoffset.m: -------------------------------------------------------------------------------- 1 | classdef nnoffset < nntest 2 | methods (Test) 3 | function basic(test) 4 | param = [.34, .5] ; 5 | x = test.randn(4,5,10,3) ; 6 | y = vl_nnnoffset(x,param) ; 7 | dzdy = test.randn(size(y)) ; 8 | dzdx = vl_nnnoffset(x,param,dzdy) ; 9 | test.der(@(x) vl_nnnoffset(x,param), x, dzdy, dzdx, 1e-3*test.range) ; 10 | end 11 | end 12 | end -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/suite/nnpdist.m: -------------------------------------------------------------------------------- 1 | classdef nnpdist < nntest 2 | properties (TestParameter) 3 | oneToOne = {false, true} 4 | noRoot = {false, true} 5 | p = {.5 1 2 3} 6 | aggregate = {false, true} 7 | end 8 | methods (Test) 9 | function basic(test,oneToOne, noRoot, p, aggregate) 10 | if aggregate 11 | % make it smaller to avoid numerical derivative issues with 12 | % float 13 | h = 3 ; 14 | w = 2 ; 15 | else 16 | h = 13 ; 17 | w = 17 ; 18 | end 19 | d = 4 ; 20 | n = 5 ; 21 | x = test.randn(h,w,d,n) ; 22 | if oneToOne 23 | x0 = test.randn(h,w,d,n) ; 24 | else 25 | x0 = test.randn(1,1,d,n) ; 26 | end 27 | opts = {'noRoot', noRoot, 'aggregate', aggregate} ; 28 | 29 | y = vl_nnpdist(x, x0, p, opts{:}) ; 30 | 31 | % make sure they are not too close in any dimension as this may be a 32 | % problem for the finite difference dereivatives as one could 33 | % approach 0 which is not differentiable for some p-norms 34 | 35 | s = abs(bsxfun(@minus, x, x0)) < test.range*1e-1 ; 36 | x(s) = x(s) + 5*test.range ; 37 | 38 | dzdy = test.rand(size(y)) ; 39 | [dzdx, dzdx0] = vl_nnpdist(x,x0,p,dzdy,opts{:}) ; 40 | test.der(@(x) vl_nnpdist(x,x0,p,opts{:}), x, dzdy, dzdx, test.range * 1e-3) ; 41 | if oneToOne 42 | % Pdist does not implement backprop of the bsxfun 43 | test.der(@(x0) vl_nnpdist(x,x0,p,opts{:}), x0, dzdy, dzdx0, test.range * 1e-3) ; 44 | end 45 | end 46 | end 47 | end 48 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/suite/nnrelu.m: -------------------------------------------------------------------------------- 1 | classdef nnrelu < nntest 2 | properties 3 | x 4 | end 5 | 6 | methods (TestClassSetup) 7 | function data(test,device) 8 | % make sure that all elements in x are different. in this way, 9 | % we can compute numerical derivatives reliably by adding a delta < .5. 10 | x = test.randn(15,14,3,2) ; 11 | x(:) = randperm(numel(x))' ; 12 | % avoid non-diff value for test 13 | x(x==0)=1 ; 14 | test.x = x ; 15 | test.range = 10 ; 16 | if strcmp(device,'gpu'), test.x = gpuArray(test.x) ; end 17 | end 18 | end 19 | 20 | methods (Test) 21 | function basic(test) 22 | x = test.x ; 23 | y = vl_nnrelu(x) ; 24 | dzdy = test.randn(size(y)) ; 25 | dzdx = vl_nnrelu(x,dzdy) ; 26 | test.der(@(x) vl_nnrelu(x), x, dzdy, dzdx, 1e-2 * test.range) ; 27 | end 28 | end 29 | end 30 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/suite/nnsigmoid.m: -------------------------------------------------------------------------------- 1 | classdef nnsigmoid < nntest 2 | methods (Test) 3 | function basic(test) 4 | x = test.randn(5,5,1,1)/test.range ; 5 | y = vl_nnsigmoid(x) ; 6 | dzdy = test.randn(size(y)) ; 7 | dzdx = vl_nnsigmoid(x,dzdy) ; 8 | test.der(@(x) vl_nnsigmoid(x), x, dzdy, dzdx, 1e-3) ; 9 | end 10 | end 11 | end 12 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/suite/nnsoftmax.m: -------------------------------------------------------------------------------- 1 | classdef nnsoftmax < nntest 2 | properties (TestParameter) 3 | h = {1 2 3} 4 | w = {1 2} 5 | end 6 | methods (Test) 7 | function basic(test,h,w) 8 | d = 10 ; 9 | n = 3 ; 10 | x = test.randn(h,w,d,n)/test.range ; 11 | y = vl_nnsoftmax(x) ; 12 | dzdy = test.randn(size(y)) ; 13 | dzdx = vl_nnsoftmax(x, dzdy) ; 14 | test.der(@(x) vl_nnsoftmax(x), x, dzdy, dzdx, 1e-2) ; 15 | end 16 | end 17 | end 18 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/suite/nnsoftmaxloss.m: -------------------------------------------------------------------------------- 1 | classdef nnsoftmaxloss < nntest 2 | properties (TestParameter) 3 | weighed = {false true} 4 | multilab = {false true} 5 | end 6 | 7 | methods (Test) 8 | function basic(test, multilab, weighed) 9 | C = 10 ; 10 | n = 3 ; 11 | if multilab 12 | c = reshape(mod(0:3*4*n-1,C)+1, 3, 4, 1, n) ; 13 | else 14 | c = reshape([7 2 1],1,1,1,[]) ; 15 | end 16 | if weighed 17 | c = cat(3, c, test.rand(size(c))) ; 18 | end 19 | 20 | % compare direct and indirect composition; this cannot 21 | % take large test.ranges 22 | x = test.rand(3,4,C,n)/test.range + 0.001 ; % non-negative 23 | y = vl_nnsoftmaxloss(x,c) ; 24 | if size(c,3) == 1 25 | opts = {'loss','log'} ; 26 | else 27 | opts = {'loss','log','instanceWeights',c(:,:,2,:)} ; 28 | end 29 | y_ = vl_nnloss(vl_nnsoftmax(x),c(:,:,1,:),[],opts{:}) ; 30 | dzdy = test.randn(size(y)) ; 31 | dzdx = vl_nnsoftmaxloss(x,c,dzdy) ; 32 | dzdx_ = vl_nnsoftmax(x,vl_nnloss(vl_nnsoftmax(x),c(:,:,1,:),dzdy,opts{:})) ; 33 | test.eq(y,y_) ; 34 | test.eq(dzdx,dzdx_) ; 35 | test.der(@(x) vl_nnsoftmaxloss(x,c), x, dzdy, dzdx, 0.001, -5e1) ; 36 | 37 | % now larger input range 38 | x = test.rand(3,4,C,n) + test.range * 0.001 ; % non-negative 39 | y = vl_nnsoftmaxloss(x,c) ; 40 | dzdy = test.randn(size(y)) ; 41 | dzdx = vl_nnsoftmaxloss(x,c,dzdy) ; 42 | test.der(@(x) vl_nnsoftmaxloss(x,c), ... 43 | x, dzdy, dzdx, test.range * 0.001, -5e1) ; 44 | end 45 | end 46 | end 47 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/suite/nnspnorm.m: -------------------------------------------------------------------------------- 1 | classdef nnspnorm < nntest 2 | methods (Test) 3 | function basic(test) 4 | h = 13 ; 5 | w = 17 ; 6 | d = 4 ; 7 | n = 5 ; 8 | param = [3, 3, 0.1, 0.75] ; 9 | x = test.randn(h,w,d,n) ; 10 | y = vl_nnspnorm(x, param) ; 11 | dzdy = test.rand(h, w, d, n) ; 12 | dzdx = vl_nnspnorm(x, param, dzdy) ; 13 | test.der(@(x) vl_nnspnorm(x,param), x, dzdy, dzdx, test.range * 1e-3) ; 14 | end 15 | end 16 | end 17 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/vl_bench_bnorm.m: -------------------------------------------------------------------------------- 1 | function vl_bench_bnorm(gpu) 2 | if nargin < 1 3 | gpu = false ; 4 | end 5 | 6 | T = 100 ; 7 | x = randn(64,64,32,32,'single') ; 8 | g = randn(32,1,'single') ; 9 | b = randn(32,1,'single') ; 10 | 11 | if gpu 12 | x = gpuArray(x) ; 13 | g = gpuArray(g) ; 14 | b = gpuArray(b) ; 15 | end 16 | 17 | tic 18 | for t=1:T 19 | y = vl_nnbnorm(x,g,b) ; 20 | end 21 | if gpu, wait(gpuDevice) ; end 22 | fprintf('new: %f\n',toc); 23 | 24 | tic 25 | for t=1:T 26 | y_ = vl_nnbnorm_old(x,g,b) ; 27 | end 28 | if gpu, wait(gpuDevice) ; end 29 | fprintf('old: %f\n',toc); 30 | 31 | dzdy = randn(size(y),'single') ; 32 | if gpu 33 | dzdy = gpuArray(dzdy) ; 34 | end 35 | 36 | tic 37 | for t=1:T 38 | [a,b,c] = vl_nnbnorm(x,g,b,dzdy) ; 39 | end 40 | if gpu, wait(gpuDevice) ; end 41 | fprintf('new deriv: %f\n',toc); 42 | 43 | tic 44 | for t=1:T 45 | [a_,b_,c_] = vl_nnbnorm_old(x,g,b,dzdy) ; 46 | end 47 | if gpu, wait(gpuDevice) ; end 48 | fprintf('old deriv: %f\n',toc); 49 | 50 | vl_testsim(y,y_); 51 | vl_testsim(a,a_); 52 | vl_testsim(b,b_); 53 | vl_testsim(c,c_); 54 | end 55 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/vl_test_bnorm.m: -------------------------------------------------------------------------------- 1 | %% 2 | % Test function to compare nn_bnorm and its GPU/CPU implementation with 3 | % using VLFEAT 4 | %% 5 | 6 | gpu = false; 7 | gpu = true ; 8 | 9 | T = 1 ; 10 | x = randn(64,64,32,32,'single') ; 11 | g = randn(32,1,'single') ; 12 | b = randn(32,1,'single') ; 13 | 14 | if gpu 15 | x = gpuArray(x) ; 16 | g = gpuArray(g) ; 17 | b = gpuArray(b) ; 18 | end 19 | 20 | a=vl_nnbnorm(x,g,b); 21 | a_=vl_nnbnorm_old(x,g,b); 22 | 23 | vl_testsim(a,a_) 24 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/vl_test_economic_relu.m: -------------------------------------------------------------------------------- 1 | % VL_TEST_ECONOMIC_RELU 2 | function vl_test_economic_relu() 3 | 4 | x = randn(11,12,8,'single'); 5 | w = randn(5,6,8,9,'single'); 6 | b = randn(1,9,'single') ; 7 | 8 | net.layers{1} = struct('type', 'conv', ... 9 | 'filters', w, ... 10 | 'biases', b, ... 11 | 'stride', 1, ... 12 | 'pad', 0); 13 | net.layers{2} = struct('type', 'relu') ; 14 | 15 | res = vl_simplenn(net, x) ; 16 | dzdy = randn(size(res(end).x), 'like', res(end).x) ; 17 | clear res ; 18 | 19 | res_ = vl_simplenn(net, x, dzdy) ; 20 | res__ = vl_simplenn(net, x, dzdy, [], 'conserveMemory', true) ; 21 | 22 | a=whos('res_') ; 23 | b=whos('res__') ; 24 | assert(a.bytes > b.bytes) ; 25 | vl_testsim(res_(1).dzdx,res__(1).dzdx,1e-4) ; 26 | vl_testsim(res_(1).dzdw{1},res__(1).dzdw{1},1e-4) ; 27 | vl_testsim(res_(1).dzdw{2},res__(1).dzdw{2},1e-4) ; 28 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/vl_test_gpureset.m: -------------------------------------------------------------------------------- 1 | for explictMexReset = [false] 2 | 3 | % reset the same GPU device 4 | for t = 1:6 5 | if explictMexReset, clear mex ; end 6 | if mod(t-1,2) == 0 7 | disp('vl_test_gpureset: resetting GPU') ; 8 | gpuDevice(1) ; 9 | else 10 | disp('vl_test_gpureset: not resetting GPU') ; 11 | end 12 | if t > 1, disp(a) ; end 13 | a = gpuArray(single(ones(10))) ; 14 | b = gpuArray(single(ones(5))) ; 15 | c = vl_nnconv(a,b,[],'nocudnn') ; 16 | end 17 | 18 | % resetting GPU arguments to a MEX file should fail properly 19 | a = gpuArray(single(ones(10))) ; 20 | b = gpuArray(single(ones(5))) ; 21 | c = vl_nnconv(a,b,[],'nocudnn') ; 22 | 23 | gpuDevice(1) ; 24 | disp(a) ; 25 | try 26 | c = vl_nnconv(a,b,[],'nocudnn') ; 27 | catch e 28 | assert(strcmp('parallel:gpu:array:InvalidData', e.identifier)) ; 29 | end 30 | 31 | % switch GPU devices 32 | if gpuDeviceCount > 1 33 | disp('vl_text_gpureset: test switching GPU device') ; 34 | for t = 1:gpuDeviceCount 35 | if explictMexReset, clear mex ; end 36 | fprintf('vl_test_gpureset: switching to gpu %d\n', t) ; 37 | gpuDevice(t) ; 38 | a = gpuArray(single(ones(10))) ; 39 | b = gpuArray(single(ones(5))) ; 40 | c = vl_nnconv(a,b,[],'nocudnn') ; 41 | end 42 | end 43 | end 44 | -------------------------------------------------------------------------------- /matconvnet/matlab/xtest/vl_test_imreadjpeg.m: -------------------------------------------------------------------------------- 1 | function vl_test_imreadjpeg 2 | % VL_TEST_IMREADJPEG 3 | 4 | % Test basic file reading capability 5 | for t=1:6 6 | files{t} = which(sprintf('office_%d.jpg', t)) ; 7 | end 8 | ims = vl_imreadjpeg(files) ; 9 | 10 | % Test inserting a non-image file 11 | files_ = files ; 12 | files_{3} = [mfilename('fullpath') '.m']; 13 | ims_ = vl_imreadjpeg(files_) ; 14 | for t=setdiff(1:6,3) 15 | assert(isequal(ims{t},ims_{t})) ; 16 | end 17 | 18 | % Test inserting a non-esiting file 19 | files__ = files_ ; 20 | files__{4} = 'idontexist.jpg' ; 21 | ims__ = vl_imreadjpeg(files__) ; 22 | for t=setdiff(1:6,[3 4]) 23 | assert(isequal(ims{t},ims__{t})) ; 24 | end 25 | 26 | for n = 1:4 27 | % Test prefetching 28 | vl_imreadjpeg(files,'prefetch', 'numThreads', n) ; 29 | ims___ = vl_imreadjpeg(files) ; 30 | assert(isequal(ims,ims___)) ; 31 | 32 | % Hardening: test prefetching, clearing mex, fetching 33 | vl_imreadjpeg(files,'prefetch') ; 34 | clear mex ; 35 | ims___ = vl_imreadjpeg(files, 'numThreads', n) ; 36 | assert(isequal(ims,ims___)) ; 37 | end 38 | -------------------------------------------------------------------------------- /models/net_rl.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/models/net_rl.mat -------------------------------------------------------------------------------- /test/split_dagNN.m: -------------------------------------------------------------------------------- 1 | function [my_net, my_net_conv, my_net_fc] = split_dagNN(my_net) 2 | % SPLIT_DAGNN split network into `conv part' and 'fc part' 3 | % 4 | % Sangdoo Yun, 2017. 5 | 6 | my_net.move('cpu'); 7 | my_net_fc = copy(my_net); 8 | my_net_conv = copy(my_net); 9 | 10 | layer_names = {}; 11 | for ii = 1 : 10 12 | layer_names{ii} = my_net_fc.layers(ii).name; 13 | end 14 | my_net_fc.removeLayer(layer_names); 15 | my_net_fc.rebuild(); 16 | 17 | layer_names = {}; 18 | for ii = 11 : numel(my_net.layers) 19 | layer_names{ii-10} = my_net_conv.layers(ii).name; 20 | end 21 | my_net_conv.removeLayer(layer_names); 22 | my_net_conv.rebuild(); 23 | 24 | my_net.move('gpu'); 25 | 26 | my_net_fc.rebuild(); 27 | 28 | -------------------------------------------------------------------------------- /train/split_dagNN.m: -------------------------------------------------------------------------------- 1 | function [net, net_conv, net_fc] = split_dagNN(net) 2 | % SPLIT_DAGNN 3 | % 4 | % Sangdoo Yun, 2017. 5 | 6 | net.move('cpu'); 7 | net_fc = copy(net); 8 | net_conv = copy(net); 9 | 10 | layer_names = {}; 11 | for ii = 1 : 10 12 | layer_names{ii} = net_fc.layers(ii).name; 13 | end 14 | net_fc.removeLayer(layer_names); 15 | net_fc.rebuild(); 16 | 17 | layer_names = {}; 18 | for ii = 11 : numel(net.layers) 19 | layer_names{ii-10} = net_conv.layers(ii).name; 20 | end 21 | net_conv.removeLayer(layer_names); 22 | net_conv.rebuild(); 23 | 24 | net.move('gpu'); 25 | 26 | net_fc.rebuild(); 27 | 28 | -------------------------------------------------------------------------------- /utils/cropRectanglesMex.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/utils/cropRectanglesMex.mexa64 -------------------------------------------------------------------------------- /utils/cropRectanglesMex.mexw64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/utils/cropRectanglesMex.mexw64 -------------------------------------------------------------------------------- /utils/cropRectanglesMex/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Anton Osokin 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /utils/cropRectanglesMex/build_cropRectanglesMex.m: -------------------------------------------------------------------------------- 1 | function build_cropRectanglesMex( cudaRoot ) 2 | %build_cropRectanglesMex builds package cropRectanglesMex 3 | % 4 | % INPUT: 5 | % cudaRoot - path to the CUDA installation 6 | 7 | % Anton Osokin, firstname.lastname@gmail.com, May 2015 8 | 9 | if ~exist('cudaRoot', 'var') 10 | if ispc 11 | cudaRoot = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v8.0'; 12 | nvccPath = fullfile(cudaRoot, 'bin', 'nvcc.exe'); 13 | else 14 | cudaRoot = '/usr/local/cuda-8.0' ; 15 | nvccPath = fullfile(cudaRoot, 'bin', 'nvcc'); 16 | end 17 | end 18 | 19 | if ~exist(nvccPath, 'file') 20 | error('NVCC compiler was not found!'); 21 | end 22 | 23 | root = fileparts( mfilename('fullpath') ); 24 | 25 | % compiling 26 | compileCmd = [ '"', nvccPath, '"', ... 27 | ' -c ', fullfile(root,'cropRectanglesMex.cu'), ... 28 | ' -I"', fullfile( matlabroot, 'extern', 'include'), '"', ... 29 | ' -I"', fullfile( matlabroot, 'toolbox', 'distcomp', 'gpu', 'extern', 'include'), '"', ... 30 | ' -I"', fullfile( cudaRoot, 'include'), '"', ... 31 | ' -DNDEBUG -DENABLE_GPU', ... 32 | ' -Xcompiler', ' -fPIC', ... 33 | ' -o "', fullfile(root,'cropRectanglesMex.o'), '"']; 34 | system( compileCmd ); 35 | 36 | % linking 37 | mopts = {'-outdir', root, ... 38 | '-output', 'cropRectanglesMex', ... 39 | ['-L', fullfile(cudaRoot, 'lib64')], ... 40 | '-lcudart', '-lnppi', '-lnppc', '-lmwgpu', ... 41 | '-largeArrayDims', ... 42 | fullfile(root,'cropRectanglesMex.o') }; 43 | mex(mopts{:}) ; 44 | 45 | delete( fullfile(root,'cropRectanglesMex.o') ); 46 | -------------------------------------------------------------------------------- /utils/cropRectanglesMex/build_cropRectanglesMex_on_windows.m: -------------------------------------------------------------------------------- 1 | function build_cropRectanglesMex_on_windows( cudaRoot ) 2 | %build_cropRectanglesMex builds package cropRectanglesMex 3 | % 4 | % INPUT: 5 | % cudaRoot - path to the CUDA installation 6 | 7 | % Anton Osokin, firstname.lastname@gmail.com, May 2015 8 | 9 | if ~exist('cudaRoot', 'var') 10 | cudaRoot = 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v7.5'; 11 | nvccPath = fullfile(cudaRoot, 'bin', 'nvcc.exe'); 12 | cudaLibPath = fullfile(cudaRoot, 'lib', 'x64'); 13 | end 14 | 15 | if ~exist(nvccPath, 'file') 16 | error('NVCC compiler was not found!'); 17 | end 18 | 19 | root = fileparts( mfilename('fullpath') ); 20 | 21 | % compiling 22 | compileCmd = [ '"', nvccPath, '"', ... 23 | ' -c ', '"', fullfile(root,'cropRectanglesMex.cu'), '"', ... 24 | ' -I"', fullfile( matlabroot, 'extern', 'include'), '"', ... 25 | ' -I"', fullfile( matlabroot, 'toolbox', 'distcomp', 'gpu', 'extern', 'include'), '"', ... 26 | ' -I"', fullfile( cudaRoot, 'include'), '"', ... 27 | ' -DNDEBUG -DENABLE_GPU', ... 28 | ' -Xcompiler /MD', ... 29 | ' -o "', fullfile(root,'cropRectanglesMex.o'), '"']; 30 | system( compileCmd ); 31 | 32 | % linking 33 | mopts = {'-outdir', root, ... 34 | '-output', 'cropRectanglesMex', ... 35 | ['-L', cudaLibPath], ... 36 | '-lcudart', '-lnppi', '-lnppc', '-lgpu', ... 37 | '-largeArrayDims', ... 38 | fullfile(root,'cropRectanglesMex.o') }; 39 | mex(mopts{:}) ; 40 | 41 | delete( fullfile(root,'cropRectanglesMex.o') ); 42 | -------------------------------------------------------------------------------- /utils/cropRectanglesMex/cropRectanglesMex.m: -------------------------------------------------------------------------------- 1 | %cropRectanglesMex crops multiple bounding boxes from the initial image and resizes them to the standard output size. 2 | % The operation is performed on a GPU using NVIDIA Performance Primitives (NPP) library 3 | % cropRectanglesMex was created to prepare batches for training CNNs using MatConvNet (http://www.vlfeat.org/matconvnet/). 4 | % 5 | % Usage: 6 | % crops = cropRectanglesMex( im, boundingBoxes, outputSize); 7 | % 8 | % Inputs: 9 | % im - the image to crop from, should be a 3 channel image (dimension order: height, width, channels) of type single. 10 | % Normalization (e.g. [0,1] or [0, 255]) is not important. The image should be stored in RAM (not GPU). 11 | % boundingBoxes - bounding boxes to crop, double[ numBoundingBoxes x 4 ], each line corresponds to one bounding box. 12 | % The bounding box format is y1, x1, y2, x2, where the origin is in the top-left corner. 13 | % Pixels are indexed starting from 1 (e.g. [1 1 2 2] corresponds to the box containing the 4 top-left pixels of the image). 14 | % Bounding boxes can be partially outside of the image. The default value for filling such areas is 0 in all the channels. 15 | % outputSize - the target size of the resized crops, double[2 x 1]. outputSize(1) - the height, outputSize(2) - the width. 16 | % 17 | % Outputs: 18 | % crops - the cropped and resized patches, gpuArray, single[ outputSize(1), outputSize(2), numChannels = 3, numBoundingBoxes ] 19 | % 20 | % The function can be compiled using build_cropRectanglesMex.m. 21 | % example_cropRectanglesMex.m provides the example of usage. 22 | % 23 | % If you want crop tetragons and not rectangles see cropTetragonsMex.m from https://github.com/aosokin/cropTetragonsMex 24 | 25 | % Anton Osokin, firstname.lastname@gmail.com, May 2015 26 | 27 | -------------------------------------------------------------------------------- /utils/cropRectanglesMex/cropRectanglesMex.mexa64: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/utils/cropRectanglesMex/cropRectanglesMex.mexa64 -------------------------------------------------------------------------------- /utils/cropRectanglesMex/cropRectanglesMex.obj: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hellbell/ADNet/8d9104eb623ab7e0d2bcac85800edc63f169cd5a/utils/cropRectanglesMex/cropRectanglesMex.obj -------------------------------------------------------------------------------- /utils/do_action.m: -------------------------------------------------------------------------------- 1 | function [bbox_next] = do_action(bbox, opts, act, imSize) 2 | % DO_ACTION perform a given action 3 | % 4 | % Sangdoo Yun, 2017. 5 | m = opts.action_move; 6 | 7 | % action 8 | bbox(1) = bbox(1) + 0.5 * bbox(3); 9 | bbox(2) = bbox(2) + 0.5 * bbox(4); 10 | 11 | deltas = [m.x*bbox(3) m.y*bbox(4) m.w*bbox(3) m.h*bbox(4)]; 12 | deltas = max(deltas, 1); 13 | ar = bbox(3)/bbox(4); 14 | if bbox(3) > bbox(4) 15 | deltas(4) = deltas(3) / ar; 16 | else 17 | deltas(3) = deltas(4) * ar; 18 | end 19 | action_delta = m.deltas(act,:) .* deltas; 20 | bbox_next = bbox + action_delta; 21 | bbox_next(:, 1) = bbox_next(:, 1) - 0.5 * bbox_next(:, 3); 22 | bbox_next(:, 2) = bbox_next(:, 2) - 0.5 * bbox_next(:, 4); 23 | bbox_next(:, 1) = max(bbox_next(:,1), 1); 24 | bbox_next(:, 1) = min(bbox_next(:,1), imSize(2) - bbox_next(:,3)); 25 | bbox_next(:, 2) = max(bbox_next(:,2), 1); 26 | bbox_next(:, 2) = min(bbox_next(:,2), imSize(1) - bbox_next(:,4)); 27 | bbox_next(:, 3) = max(5, min(imSize(2), bbox_next(:, 3))); 28 | bbox_next(:, 4) = max(5, min(imSize(1), bbox_next(:, 4))); 29 | 30 | 31 | -------------------------------------------------------------------------------- /utils/gen_action_labels.m: -------------------------------------------------------------------------------- 1 | function [action_labels, overs] = gen_action_labels(num_actions, opts, bb_samples, gt_bbox) 2 | % GEN_ACTION_LABELS generate action labels for training the network 3 | % 4 | % Sangdoo Yun, 2017. 5 | num_samples = size(bb_samples, 1); 6 | 7 | action_labels = zeros(num_actions , num_samples); 8 | m = opts.action_move; 9 | 10 | for j = 1 : size( bb_samples, 1) 11 | bbox = bb_samples(j, :); 12 | % action 13 | bbox(1) = bbox(1) + 0.5*bbox(3); 14 | bbox(2) = bbox(2) + 0.5*bbox(4); 15 | 16 | deltas = [m.x*bbox(3) m.y*bbox(4) m.w*bbox(3) m.h*bbox(4)]; 17 | deltas = max(deltas, 1); 18 | ar = bbox(3)/bbox(4); 19 | if bbox(3) > bbox(4) 20 | deltas(4) = deltas(3) / ar; 21 | else 22 | deltas(3) = deltas(4) * ar; 23 | end 24 | deltas = repmat(deltas, [num_actions, 1]); 25 | action_deltas = m.deltas .* deltas; 26 | 27 | action_boxes = repmat(bbox, [num_actions, 1]); 28 | action_boxes = action_boxes + action_deltas; 29 | action_boxes(:, 1) = action_boxes(:, 1) - 0.5 * action_boxes(:, 3); 30 | action_boxes(:, 2) = action_boxes(:, 2) - 0.5 * action_boxes(:, 4); 31 | 32 | overs = overlap_ratio(action_boxes, gt_bbox); 33 | [max_value, max_action] = max(overs(1:end-2)); % translation overlap 34 | if overs(opts.stop_action) > opts.stopIou 35 | max_action = opts.stop_action; 36 | end 37 | if max_value == overs(opts.stop_action) 38 | [~, max_action] = max(overs(1:end)); % (trans + scale) action 39 | end 40 | action = zeros(num_actions,1); 41 | action(max_action) = 1; 42 | action_labels(:, j) = action; 43 | end -------------------------------------------------------------------------------- /utils/get_action_history_onehot.m: -------------------------------------------------------------------------------- 1 | function ah_onehot = get_action_history_onehot(action_history, opts) 2 | % GET_ACTION_HISTORY_ONEHOT returns action history as one-hot form 3 | % 4 | % Sangdoo Yun, 2017. 5 | ah_onehot = []; 6 | for i = 1 : numel(action_history) 7 | onehot = zeros(1, opts.num_actions); 8 | if action_history(i) > 0 && action_history(i) <= opts.num_actions 9 | onehot(action_history(i)) = 1; 10 | end 11 | ah_onehot = [ah_onehot, onehot]; 12 | end 13 | 14 | 15 | -------------------------------------------------------------------------------- /utils/get_benchmark_info.m: -------------------------------------------------------------------------------- 1 | function videos = get_benchmark_info(bench_name) 2 | if nargin < 1 3 | bench_name = 'otb-vot15'; 4 | end 5 | 6 | bench_path = fullfile('utils/videolist', sprintf('%s.txt', bench_name)); 7 | videos = importdata(bench_path); 8 | 9 | end -------------------------------------------------------------------------------- /utils/get_benchmark_path.m: -------------------------------------------------------------------------------- 1 | function video_path = get_benchmark_path(bench_name) 2 | 3 | switch bench_name 4 | case 'vot15' 5 | video_path = 'E:\dataset\VOT2015'; 6 | case 'vot14' 7 | video_path = 'E:\dataset\VOT2014'; 8 | case 'vot13' 9 | video_path = 'E:\dataset\VOT2013'; 10 | end 11 | -------------------------------------------------------------------------------- /utils/get_conv_feature.m: -------------------------------------------------------------------------------- 1 | function [ feat, ims ] = get_conv_feature(net, img, boxes, opts) 2 | % GET_CONV_FEATURE extract convolutional feature of image patches 3 | % 4 | % Sangdoo Yun, 2017. 5 | 6 | opts.input_size = 112; 7 | opts.crop_mode = 'wrap'; 8 | opts.crop_padding = 16; 9 | opts.batchSize_test = 128; 10 | 11 | n = size(boxes,1); 12 | ims = get_extract_regions(img, boxes, opts); 13 | nBatches = ceil(n/opts.batchSize_test); 14 | 15 | for i=1:nBatches 16 | batch = ims(:,:,:,opts.batchSize_test*(i-1)+1:min(end,opts.batchSize_test*i)); 17 | 18 | batch = gpuArray(batch); 19 | 20 | inputs = {'input', batch}; 21 | net.eval(inputs); 22 | f = net.vars(end).value; 23 | f = gather(f); 24 | 25 | if ~exist('feat','var') 26 | feat = zeros(size(f,1),size(f,2),size(f,3),n,'single'); 27 | end 28 | feat(:,:,:,opts.batchSize_test*(i-1)+1:min(end,opts.batchSize_test*i)) = f; 29 | end -------------------------------------------------------------------------------- /utils/get_extract_regions.m: -------------------------------------------------------------------------------- 1 | function ims = get_extract_regions(im, boxes, opts) 2 | % GET_EXTRACT_REGIONS extract image regions 3 | % modified from MDNET_EXTRACT_REGIONS() of MDNet 4 | % 5 | % Sangdoo Yun, 2017. 6 | 7 | if nargin < 3 8 | opts.input_size = 112; 9 | opts.crop_mode = 'wrap'; 10 | opts.crop_padding = 16; 11 | end 12 | 13 | num_boxes = size(boxes, 1); 14 | 15 | crop_mode = opts.crop_mode; 16 | crop_size = opts.input_size; 17 | crop_padding = opts.crop_padding; 18 | 19 | ims = zeros(crop_size, crop_size, 3, num_boxes, 'single'); 20 | 21 | im_ = single(im); 22 | boxes_ = boxes; 23 | centers = boxes_(:,1:2) + 0.5 * boxes_(:,3:4); 24 | wh = boxes_(:,3:4) * 1.4; 25 | boxes_ = [centers, centers] + [-0.5 * wh, +0.5 * wh]; 26 | boxes_(:,1) = max(1, boxes_(:,1)); 27 | boxes_(:,2) = max(1, boxes_(:,2)); 28 | boxes_(:,3) = min(size(im,2), boxes_(:,3)); 29 | boxes_(:,4) = min(size(im,1), boxes_(:,4)); 30 | 31 | st = 1; 32 | en = min( size(boxes_, 1) , 1000); 33 | while(1) 34 | box = double(boxes_(st:en, [2,1,4,3])); 35 | ims(:,:,:,st:en) = gather(cropRectanglesMex( im_, box, [crop_size crop_size]) - 128); 36 | if en == size(boxes_, 1) 37 | break; 38 | end 39 | st = en + 1; 40 | en = min(size(boxes_, 1), en + 1000); 41 | end 42 | -------------------------------------------------------------------------------- /utils/get_train_videos.m: -------------------------------------------------------------------------------- 1 | function train_db = get_train_videos(opts) 2 | % GET_TRAIN_VIDEOS 3 | % 4 | % Sangdoo Yun, 2017. 5 | 6 | train_db_names = opts.train_dbs; 7 | test_db_name = opts.test_db; 8 | 9 | video_names = {}; 10 | video_paths = {}; 11 | bench_names = {}; 12 | for dbidx = 1 : numel(train_db_names) 13 | bench_name = train_db_names{dbidx}; 14 | path_ = get_benchmark_path(train_db_names{dbidx}); 15 | video_names_ = get_benchmark_info(sprintf('%s-%s',train_db_names{dbidx}, test_db_name)); 16 | video_paths_ = repmat({path_}, [1, numel(video_names_)]); 17 | video_names(end+1:end+numel(video_names_)) = video_names_; 18 | video_paths(end+1:end+numel(video_paths_)) = video_paths_; 19 | bench_names(end+1:end+numel(video_paths_)) = repmat({bench_name}, [1, numel(video_names_)]); 20 | end 21 | 22 | train_db.video_names = video_names; 23 | train_db.video_paths = video_paths; 24 | train_db.bench_names = bench_names; 25 | end 26 | -------------------------------------------------------------------------------- /utils/get_video_infos.m: -------------------------------------------------------------------------------- 1 | function [video_info] = get_video_infos(bench_name, video_path, video_name) 2 | % GET_VIDEO_INFOS Get video informations (image paths and ground truths) 3 | % adopted from MDNet (Hyeonseob Nam, 2015) 4 | % 5 | % Sangdoo Yun, 2017. 6 | 7 | switch bench_name 8 | case {'vot13','vot14','vot15'} 9 | % path to VOT dataset 10 | video_info.gt = []; 11 | video_info.img_files = []; 12 | video_info.name = video_name; 13 | benchmarkSeqHome = video_path; 14 | video_info.db_name = bench_name; 15 | 16 | % img path 17 | imgDir = fullfile(benchmarkSeqHome, video_name); 18 | if(~exist(imgDir,'dir')) 19 | error('%s does not exist!!',imgDir); 20 | end 21 | img_files = dir(fullfile(imgDir,'*.jpg')); 22 | for i = 1 : numel(img_files) 23 | video_info.img_files(i).name = fullfile(video_path, video_name, img_files(i).name); 24 | end 25 | 26 | % gt path 27 | gtPath = fullfile(benchmarkSeqHome, video_name, 'groundtruth.txt'); 28 | if(~exist(gtPath,'file')) 29 | error('%s does not exist!!',gtPath); 30 | end 31 | 32 | % parse gt 33 | gt = importdata(gtPath); 34 | if size(gt,2) >= 6 35 | x = gt(:,1:2:end); 36 | y = gt(:,2:2:end); 37 | gt = [min(x,[],2), min(y,[],2), max(x,[],2) - min(x,[],2), max(y,[],2) - min(y,[],2)]; 38 | end 39 | video_info.gt = gt; 40 | 41 | video_info.nframes = min(length(video_info.img_files), size(video_info.gt,1)); 42 | video_info.img_files = video_info.img_files(1:video_info.nframes); 43 | video_info.gt = video_info.gt(1:video_info.nframes,:); 44 | end 45 | -------------------------------------------------------------------------------- /utils/init_settings.m: -------------------------------------------------------------------------------- 1 | % INIT_SETTINGS Set paths 2 | % 3 | % Sangdoo Yun, 2017. 4 | 5 | if ispc 6 | matconvnet_path = 'matconvnet\matlab\vl_setupnn'; 7 | vgg_m_path = 'models\imagenet-vgg-m-conv1-3.mat'; 8 | result_path = 'results'; 9 | model_save_path = 'models'; 10 | else 11 | matconvnet_path = './matconvnet/matlab/vl_setupnn.m'; 12 | vgg_m_path = './models/imagenet-vgg-m-conv1-3.mat'; 13 | result_path = './results'; 14 | model_save_path = './models'; 15 | end 16 | 17 | init_params; 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /utils/overlap_ratio.m: -------------------------------------------------------------------------------- 1 | function r = overlap_ratio(rect1, rect2) 2 | % OVERLAP_RATIO 3 | % Compute the overlap ratio between two rectangles 4 | % 5 | % Hyeonseob Nam, 2015 6 | % 7 | 8 | inter_area = rectint(rect1,rect2); 9 | union_area = rect1(:,3).*rect1(:,4) + rect2(:,3).*rect2(:,4) - inter_area; 10 | 11 | r = inter_area./union_area; 12 | end -------------------------------------------------------------------------------- /utils/precision_plot.m: -------------------------------------------------------------------------------- 1 | function precisions = precision_plot(positions, ground_truth, title, show) 2 | %PRECISION_PLOT 3 | % Calculates precision for a series of distance thresholds (percentage of 4 | % frames where the distance to the ground truth is within the threshold). 5 | % The results are shown in a new figure if SHOW is true. 6 | % 7 | % Accepts positions and ground truth as Nx2 matrices (for N frames), and 8 | % a title string. 9 | % 10 | % Joao F. Henriques, 2014 11 | % http://www.isr.uc.pt/~henriques/ 12 | 13 | 14 | max_threshold = 50; %used for graphs in the paper 15 | 16 | 17 | precisions = zeros(max_threshold, 1); 18 | 19 | if size(positions,1) ~= size(ground_truth,1), 20 | % fprintf('%12s - Number of ground truth frames does not match number of tracked frames.\n', title) 21 | 22 | %just ignore any extra frames, in either results or ground truth 23 | n = min(size(positions,1), size(ground_truth,1)); 24 | positions(n+1:end,:) = []; 25 | ground_truth(n+1:end,:) = []; 26 | end 27 | 28 | %calculate distances to ground truth over all frames 29 | distances = sqrt((positions(:,1) - ground_truth(:,1)).^2 + ... 30 | (positions(:,2) - ground_truth(:,2)).^2); 31 | distances(isnan(distances)) = []; 32 | 33 | %compute precisions 34 | for p = 1:max_threshold, 35 | precisions(p) = nnz(distances <= p) / numel(distances); 36 | end 37 | 38 | %plot the precisions 39 | if show == 1, 40 | % figure('Number','off', 'Name',['Precisions - ' title]) 41 | figure('Name',['Precisions - ' title]) 42 | plot(precisions, 'k-', 'LineWidth',2) 43 | xlabel('Threshold'), ylabel('Precision') 44 | end 45 | 46 | end 47 | 48 | -------------------------------------------------------------------------------- /utils/split_dagNN.m: -------------------------------------------------------------------------------- 1 | function [my_net, my_net_conv, my_net_fc] = split_dagNN(my_net) 2 | % SPLIT_DAGNN split network into `conv part' and 'fc part' 3 | % 4 | % Sangdoo Yun, 2017. 5 | 6 | my_net.move('cpu'); 7 | my_net_fc = copy(my_net); 8 | my_net_conv = copy(my_net); 9 | 10 | layer_names = {}; 11 | for ii = 1 : 10 12 | layer_names{ii} = my_net_fc.layers(ii).name; 13 | end 14 | my_net_fc.removeLayer(layer_names); 15 | my_net_fc.rebuild(); 16 | 17 | layer_names = {}; 18 | for ii = 11 : numel(my_net.layers) 19 | layer_names{ii-10} = my_net_conv.layers(ii).name; 20 | end 21 | my_net_conv.removeLayer(layer_names); 22 | my_net_conv.rebuild(); 23 | 24 | my_net.move('gpu'); 25 | 26 | my_net_fc.rebuild(); 27 | 28 | -------------------------------------------------------------------------------- /utils/videolist/vot13-otb.txt: -------------------------------------------------------------------------------- 1 | cup 2 | iceskater 3 | juice -------------------------------------------------------------------------------- /utils/videolist/vot14-otb.txt: -------------------------------------------------------------------------------- 1 | ball 2 | bicycle 3 | drunk 4 | fish1 5 | hand1 6 | polarbear 7 | sphere 8 | sunshade 9 | surfing 10 | torus 11 | tunnel -------------------------------------------------------------------------------- /utils/videolist/vot15-otb.txt: -------------------------------------------------------------------------------- 1 | bag 2 | ball1 3 | ball2 4 | birds1 5 | birds2 6 | blanket 7 | bmx 8 | book 9 | butterfly 10 | crossing 11 | dinosaur 12 | fernando 13 | fish1 14 | fish2 15 | fish3 16 | fish4 17 | glove 18 | godfather 19 | graduate 20 | gymnastics1 21 | gymnastics2 22 | gymnastics3 23 | gymnastics4 24 | hand 25 | handball1 26 | handball2 27 | helicopter 28 | iceskater1 29 | leaves 30 | marching 31 | motocross2 32 | nature 33 | octopus 34 | rabbit 35 | racing 36 | road 37 | sheep 38 | singer3 39 | soccer2 40 | soldier 41 | sphere 42 | traffic 43 | tunnel 44 | wiper 45 | --------------------------------------------------------------------------------