This code uses MatConvNet as the third-part package. The code is tested in ubuntu 14.04, and windows 10 with matlab 2014b, and cuda-7.0.

1. You may need to install cuda. Please refer https://developer.nvidia.com/cuda-toolkit for detail information.

2. Run setup.m to compile MatConvNet (You can also download the latest version of MatConvNet, and set matconvv_path in frame_config.m. All important parameters are in frame_config.m. Please see http://www.vlfeat.org/matconvnet/pretrained/ for more details)

3. Download imagenet-vgg-verydeep-16 model from http://www.vlfeat.org/matconvnet/pretrained/ to ./model/ (You are free to download any other reference models from the website. Then set model_path and model_name in frame_config.m. When using other models, please remember to change the learning rate for each layer in frame_config.m We recommend running code on re-lu layer for better performance.)

4. For experiment of learning object patterns, please run experiment_learnTemplate.m

5. For experiment of learning texture patterns, please run experiment_learnTexture.m

6. Hybrid patterns are included in the object patterns and texture patterns.

7. For experiment of learning from non-aligned images, please run experiment_learn_filters.m

Thank you for using the code.