• Vitaliy Lyudvichenko's avatar
    GSOC 2015: dnn module · 6ec22eee
    Vitaliy Lyudvichenko authored
    Author: Vitaliy Lyudvichenko
    Mentor: Anatoly Baksheev
    
    Squashed commits are:
    
    commit 2f6d743
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Sun May 31 00:05:31 2015 +0300
    
        Added dnn module with draft interface.
    
    commit cfb9cfa
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Jun 3 17:54:13 2015 +0300
    
        Added libprotobuf to CMake. Added some Caffe files.
    
    commit a6963b4
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Jun 3 22:28:12 2015 +0300
    
        Updated CMakeLists.txt to support protobuf Messages auto generation.
    
    commit 6e23d93
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Sat Jun 6 19:08:12 2015 +0300
    
        Added simple .prototxt Caffe importer.
    
    commit 77321e3
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Mon Jun 8 16:59:27 2015 +0300
    
        Added binary .caffemodel import support.
        Some changes in API.
        Caffe source files was cleared from unnecessary code.
    
    commit 24a9eff
    Merge: 77321e3 844c30e8
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Mon Jun 8 17:01:54 2015 +0300
    
        Merge branch 'master' of https://github.com/Itseez/opencv_contrib
    
    commit 62feeec
    Author: Anatoly Baksheev <no@email>
    Date:   Mon Jun 8 19:41:11 2015 +0300
    
        fixed compilation witn C++11 compiler
    
    commit 42b36fb
    Author: Anatoly Baksheev <no@email>
    Date:   Mon Jun 8 19:48:32 2015 +0300
    
        more compilation
    
    commit 10c3a13
    Author: Anatoly Baksheev <no@email>
    Date:   Mon Jun 8 20:00:37 2015 +0300
    
        umbrealla header
    
    commit eb95846
    Author: Anatoly Baksheev <no@email>
    Date:   Mon Jun 8 20:26:47 2015 +0300
    
        some warnings disabled
    
    commit 1fd9304
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Jun 9 13:58:35 2015 +0300
    
        Dnn API changes (removed NetConfiguration, added LayerRegister, improved Blob).
    
    commit cae0bd4
    Merge: 1fd9304 eb95846
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Jun 9 14:25:35 2015 +0300
    
        Merge branch 'master' of github.com:ludv1x/opencv_contrib
    
        Conflicts:
        	modules/dnn/include/opencv2/dnn.hpp
    
    commit ee837c1
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Jun 9 21:36:18 2015 +0300
    
        Updated CMakeLists.txt
    
    commit 194271d
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Sun Jun 14 22:20:01 2015 +0300
    
        Implemented allocation of DAG and it's forward pass.
        Added wrappers for basic layers.
    
    commit ed1c569
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Jun 16 19:31:15 2015 +0300
    
        [Bomb commit] Implemented 4 main layers. Changes in API. Added worked classification example from GTSRB into tests.
    
    commit 51df95d
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Jun 16 19:31:38 2015 +0300
    
        Added GSTRB test data.
    
    commit 2638433
    Merge: 51df95d 2a199bc9
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Jun 16 22:55:35 2015 +0300
    
        Merge branch 'master' of https://github.com/Itseez/opencv_contrib
    
    commit eba62d5
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Jun 18 16:58:57 2015 +0300
    
        Layers implementations divided onto separated files.
    
    commit 383715d
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Jun 18 23:55:16 2015 +0300
    
        libprotobuf is optional dependency now
    
    commit 2c501f3
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Fri Jun 19 00:01:53 2015 +0300
    
        Replace CMake WARNING onto STATUS
    
    commit 29966ee
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Fri Jun 19 16:50:25 2015 +0300
    
        added HAVE_PROTOBUF macro
    
    commit 48ab440
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Sat Jun 20 01:59:56 2015 +0300
    
        Changed default parameter
    
    commit 09ffc43
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Sat Jun 20 11:58:56 2015 +0300
    
        Fixed CMake and CPP build errors
    
    commit eef4d1d
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Mon Jun 22 23:49:54 2015 +0300
    
        Added LRN and SoftMax layers, some fixes
    
    commit 22272e8
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Jun 23 14:27:30 2015 +0300
    
        Many fixes.
    
    commit 9cddccf
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Jun 23 14:29:42 2015 +0300
    
        Added AlexNet sample. Removed big .caffemodel files from repo.
    
    commit 66fa1e1
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Jun 23 17:33:48 2015 +0300
    
        Random changes in matlab/* module was reverted
    
    commit d80c272
    Author: Anatoly Baksheev <no@email>
    Date:   Wed Jun 24 11:48:44 2015 +0300
    
        fixed stand alone link errors
    
    commit 0cd5459
    Author: Anatoly Baksheev <no@email>
    Date:   Wed Jun 24 12:25:19 2015 +0300
    
        added incdes to project so that it could be visible in some IDEs (ex. qtcreator)
    
    commit 13edaaa
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Jun 24 18:25:34 2015 +0300
    
        Added group param to convolution_layer.cpp
    
    commit 49b5e5e
    Merge: 13edaaa 0cd5459
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Jun 24 18:25:50 2015 +0300
    
        Merge branch 'master' of github.com:ludv1x/opencv_contrib
    
    commit 99b8dac
    Merge: 49b5e5e 8a05bdbc
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Jun 24 18:26:10 2015 +0300
    
        Merge branch 'master' of https://github.com/Itseez/opencv_contrib
    
    commit 0f7907d
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Jun 24 19:28:55 2015 +0300
    
        updated example
    
    commit 2717765
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Jun 24 20:02:31 2015 +0300
    
        Fixed some warnings
    
    commit d117983
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Jun 24 22:18:05 2015 +0300
    
        Deleted trailing whitespaces
    
    commit cfdf060
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Jun 25 12:16:11 2015 +0300
    
        Fixed more warnings. Updated glog_emulator.hpp:
    
    commit 761b037
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Fri Jun 26 17:57:55 2015 +0300
    
        Fixed critical bug in dnn::Dict. Fixed LRN layer implementation. Added layers test.
    
    commit 6fd67d4
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Jul 1 12:12:49 2015 +0300
    
        Updated test. Added and successfuly passed AlexNet reproducibility test. Small fixes.
    
    commit 9838234
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Jul 2 12:25:30 2015 +0300
    
        Some layer fixes. Added concat layer and avg. pooling to sucesfully run GoogLeNet.
    
        Added concat layer, implemented average pooling to run GoogLeNet.
        Fixed transpose error in FullyConnected layer (hotfix in softmax layer).
        Added GoogleNet test and updated AlexNet test (both nets now work fine).
    
    commit 6f8a73b
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Jul 2 12:31:48 2015 +0300
    
        Replaced CMake if() condition for standalone build.
    
    commit 0ebe30a
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Sat Jul 4 22:41:55 2015 +0300
    
        Blob class was significantly refactored
    
    commit d02bced
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Sun Jul 5 22:52:34 2015 +0300
    
        More refactoring over Blob.
    
        More refactoring over Blob.
        Fix warnings and eliminated zlib dependency in cnpy.h
    
    commit 85ad43d
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Mon Jul 6 14:51:10 2015 +0300
    
        Generalized Blob constructor and added vector of images support.
    
        AlexNet and GoogLeNet tests updated.
    
    commit 75e09fd
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Jul 8 19:05:36 2015 +0300
    
        Implement ambiguous blobs naming scheme like: "layerName[.OutputName]".
        Old Caffe-like blob naming scheme was deleted.
    
    commit b9e85ed
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Jul 8 19:15:51 2015 +0300
    
        fixed sign type mismatch warnings in cnpy
    
    commit 9783bba
    Merge: b9e85ed 6f8a73b
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Jul 9 18:26:08 2015 +0300
    
        Merge branch 'master' into work
    
    commit de4d800
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Sun Jul 12 23:19:07 2015 +0300
    
        Added .caffemodel files downloader for tests on post-build step.
    
    commit ec74678
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Jul 16 20:24:12 2015 +0300
    
        Added element-wise layers. Fixed downloader and ConcatLayer.
    
    commit 0362da9
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Fri Jul 17 17:24:59 2015 +0300
    
        Added array support for Dict.
    
    commit 3aa37d2
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Sat Jul 18 01:12:08 2015 +0300
    
        Array of parmaters support into caffe_importer.cpp
    
    commit 172419e
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Sun Jul 19 21:31:22 2015 +0300
    
        Added Reshape layer and altered importer to correctly handle its params.
    
    commit 71cfae4
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Mon Jul 20 23:29:42 2015 +0300
    
        Added Split and Slice layer.
    
    commit 527fa65
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Jul 21 16:10:29 2015 +0300
    
        Rewrited concat_layer.cpp in OpenCV-style. Fixed slice layer, added test for slice, split and reshape layers.
    
    commit 9b1e28e
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Jul 23 00:09:15 2015 +0300
    
        Refactored ConvolutionLayer, added Deconvolution.
    
    commit ff45c22
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Jul 23 21:19:25 2015 +0300
    
        Fixed gcc build errors.
    
    commit 6548839
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Sat Jul 25 12:24:54 2015 +0300
    
        Added testdata images. Fixed Dict copy constructor.
    
    commit db4ff21
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Sat Jul 25 22:26:29 2015 +0300
    
        Updated classification example
    
    commit 4da1046
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Jul 28 16:00:07 2015 +0300
    
        Implemented draft Torch importer
    
    commit 7d795af
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Jul 30 15:43:47 2015 +0300
    
        Fixed Torch parser
    
    commit 5e5cc96
    Merge: 6f8a73b f9d42886
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Mon Aug 3 20:18:01 2015 +0300
    
        Merge branch 'master' of https://github.com/Itseez/opencv_contrib
    
    commit dd15521
    Merge: 5e5cc96 db4ff21
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Mon Aug 3 20:18:28 2015 +0300
    
        Merge branch 'master' of github.com:ludv1x/opencv_contrib
    
    commit c1f4410
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Mon Aug 3 20:20:00 2015 +0300
    
        cnpy warns fix
    
    commit 2905c03
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Aug 4 19:16:34 2015 +0300
    
        Multiple layers support added into Torch importer.
    
        Also DictValue was refactored.
    
    commit 8df8936
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Aug 5 13:14:52 2015 +0300
    
        Added Torch blob reader and torch convolution test.
    
    commit 1c220cf
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Aug 6 13:29:45 2015 +0300
    
        Added simple tests for Torch importer, fixed some importing issues.
    
    commit 436d929
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Aug 6 14:37:56 2015 +0300
    
        Resolve reference counting problem in Torch importer.
    
    commit b2f4ba3
    Merge: c1f4410 172fdb31
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Fri Aug 7 13:27:45 2015 +0300
    
        Merge branch 'master' of https://github.com/Itseez/opencv_contrib
    
    commit 5b08053
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Mon Aug 10 12:53:44 2015 +0300
    
        Added ability to remove singleton dimensions in Reshape layer.
    
        Updated torch importer
    
    commit d0875b1
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Aug 11 01:49:27 2015 +0300
    
        Fixed average pooling error
    
    commit f8119ea
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Aug 11 22:12:48 2015 +0300
    
        Fixed Deconvolution layer. Added more wide layers test coverage.
    
    commit df5eec6
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Aug 12 16:54:44 2015 +0300
    
        Added MVN layer. Renamed layer test data.
    
    commit f28effb
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Aug 12 19:49:54 2015 +0300
    
        Cleaned caffe dependencies
    
    commit b3dcc39
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Aug 12 20:04:23 2015 +0300
    
        Moved caffe.proto
    
    commit 7d2e745
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Aug 13 00:53:50 2015 +0300
    
        Minor test changes
    
    commit c65d032
    Merge: 7d2e745 b2f4ba3
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Aug 13 01:25:00 2015 +0300
    
        Merge branch 'master' of https://github.com/ludv1x/opencv_contrib
    
    commit 160d864
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Aug 13 11:45:40 2015 +0300
    
        Fixed small warn and example error
    
    commit 06f949a
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Aug 13 17:52:46 2015 +0300
    
        Added initModule() procedure to explicitly init builtin layers
    
    commit 23d3ede
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Mon Aug 17 15:10:04 2015 +0300
    
        Added OpenCL im2col
    
    commit 7acfda2
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Aug 18 01:40:41 2015 +0300
    
        Fixed im2col_ocl bug caused non-zero UMat offset
    
    commit 9d932af
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Aug 18 01:55:05 2015 +0300
    
        Add new method to Net
    
    commit 0903d79
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Aug 19 01:28:44 2015 +0300
    
        Added libprotobuf 2.5 as thridparty library
    
    commit 4929177
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Aug 19 01:32:51 2015 +0300
    
        Add compiled caffe protobuf files
    
    commit fc9795b
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Aug 19 18:57:12 2015 +0300
    
        libprotobuf is a separate 3rdparty lib now
    
    commit 93a372f
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Aug 19 19:53:52 2015 +0300
    
        Try fix msvc error and cmake error on android
    
    commit 44e52a0
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Aug 20 01:34:05 2015 +0300
    
        Try fix msvc warnings
    
    commit 519167e
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Aug 20 18:51:44 2015 +0300
    
        Refactored cmake and disabled AlexNet test
    
    commit e644b5a
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Aug 20 21:52:41 2015 +0300
    
        Changed Blob::ptr and Blob::offset methods
    
    commit f07c564
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Aug 20 22:53:02 2015 +0300
    
        Add test data for layers
    
    commit fb66acb
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Fri Aug 21 01:59:17 2015 +0300
    
        API refactoring
    
        renamed learnedParams blobs field
        added new fields: name and type for Layer
    
    commit f8715f3
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Sat Aug 22 18:31:53 2015 +0300
    
        Added licence headers
    
    commit 945094b
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Sun Aug 23 03:06:24 2015 +0300
    
        Update doc, small changes in Blob methods
    
    commit c681508
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Mon Aug 24 01:45:32 2015 +0300
    
        Add more docs
    
    commit bd242d1
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Mon Aug 24 20:44:34 2015 +0300
    
        Add docs for remaning functions
    
    commit eced23c
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Mon Aug 24 20:44:56 2015 +0300
    
        Updated dnn example
    
    commit 57a2194
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Aug 25 15:18:21 2015 +0300
    
        Add tutorial_dnn_build
    
    commit efde664
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Aug 25 17:09:00 2015 +0300
    
        Move binary testdata from opencv_contrib to opencv_extra
    
    commit e52a7ee
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Tue Aug 25 19:01:05 2015 +0300
    
        Add bvlc_googlenet.prototxt to samples
    
    commit 3154fc0
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Aug 26 01:43:53 2015 +0300
    
        Add googlenet tutorial
    
    commit 467cd96
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Aug 26 13:32:27 2015 +0300
    
        Updated dnn build tutorial
    
    commit 83e39a9
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Wed Aug 26 19:56:36 2015 +0300
    
        Fix typos
    
    commit 0a64a9d
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Aug 27 02:30:20 2015 +0300
    
        Changed Caffe googlenet tutorial
    
    commit d2b6011
    Author: Vitaliy Lyudvichenko <ludv1x@yandex.ru>
    Date:   Thu Aug 27 14:01:40 2015 +0300
    
        Fix documentation warning
    
    commit 248577a
    Author: Anatoly Baksheev <no@email>
    Date:   Thu Sep 3 18:33:26 2015 +0300
    
        fixed signed/unsigned cast warning
    6ec22eee
caffe.proto 45.1 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157
/*M///////////////////////////////////////////////////////////////////////////////////////
//COPYRIGHT
//
//All contributions by the University of California:
//Copyright (c) 2014, The Regents of the University of California (Regents)
//All rights reserved.
//
//All other contributions:
//Copyright (c) 2014, the respective contributors
//All rights reserved.
//
//Caffe uses a shared copyright model: each contributor holds copyright over
//their contributions to Caffe. The project versioning records all such
//contribution and copyright details. If a contributor wants to further mark
//their specific copyright on a particular contribution, they should indicate
//their copyright solely in the commit message of the change when it is
//committed.
//
//LICENSE
//
//Redistribution and use in source and binary forms, with or without
//modification, are permitted provided that the following conditions are met:
//
//1. Redistributions of source code must retain the above copyright notice, this
//   list of conditions and the following disclaimer.
//2. Redistributions in binary form must reproduce the above copyright notice,
//   this list of conditions and the following disclaimer in the documentation
//   and/or other materials provided with the distribution.
//
//THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
//ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
//WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
//DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
//ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
//(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
//LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
//ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
//(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
//SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//
//CONTRIBUTION AGREEMENT
//
//By contributing to the BVLC/caffe repository through pull-request, comment,
//or otherwise, the contributor releases their content to the
//license and copyright terms herein.
//
//M*/

syntax = "proto2";

package caffe;

// Specifies the shape (dimensions) of a Blob.
message BlobShape {
  repeated int64 dim = 1 [packed = true];
}

message BlobProto {
  optional BlobShape shape = 7;
  repeated float data = 5 [packed = true];
  repeated float diff = 6 [packed = true];

  // 4D dimensions -- deprecated.  Use "shape" instead.
  optional int32 num = 1 [default = 0];
  optional int32 channels = 2 [default = 0];
  optional int32 height = 3 [default = 0];
  optional int32 width = 4 [default = 0];
}

// The BlobProtoVector is simply a way to pass multiple blobproto instances
// around.
message BlobProtoVector {
  repeated BlobProto blobs = 1;
}

message Datum {
  optional int32 channels = 1;
  optional int32 height = 2;
  optional int32 width = 3;
  // the actual image data, in bytes
  optional bytes data = 4;
  optional int32 label = 5;
  // Optionally, the datum could also hold float data.
  repeated float float_data = 6;
  // If true data contains an encoded image that need to be decoded
  optional bool encoded = 7 [default = false];
}

message FillerParameter {
  // The filler type.
  optional string type = 1 [default = 'constant'];
  optional float value = 2 [default = 0]; // the value in constant filler
  optional float min = 3 [default = 0]; // the min value in uniform filler
  optional float max = 4 [default = 1]; // the max value in uniform filler
  optional float mean = 5 [default = 0]; // the mean value in Gaussian filler
  optional float std = 6 [default = 1]; // the std value in Gaussian filler
  // The expected number of non-zero output weights for a given input in
  // Gaussian filler -- the default -1 means don't perform sparsification.
  optional int32 sparse = 7 [default = -1];
  // Normalize the filler variance by fan_in, fan_out, or their average.
  // Applies to 'xavier' and 'msra' fillers.
  enum VarianceNorm {
    FAN_IN = 0;
    FAN_OUT = 1;
    AVERAGE = 2;
  }
  optional VarianceNorm variance_norm = 8 [default = FAN_IN];
}

message NetParameter {
  optional string name = 1; // consider giving the network a name
  // The input blobs to the network.
  repeated string input = 3;
  // The shape of the input blobs.
  repeated BlobShape input_shape = 8;

  // 4D input dimensions -- deprecated.  Use "shape" instead.
  // If specified, for each input blob there should be four
  // values specifying the num, channels, height and width of the input blob.
  // Thus, there should be a total of (4 * #input) numbers.
  repeated int32 input_dim = 4;

  // Whether the network will force every layer to carry out backward operation.
  // If set False, then whether to carry out backward is determined
  // automatically according to the net structure and learning rates.
  optional bool force_backward = 5 [default = false];
  // The current "state" of the network, including the phase, level, and stage.
  // Some layers may be included/excluded depending on this state and the states
  // specified in the layers' include and exclude fields.
  optional NetState state = 6;

  // Print debugging information about results while running Net::Forward,
  // Net::Backward, and Net::Update.
  optional bool debug_info = 7 [default = false];

  // The layers that make up the net.  Each of their configurations, including
  // connectivity and behavior, is specified as a LayerParameter.
  repeated LayerParameter layer = 100;  // ID 100 so layers are printed last.

  // DEPRECATED: use 'layer' instead.
  repeated V1LayerParameter layers = 2;
}

// NOTE
// Update the next available ID when you add a new SolverParameter field.
//
// SolverParameter next available ID: 37 (last added: iter_size)
message SolverParameter {
  //////////////////////////////////////////////////////////////////////////////
  // Specifying the train and test networks
  //
  // Exactly one train net must be specified using one of the following fields:
  //     train_net_param, train_net, net_param, net
  // One or more test nets may be specified using any of the following fields:
  //     test_net_param, test_net, net_param, net
  // If more than one test net field is specified (e.g., both net and
  // test_net are specified), they will be evaluated in the field order given
  // above: (1) test_net_param, (2) test_net, (3) net_param/net.
  // A test_iter must be specified for each test_net.
  // A test_level and/or a test_stage may also be specified for each test_net.
  //////////////////////////////////////////////////////////////////////////////

  // Proto filename for the train net, possibly combined with one or more
  // test nets.
  optional string net = 24;
  // Inline train net param, possibly combined with one or more test nets.
  optional NetParameter net_param = 25;

  optional string train_net = 1; // Proto filename for the train net.
  repeated string test_net = 2; // Proto filenames for the test nets.
  optional NetParameter train_net_param = 21; // Inline train net params.
  repeated NetParameter test_net_param = 22; // Inline test net params.

  // The states for the train/test nets. Must be unspecified or
  // specified once per net.
  //
  // By default, all states will have solver = true;
  // train_state will have phase = TRAIN,
  // and all test_state's will have phase = TEST.
  // Other defaults are set according to the NetState defaults.
  optional NetState train_state = 26;
  repeated NetState test_state = 27;

  // The number of iterations for each test net.
  repeated int32 test_iter = 3;

  // The number of iterations between two testing phases.
  optional int32 test_interval = 4 [default = 0];
  optional bool test_compute_loss = 19 [default = false];
  // If true, run an initial test pass before the first iteration,
  // ensuring memory availability and printing the starting value of the loss.
  optional bool test_initialization = 32 [default = true];
  optional float base_lr = 5; // The base learning rate
  // the number of iterations between displaying info. If display = 0, no info
  // will be displayed.
  optional int32 display = 6;
  // Display the loss averaged over the last average_loss iterations
  optional int32 average_loss = 33 [default = 1];
  optional int32 max_iter = 7; // the maximum number of iterations
  // accumulate gradients over `iter_size` x `batch_size` instances
  optional int32 iter_size = 36 [default = 1];
  optional string lr_policy = 8; // The learning rate decay policy.
  optional float gamma = 9; // The parameter to compute the learning rate.
  optional float power = 10; // The parameter to compute the learning rate.
  optional float momentum = 11; // The momentum value.
  optional float weight_decay = 12; // The weight decay.
  // regularization types supported: L1 and L2
  // controlled by weight_decay
  optional string regularization_type = 29 [default = "L2"];
  // the stepsize for learning rate policy "step"
  optional int32 stepsize = 13;
  // the stepsize for learning rate policy "multistep"
  repeated int32 stepvalue = 34;

  // Set clip_gradients to >= 0 to clip parameter gradients to that L2 norm,
  // whenever their actual L2 norm is larger.
  optional float clip_gradients = 35 [default = -1];

  optional int32 snapshot = 14 [default = 0]; // The snapshot interval
  optional string snapshot_prefix = 15; // The prefix for the snapshot.
  // whether to snapshot diff in the results or not. Snapshotting diff will help
  // debugging but the final protocol buffer size will be much larger.
  optional bool snapshot_diff = 16 [default = false];
  // the mode solver will use: 0 for CPU and 1 for GPU. Use GPU in default.
  enum SolverMode {
    CPU = 0;
    GPU = 1;
  }
  optional SolverMode solver_mode = 17 [default = GPU];
  // the device_id will that be used in GPU mode. Use device_id = 0 in default.
  optional int32 device_id = 18 [default = 0];
  // If non-negative, the seed with which the Solver will initialize the Caffe
  // random number generator -- useful for reproducible results. Otherwise,
  // (and by default) initialize using a seed derived from the system clock.
  optional int64 random_seed = 20 [default = -1];

  // Solver type
  enum SolverType {
    SGD = 0;
    NESTEROV = 1;
    ADAGRAD = 2;
  }
  optional SolverType solver_type = 30 [default = SGD];
  // numerical stability for AdaGrad
  optional float delta = 31 [default = 1e-8];

  // If true, print information about the state of the net that may help with
  // debugging learning problems.
  optional bool debug_info = 23 [default = false];

  // If false, don't save a snapshot after training finishes.
  optional bool snapshot_after_train = 28 [default = true];
}

// A message that stores the solver snapshots
message SolverState {
  optional int32 iter = 1; // The current iteration
  optional string learned_net = 2; // The file that stores the learned net.
  repeated BlobProto history = 3; // The history for sgd solvers
  optional int32 current_step = 4 [default = 0]; // The current step for learning rate
}

enum Phase {
   TRAIN = 0;
   TEST = 1;
}

message NetState {
  optional Phase phase = 1 [default = TEST];
  optional int32 level = 2 [default = 0];
  repeated string stage = 3;
}

message NetStateRule {
  // Set phase to require the NetState have a particular phase (TRAIN or TEST)
  // to meet this rule.
  optional Phase phase = 1;

  // Set the minimum and/or maximum levels in which the layer should be used.
  // Leave undefined to meet the rule regardless of level.
  optional int32 min_level = 2;
  optional int32 max_level = 3;

  // Customizable sets of stages to include or exclude.
  // The net must have ALL of the specified stages and NONE of the specified
  // "not_stage"s to meet the rule.
  // (Use multiple NetStateRules to specify conjunctions of stages.)
  repeated string stage = 4;
  repeated string not_stage = 5;
}

// Specifies training parameters (multipliers on global learning constants,
// and the name and other settings used for weight sharing).
message ParamSpec {
  // The names of the parameter blobs -- useful for sharing parameters among
  // layers, but never required otherwise.  To share a parameter between two
  // layers, give it a (non-empty) name.
  optional string name = 1;

  // Whether to require shared weights to have the same shape, or just the same
  // count -- defaults to STRICT if unspecified.
  optional DimCheckMode share_mode = 2;
  enum DimCheckMode {
    // STRICT (default) requires that num, channels, height, width each match.
    STRICT = 0;
    // PERMISSIVE requires only the count (num*channels*height*width) to match.
    PERMISSIVE = 1;
  }

  // The multiplier on the global learning rate for this parameter.
  optional float lr_mult = 3 [default = 1.0];

  // The multiplier on the global weight decay for this parameter.
  optional float decay_mult = 4 [default = 1.0];
}

// NOTE
// Update the next available ID when you add a new LayerParameter field.
//
// LayerParameter next available layer-specific ID: 137 (last added: reduction_param)
message LayerParameter {
  optional string name = 1; // the layer name
  optional string type = 2; // the layer type
  repeated string bottom = 3; // the name of each bottom blob
  repeated string top = 4; // the name of each top blob

  // The train / test phase for computation.
  optional Phase phase = 10;

  // The amount of weight to assign each top blob in the objective.
  // Each layer assigns a default value, usually of either 0 or 1,
  // to each top blob.
  repeated float loss_weight = 5;

  // Specifies training parameters (multipliers on global learning constants,
  // and the name and other settings used for weight sharing).
  repeated ParamSpec param = 6;

  // The blobs containing the numeric parameters of the layer.
  repeated BlobProto blobs = 7;
  
  // Specifies on which bottoms the backpropagation should be skipped.
  // The size must be either 0 or equal to the number of bottoms.
  repeated bool propagate_down = 11;

  // Rules controlling whether and when a layer is included in the network,
  // based on the current NetState.  You may specify a non-zero number of rules
  // to include OR exclude, but not both.  If no include or exclude rules are
  // specified, the layer is always included.  If the current NetState meets
  // ANY (i.e., one or more) of the specified rules, the layer is
  // included/excluded.
  repeated NetStateRule include = 8;
  repeated NetStateRule exclude = 9;

  // Parameters for data pre-processing.
  optional TransformationParameter transform_param = 100;

  // Parameters shared by loss layers.
  optional LossParameter loss_param = 101;

  // Layer type-specific parameters.
  //
  // Note: certain layers may have more than one computational engine
  // for their implementation. These layers include an Engine type and
  // engine parameter for selecting the implementation.
  // The default for the engine is set by the ENGINE switch at compile-time.
  optional AccuracyParameter accuracy_param = 102;
  optional ArgMaxParameter argmax_param = 103;
  optional ConcatParameter concat_param = 104;
  optional ContrastiveLossParameter contrastive_loss_param = 105;
  optional ConvolutionParameter convolution_param = 106;
  optional DataParameter data_param = 107;
  optional DropoutParameter dropout_param = 108;
  optional DummyDataParameter dummy_data_param = 109;
  optional EltwiseParameter eltwise_param = 110;
  optional ExpParameter exp_param = 111;
  optional FlattenParameter flatten_param = 135;
  optional HDF5DataParameter hdf5_data_param = 112;
  optional HDF5OutputParameter hdf5_output_param = 113;
  optional HingeLossParameter hinge_loss_param = 114;
  optional ImageDataParameter image_data_param = 115;
  optional InfogainLossParameter infogain_loss_param = 116;
  optional InnerProductParameter inner_product_param = 117;
  optional LogParameter log_param = 134;
  optional LRNParameter lrn_param = 118;
  optional MemoryDataParameter memory_data_param = 119;
  optional MVNParameter mvn_param = 120;
  optional PoolingParameter pooling_param = 121;
  optional PowerParameter power_param = 122;
  optional PReLUParameter prelu_param = 131;
  optional PythonParameter python_param = 130;
  optional ReductionParameter reduction_param = 136;
  optional ReLUParameter relu_param = 123;
  optional ReshapeParameter reshape_param = 133;
  optional SigmoidParameter sigmoid_param = 124;
  optional SoftmaxParameter softmax_param = 125;
  optional SPPParameter spp_param = 132;
  optional SliceParameter slice_param = 126;
  optional TanHParameter tanh_param = 127;
  optional ThresholdParameter threshold_param = 128;
  optional WindowDataParameter window_data_param = 129;
}

// Message that stores parameters used to apply transformation
// to the data layer's data
message TransformationParameter {
  // For data pre-processing, we can do simple scaling and subtracting the
  // data mean, if provided. Note that the mean subtraction is always carried
  // out before scaling.
  optional float scale = 1 [default = 1];
  // Specify if we want to randomly mirror data.
  optional bool mirror = 2 [default = false];
  // Specify if we would like to randomly crop an image.
  optional uint32 crop_size = 3 [default = 0];
  // mean_file and mean_value cannot be specified at the same time
  optional string mean_file = 4;
  // if specified can be repeated once (would substract it from all the channels)
  // or can be repeated the same number of times as channels
  // (would subtract them from the corresponding channel)
  repeated float mean_value = 5;
  // Force the decoded image to have 3 color channels.
  optional bool force_color = 6 [default = false];
  // Force the decoded image to have 1 color channels.
  optional bool force_gray = 7 [default = false];
}

// Message that stores parameters shared by loss layers
message LossParameter {
  // If specified, ignore instances with the given label.
  optional int32 ignore_label = 1;
  // If true, normalize each batch across all instances (including spatial
  // dimesions, but not ignored instances); else, divide by batch size only.
  optional bool normalize = 2 [default = true];
}

// Messages that store parameters used by individual layer types follow, in
// alphabetical order.

message AccuracyParameter {
  // When computing accuracy, count as correct by comparing the true label to
  // the top k scoring classes.  By default, only compare to the top scoring
  // class (i.e. argmax).
  optional uint32 top_k = 1 [default = 1];

  // The "label" axis of the prediction blob, whose argmax corresponds to the
  // predicted label -- may be negative to index from the end (e.g., -1 for the
  // last axis).  For example, if axis == 1 and the predictions are
  // (N x C x H x W), the label blob is expected to contain N*H*W ground truth
  // labels with integer values in {0, 1, ..., C-1}.
  optional int32 axis = 2 [default = 1];

  // If specified, ignore instances with the given label.
  optional int32 ignore_label = 3;
}

message ArgMaxParameter {
  // If true produce pairs (argmax, maxval)
  optional bool out_max_val = 1 [default = false];
  optional uint32 top_k = 2 [default = 1];
}

message ConcatParameter {
  // The axis along which to concatenate -- may be negative to index from the
  // end (e.g., -1 for the last axis).  Other axes must have the
  // same dimension for all the bottom blobs.
  // By default, ConcatLayer concatenates blobs along the "channels" axis (1).
  optional int32 axis = 2 [default = 1];

  // DEPRECATED: alias for "axis" -- does not support negative indexing.
  optional uint32 concat_dim = 1 [default = 1];
}

message ContrastiveLossParameter {
  // margin for dissimilar pair
  optional float margin = 1 [default = 1.0];
  // The first implementation of this cost did not exactly match the cost of
  // Hadsell et al 2006 -- using (margin - d^2) instead of (margin - d)^2.
  // legacy_version = false (the default) uses (margin - d)^2 as proposed in the
  // Hadsell paper. New models should probably use this version.
  // legacy_version = true uses (margin - d^2). This is kept to support /
  // reproduce existing models and results
  optional bool legacy_version = 2 [default = false]; 
}

message ConvolutionParameter {
  optional uint32 num_output = 1; // The number of outputs for the layer
  optional bool bias_term = 2 [default = true]; // whether to have bias terms
  // Pad, kernel size, and stride are all given as a single value for equal
  // dimensions in height and width or as Y, X pairs.
  optional uint32 pad = 3 [default = 0]; // The padding size (equal in Y, X)
  optional uint32 pad_h = 9 [default = 0]; // The padding height
  optional uint32 pad_w = 10 [default = 0]; // The padding width
  optional uint32 kernel_size = 4; // The kernel size (square)
  optional uint32 kernel_h = 11; // The kernel height
  optional uint32 kernel_w = 12; // The kernel width
  optional uint32 group = 5 [default = 1]; // The group size for group conv
  optional uint32 stride = 6 [default = 1]; // The stride (equal in Y, X)
  optional uint32 stride_h = 13; // The stride height
  optional uint32 stride_w = 14; // The stride width
  optional FillerParameter weight_filler = 7; // The filler for the weight
  optional FillerParameter bias_filler = 8; // The filler for the bias
  enum Engine {
    DEFAULT = 0;
    CAFFE = 1;
    CUDNN = 2;
  }
  optional Engine engine = 15 [default = DEFAULT];
}

message DataParameter {
  enum DB {
    LEVELDB = 0;
    LMDB = 1;
  }
  // Specify the data source.
  optional string source = 1;
  // Specify the batch size.
  optional uint32 batch_size = 4;
  // The rand_skip variable is for the data layer to skip a few data points
  // to avoid all asynchronous sgd clients to start at the same point. The skip
  // point would be set as rand_skip * rand(0,1). Note that rand_skip should not
  // be larger than the number of keys in the database.
  optional uint32 rand_skip = 7 [default = 0];
  optional DB backend = 8 [default = LEVELDB];
  // DEPRECATED. See TransformationParameter. For data pre-processing, we can do
  // simple scaling and subtracting the data mean, if provided. Note that the
  // mean subtraction is always carried out before scaling.
  optional float scale = 2 [default = 1];
  optional string mean_file = 3;
  // DEPRECATED. See TransformationParameter. Specify if we would like to randomly
  // crop an image.
  optional uint32 crop_size = 5 [default = 0];
  // DEPRECATED. See TransformationParameter. Specify if we want to randomly mirror
  // data.
  optional bool mirror = 6 [default = false];
  // Force the encoded image to have 3 color channels
  optional bool force_encoded_color = 9 [default = false];
}

message DropoutParameter {
  optional float dropout_ratio = 1 [default = 0.5]; // dropout ratio
}

// DummyDataLayer fills any number of arbitrarily shaped blobs with random
// (or constant) data generated by "Fillers" (see "message FillerParameter").
message DummyDataParameter {
  // This layer produces N >= 1 top blobs.  DummyDataParameter must specify 1 or N
  // shape fields, and 0, 1 or N data_fillers.
  //
  // If 0 data_fillers are specified, ConstantFiller with a value of 0 is used.
  // If 1 data_filler is specified, it is applied to all top blobs.  If N are
  // specified, the ith is applied to the ith top blob.
  repeated FillerParameter data_filler = 1;
  repeated BlobShape shape = 6;

  // 4D dimensions -- deprecated.  Use "shape" instead.
  repeated uint32 num = 2;
  repeated uint32 channels = 3;
  repeated uint32 height = 4;
  repeated uint32 width = 5;
}

message EltwiseParameter {
  enum EltwiseOp {
    PROD = 0;
    SUM = 1;
    MAX = 2;
  }
  optional EltwiseOp operation = 1 [default = SUM]; // element-wise operation
  repeated float coeff = 2; // blob-wise coefficient for SUM operation

  // Whether to use an asymptotically slower (for >2 inputs) but stabler method
  // of computing the gradient for the PROD operation. (No effect for SUM op.)
  optional bool stable_prod_grad = 3 [default = true];
}

message ExpParameter {
  // ExpLayer computes outputs y = base ^ (shift + scale * x), for base > 0.
  // Or if base is set to the default (-1), base is set to e,
  // so y = exp(shift + scale * x).
  optional float base = 1 [default = -1.0];
  optional float scale = 2 [default = 1.0];
  optional float shift = 3 [default = 0.0];
}

/// Message that stores parameters used by FlattenLayer
message FlattenParameter {
  // The first axis to flatten: all preceding axes are retained in the output.
  // May be negative to index from the end (e.g., -1 for the last axis).
  optional int32 axis = 1 [default = 1];

  // The last axis to flatten: all following axes are retained in the output.
  // May be negative to index from the end (e.g., the default -1 for the last
  // axis).
  optional int32 end_axis = 2 [default = -1];
}

// Message that stores parameters used by HDF5DataLayer
message HDF5DataParameter {
  // Specify the data source.
  optional string source = 1;
  // Specify the batch size.
  optional uint32 batch_size = 2;

  // Specify whether to shuffle the data.
  // If shuffle == true, the ordering of the HDF5 files is shuffled,
  // and the ordering of data within any given HDF5 file is shuffled,
  // but data between different files are not interleaved; all of a file's
  // data are output (in a random order) before moving onto another file.
  optional bool shuffle = 3 [default = false];
}

message HDF5OutputParameter {
  optional string file_name = 1;
}

message HingeLossParameter {
  enum Norm {
    L1 = 1;
    L2 = 2;
  }
  // Specify the Norm to use L1 or L2
  optional Norm norm = 1 [default = L1];
}

message ImageDataParameter {
  // Specify the data source.
  optional string source = 1;
  // Specify the batch size.
  optional uint32 batch_size = 4;
  // The rand_skip variable is for the data layer to skip a few data points
  // to avoid all asynchronous sgd clients to start at the same point. The skip
  // point would be set as rand_skip * rand(0,1). Note that rand_skip should not
  // be larger than the number of keys in the database.
  optional uint32 rand_skip = 7 [default = 0];
  // Whether or not ImageLayer should shuffle the list of files at every epoch.
  optional bool shuffle = 8 [default = false];
  // It will also resize images if new_height or new_width are not zero.
  optional uint32 new_height = 9 [default = 0];
  optional uint32 new_width = 10 [default = 0];
  // Specify if the images are color or gray
  optional bool is_color = 11 [default = true];
  // DEPRECATED. See TransformationParameter. For data pre-processing, we can do
  // simple scaling and subtracting the data mean, if provided. Note that the
  // mean subtraction is always carried out before scaling.
  optional float scale = 2 [default = 1];
  optional string mean_file = 3;
  // DEPRECATED. See TransformationParameter. Specify if we would like to randomly
  // crop an image.
  optional uint32 crop_size = 5 [default = 0];
  // DEPRECATED. See TransformationParameter. Specify if we want to randomly mirror
  // data.
  optional bool mirror = 6 [default = false];
  optional string root_folder = 12 [default = ""];
}

message InfogainLossParameter {
  // Specify the infogain matrix source.
  optional string source = 1;
}

message InnerProductParameter {
  optional uint32 num_output = 1; // The number of outputs for the layer
  optional bool bias_term = 2 [default = true]; // whether to have bias terms
  optional FillerParameter weight_filler = 3; // The filler for the weight
  optional FillerParameter bias_filler = 4; // The filler for the bias

  // The first axis to be lumped into a single inner product computation;
  // all preceding axes are retained in the output.
  // May be negative to index from the end (e.g., -1 for the last axis).
  optional int32 axis = 5 [default = 1];
}

// Message that stores parameters used by LogLayer
message LogParameter {
  // LogLayer computes outputs y = log_base(shift + scale * x), for base > 0.
  // Or if base is set to the default (-1), base is set to e,
  // so y = ln(shift + scale * x) = log_e(shift + scale * x)
  optional float base = 1 [default = -1.0];
  optional float scale = 2 [default = 1.0];
  optional float shift = 3 [default = 0.0];
}

// Message that stores parameters used by LRNLayer
message LRNParameter {
  optional uint32 local_size = 1 [default = 5];
  optional float alpha = 2 [default = 1.];
  optional float beta = 3 [default = 0.75];
  enum NormRegion {
    ACROSS_CHANNELS = 0;
    WITHIN_CHANNEL = 1;
  }
  optional NormRegion norm_region = 4 [default = ACROSS_CHANNELS];
  optional float k = 5 [default = 1.];
}

message MemoryDataParameter {
  optional uint32 batch_size = 1;
  optional uint32 channels = 2;
  optional uint32 height = 3;
  optional uint32 width = 4;
}

message MVNParameter {
  // This parameter can be set to false to normalize mean only
  optional bool normalize_variance = 1 [default = true];

  // This parameter can be set to true to perform DNN-like MVN
  optional bool across_channels = 2 [default = false];

  // Epsilon for not dividing by zero while normalizing variance
  optional float eps = 3 [default = 1e-9];
}

message PoolingParameter {
  enum PoolMethod {
    MAX = 0;
    AVE = 1;
    STOCHASTIC = 2;
  }
  optional PoolMethod pool = 1 [default = MAX]; // The pooling method
  // Pad, kernel size, and stride are all given as a single value for equal
  // dimensions in height and width or as Y, X pairs.
  optional uint32 pad = 4 [default = 0]; // The padding size (equal in Y, X)
  optional uint32 pad_h = 9 [default = 0]; // The padding height
  optional uint32 pad_w = 10 [default = 0]; // The padding width
  optional uint32 kernel_size = 2; // The kernel size (square)
  optional uint32 kernel_h = 5; // The kernel height
  optional uint32 kernel_w = 6; // The kernel width
  optional uint32 stride = 3 [default = 1]; // The stride (equal in Y, X)
  optional uint32 stride_h = 7; // The stride height
  optional uint32 stride_w = 8; // The stride width
  enum Engine {
    DEFAULT = 0;
    CAFFE = 1;
    CUDNN = 2;
  }
  optional Engine engine = 11 [default = DEFAULT];
  // If global_pooling then it will pool over the size of the bottom by doing
  // kernel_h = bottom->height and kernel_w = bottom->width
  optional bool global_pooling = 12 [default = false];
}

message PowerParameter {
  // PowerLayer computes outputs y = (shift + scale * x) ^ power.
  optional float power = 1 [default = 1.0];
  optional float scale = 2 [default = 1.0];
  optional float shift = 3 [default = 0.0];
}

message PythonParameter {
  optional string module = 1;
  optional string layer = 2;
}

// Message that stores parameters used by ReductionLayer
message ReductionParameter {
  enum ReductionOp {
    SUM = 1;
    ASUM = 2;
    SUMSQ = 3;
    MEAN = 4;
  }

  optional ReductionOp operation = 1 [default = SUM]; // reduction operation

  // The first axis to reduce to a scalar -- may be negative to index from the
  // end (e.g., -1 for the last axis).
  // (Currently, only reduction along ALL "tail" axes is supported; reduction
  // of axis M through N, where N < num_axes - 1, is unsupported.)
  // Suppose we have an n-axis bottom Blob with shape:
  //     (d0, d1, d2, ..., d(m-1), dm, d(m+1), ..., d(n-1)).
  // If axis == m, the output Blob will have shape
  //     (d0, d1, d2, ..., d(m-1)),
  // and the ReductionOp operation is performed (d0 * d1 * d2 * ... * d(m-1))
  // times, each including (dm * d(m+1) * ... * d(n-1)) individual data.
  // If axis == 0 (the default), the output Blob always has the empty shape
  // (count 1), performing reduction across the entire input --
  // often useful for creating new loss functions.
  optional int32 axis = 2 [default = 0];

  optional float coeff = 3 [default = 1.0]; // coefficient for output
}

// Message that stores parameters used by ReLULayer
message ReLUParameter {
  // Allow non-zero slope for negative inputs to speed up optimization
  // Described in:
  // Maas, A. L., Hannun, A. Y., & Ng, A. Y. (2013). Rectifier nonlinearities
  // improve neural network acoustic models. In ICML Workshop on Deep Learning
  // for Audio, Speech, and Language Processing.
  optional float negative_slope = 1 [default = 0];
  enum Engine {
    DEFAULT = 0;
    CAFFE = 1;
    CUDNN = 2;
  }
  optional Engine engine = 2 [default = DEFAULT];
}

message ReshapeParameter {
  // Specify the output dimensions. If some of the dimensions are set to 0,
  // the corresponding dimension from the bottom layer is used (unchanged).
  // Exactly one dimension may be set to -1, in which case its value is
  // inferred from the count of the bottom blob and the remaining dimensions.
  // For example, suppose we want to reshape a 2D blob "input" with shape 2 x 8:
  //
  //   layer {
  //     type: "Reshape" bottom: "input" top: "output"
  //     reshape_param { ... }
  //   }
  //
  // If "input" is 2D with shape 2 x 8, then the following reshape_param
  // specifications are all equivalent, producing a 3D blob "output" with shape
  // 2 x 2 x 4:
  //
  //   reshape_param { shape { dim:  2  dim: 2  dim:  4 } }
  //   reshape_param { shape { dim:  0  dim: 2  dim:  4 } }
  //   reshape_param { shape { dim:  0  dim: 2  dim: -1 } }
  //   reshape_param { shape { dim: -1  dim: 0  dim:  2 } }
  //
  optional BlobShape shape = 1;

  // axis and num_axes control the portion of the bottom blob's shape that are
  // replaced by (included in) the reshape. By default (axis == 0 and
  // num_axes == -1), the entire bottom blob shape is included in the reshape,
  // and hence the shape field must specify the entire output shape.
  //
  // axis may be non-zero to retain some portion of the beginning of the input
  // shape (and may be negative to index from the end; e.g., -1 to begin the
  // reshape after the last axis, including nothing in the reshape,
  // -2 to include only the last axis, etc.).
  //
  // For example, suppose "input" is a 2D blob with shape 2 x 8.
  // Then the following ReshapeLayer specifications are all equivalent,
  // producing a blob "output" with shape 2 x 2 x 4:
  //
  //   reshape_param { shape { dim: 2  dim: 2  dim: 4 } }
  //   reshape_param { shape { dim: 2  dim: 4 } axis:  1 }
  //   reshape_param { shape { dim: 2  dim: 4 } axis: -3 }
  //
  // num_axes specifies the extent of the reshape.
  // If num_axes >= 0 (and axis >= 0), the reshape will be performed only on
  // input axes in the range [axis, axis+num_axes].
  // num_axes may also be -1, the default, to include all remaining axes
  // (starting from axis).
  //
  // For example, suppose "input" is a 2D blob with shape 2 x 8.
  // Then the following ReshapeLayer specifications are equivalent,
  // producing a blob "output" with shape 1 x 2 x 8.
  //
  //   reshape_param { shape { dim:  1  dim: 2  dim:  8 } }
  //   reshape_param { shape { dim:  1  dim: 2  }  num_axes: 1 }
  //   reshape_param { shape { dim:  1  }  num_axes: 0 }
  //
  // On the other hand, these would produce output blob shape 2 x 1 x 8:
  //
  //   reshape_param { shape { dim: 2  dim: 1  dim: 8  }  }
  //   reshape_param { shape { dim: 1 }  axis: 1  num_axes: 0 }
  //
  optional int32 axis = 2 [default = 0];
  optional int32 num_axes = 3 [default = -1];
}

message SigmoidParameter {
  enum Engine {
    DEFAULT = 0;
    CAFFE = 1;
    CUDNN = 2;
  }
  optional Engine engine = 1 [default = DEFAULT];
}

message SliceParameter {
  // The axis along which to slice -- may be negative to index from the end
  // (e.g., -1 for the last axis).
  // By default, SliceLayer concatenates blobs along the "channels" axis (1).
  optional int32 axis = 3 [default = 1];
  repeated uint32 slice_point = 2;

  // DEPRECATED: alias for "axis" -- does not support negative indexing.
  optional uint32 slice_dim = 1 [default = 1];
}

// Message that stores parameters used by SoftmaxLayer, SoftmaxWithLossLayer
message SoftmaxParameter {
  enum Engine {
    DEFAULT = 0;
    CAFFE = 1;
    CUDNN = 2;
  }
  optional Engine engine = 1 [default = DEFAULT];

  // The axis along which to perform the softmax -- may be negative to index
  // from the end (e.g., -1 for the last axis).
  // Any other axes will be evaluated as independent softmaxes.
  optional int32 axis = 2 [default = 1];
}

message TanHParameter {
  enum Engine {
    DEFAULT = 0;
    CAFFE = 1;
    CUDNN = 2;
  }
  optional Engine engine = 1 [default = DEFAULT];
}

message ThresholdParameter {
  optional float threshold = 1 [default = 0]; // Strictly positive values
}

message WindowDataParameter {
  // Specify the data source.
  optional string source = 1;
  // For data pre-processing, we can do simple scaling and subtracting the
  // data mean, if provided. Note that the mean subtraction is always carried
  // out before scaling.
  optional float scale = 2 [default = 1];
  optional string mean_file = 3;
  // Specify the batch size.
  optional uint32 batch_size = 4;
  // Specify if we would like to randomly crop an image.
  optional uint32 crop_size = 5 [default = 0];
  // Specify if we want to randomly mirror data.
  optional bool mirror = 6 [default = false];
  // Foreground (object) overlap threshold
  optional float fg_threshold = 7 [default = 0.5];
  // Background (non-object) overlap threshold
  optional float bg_threshold = 8 [default = 0.5];
  // Fraction of batch that should be foreground objects
  optional float fg_fraction = 9 [default = 0.25];
  // Amount of contextual padding to add around a window
  // (used only by the window_data_layer)
  optional uint32 context_pad = 10 [default = 0];
  // Mode for cropping out a detection window
  // warp: cropped window is warped to a fixed size and aspect ratio
  // square: the tightest square around the window is cropped
  optional string crop_mode = 11 [default = "warp"];
  // cache_images: will load all images in memory for faster access
  optional bool cache_images = 12 [default = false];
  // append root_folder to locate images
  optional string root_folder = 13 [default = ""];
}

message SPPParameter {
  enum PoolMethod {
    MAX = 0;
    AVE = 1;
    STOCHASTIC = 2;
  }
  optional uint32 pyramid_height = 1;
  optional PoolMethod pool = 2 [default = MAX]; // The pooling method
  enum Engine {
    DEFAULT = 0;
    CAFFE = 1;
    CUDNN = 2;
  }
  optional Engine engine = 6 [default = DEFAULT];
}

// DEPRECATED: use LayerParameter.
message V1LayerParameter {
  repeated string bottom = 2;
  repeated string top = 3;
  optional string name = 4;
  repeated NetStateRule include = 32;
  repeated NetStateRule exclude = 33;
  enum LayerType {
    NONE = 0;
    ABSVAL = 35;
    ACCURACY = 1;
    ARGMAX = 30;
    BNLL = 2;
    CONCAT = 3;
    CONTRASTIVE_LOSS = 37;
    CONVOLUTION = 4;
    DATA = 5;
    DECONVOLUTION = 39;
    DROPOUT = 6;
    DUMMY_DATA = 32;
    EUCLIDEAN_LOSS = 7;
    ELTWISE = 25;
    EXP = 38;
    FLATTEN = 8;
    HDF5_DATA = 9;
    HDF5_OUTPUT = 10;
    HINGE_LOSS = 28;
    IM2COL = 11;
    IMAGE_DATA = 12;
    INFOGAIN_LOSS = 13;
    INNER_PRODUCT = 14;
    LRN = 15;
    MEMORY_DATA = 29;
    MULTINOMIAL_LOGISTIC_LOSS = 16;
    MVN = 34;
    POOLING = 17;
    POWER = 26;
    RELU = 18;
    SIGMOID = 19;
    SIGMOID_CROSS_ENTROPY_LOSS = 27;
    SILENCE = 36;
    SOFTMAX = 20;
    SOFTMAX_LOSS = 21;
    SPLIT = 22;
    SLICE = 33;
    TANH = 23;
    WINDOW_DATA = 24;
    THRESHOLD = 31;
  }
  optional LayerType type = 5;
  repeated BlobProto blobs = 6;
  repeated string param = 1001;
  repeated DimCheckMode blob_share_mode = 1002;
  enum DimCheckMode {
    STRICT = 0;
    PERMISSIVE = 1;
  }
  repeated float blobs_lr = 7;
  repeated float weight_decay = 8;
  repeated float loss_weight = 35;
  optional AccuracyParameter accuracy_param = 27;
  optional ArgMaxParameter argmax_param = 23;
  optional ConcatParameter concat_param = 9;
  optional ContrastiveLossParameter contrastive_loss_param = 40;
  optional ConvolutionParameter convolution_param = 10;
  optional DataParameter data_param = 11;
  optional DropoutParameter dropout_param = 12;
  optional DummyDataParameter dummy_data_param = 26;
  optional EltwiseParameter eltwise_param = 24;
  optional ExpParameter exp_param = 41;
  optional HDF5DataParameter hdf5_data_param = 13;
  optional HDF5OutputParameter hdf5_output_param = 14;
  optional HingeLossParameter hinge_loss_param = 29;
  optional ImageDataParameter image_data_param = 15;
  optional InfogainLossParameter infogain_loss_param = 16;
  optional InnerProductParameter inner_product_param = 17;
  optional LRNParameter lrn_param = 18;
  optional MemoryDataParameter memory_data_param = 22;
  optional MVNParameter mvn_param = 34;
  optional PoolingParameter pooling_param = 19;
  optional PowerParameter power_param = 21;
  optional ReLUParameter relu_param = 30;
  optional SigmoidParameter sigmoid_param = 38;
  optional SoftmaxParameter softmax_param = 39;
  optional SliceParameter slice_param = 31;
  optional TanHParameter tanh_param = 37;
  optional ThresholdParameter threshold_param = 25;
  optional WindowDataParameter window_data_param = 20;
  optional TransformationParameter transform_param = 36;
  optional LossParameter loss_param = 42;
  optional V0LayerParameter layer = 1;
}

// DEPRECATED: V0LayerParameter is the old way of specifying layer parameters
// in Caffe.  We keep this message type around for legacy support.
message V0LayerParameter {
  optional string name = 1; // the layer name
  optional string type = 2; // the string to specify the layer type

  // Parameters to specify layers with inner products.
  optional uint32 num_output = 3; // The number of outputs for the layer
  optional bool biasterm = 4 [default = true]; // whether to have bias terms
  optional FillerParameter weight_filler = 5; // The filler for the weight
  optional FillerParameter bias_filler = 6; // The filler for the bias

  optional uint32 pad = 7 [default = 0]; // The padding size
  optional uint32 kernelsize = 8; // The kernel size
  optional uint32 group = 9 [default = 1]; // The group size for group conv
  optional uint32 stride = 10 [default = 1]; // The stride
  enum PoolMethod {
    MAX = 0;
    AVE = 1;
    STOCHASTIC = 2;
  }
  optional PoolMethod pool = 11 [default = MAX]; // The pooling method
  optional float dropout_ratio = 12 [default = 0.5]; // dropout ratio

  optional uint32 local_size = 13 [default = 5]; // for local response norm
  optional float alpha = 14 [default = 1.]; // for local response norm
  optional float beta = 15 [default = 0.75]; // for local response norm
  optional float k = 22 [default = 1.];

  // For data layers, specify the data source
  optional string source = 16;
  // For data pre-processing, we can do simple scaling and subtracting the
  // data mean, if provided. Note that the mean subtraction is always carried
  // out before scaling.
  optional float scale = 17 [default = 1];
  optional string meanfile = 18;
  // For data layers, specify the batch size.
  optional uint32 batchsize = 19;
  // For data layers, specify if we would like to randomly crop an image.
  optional uint32 cropsize = 20 [default = 0];
  // For data layers, specify if we want to randomly mirror data.
  optional bool mirror = 21 [default = false];

  // The blobs containing the numeric parameters of the layer
  repeated BlobProto blobs = 50;
  // The ratio that is multiplied on the global learning rate. If you want to
  // set the learning ratio for one blob, you need to set it for all blobs.
  repeated float blobs_lr = 51;
  // The weight decay that is multiplied on the global weight decay.
  repeated float weight_decay = 52;

  // The rand_skip variable is for the data layer to skip a few data points
  // to avoid all asynchronous sgd clients to start at the same point. The skip
  // point would be set as rand_skip * rand(0,1). Note that rand_skip should not
  // be larger than the number of keys in the database.
  optional uint32 rand_skip = 53 [default = 0];

  // Fields related to detection (det_*)
  // foreground (object) overlap threshold
  optional float det_fg_threshold = 54 [default = 0.5];
  // background (non-object) overlap threshold
  optional float det_bg_threshold = 55 [default = 0.5];
  // Fraction of batch that should be foreground objects
  optional float det_fg_fraction = 56 [default = 0.25];

  // optional bool OBSOLETE_can_clobber = 57 [default = true];

  // Amount of contextual padding to add around a window
  // (used only by the window_data_layer)
  optional uint32 det_context_pad = 58 [default = 0];

  // Mode for cropping out a detection window
  // warp: cropped window is warped to a fixed size and aspect ratio
  // square: the tightest square around the window is cropped
  optional string det_crop_mode = 59 [default = "warp"];

  // For ReshapeLayer, one needs to specify the new dimensions.
  optional int32 new_num = 60 [default = 0];
  optional int32 new_channels = 61 [default = 0];
  optional int32 new_height = 62 [default = 0];
  optional int32 new_width = 63 [default = 0];

  // Whether or not ImageLayer should shuffle the list of files at every epoch.
  // It will also resize images if new_height or new_width are not zero.
  optional bool shuffle_images = 64 [default = false];

  // For ConcatLayer, one needs to specify the dimension for concatenation, and
  // the other dimensions must be the same for all the bottom blobs.
  // By default it will concatenate blobs along the channels dimension.
  optional uint32 concat_dim = 65 [default = 1];

  optional HDF5OutputParameter hdf5_output_param = 1001;
}

message PReLUParameter {
  // Parametric ReLU described in K. He et al, Delving Deep into Rectifiers:
  // Surpassing Human-Level Performance on ImageNet Classification, 2015.

  // Initial value of a_i. Default is a_i=0.25 for all i.
  optional FillerParameter filler = 1;
  // Whether or not slope paramters are shared across channels.
  optional bool channel_shared = 2 [default = false];
}