tiny_dnn  1.0.0
A header only, dependency-free deep learning framework in C++11
tiny_dnn.h
1 /*
2  Copyright (c) 2013, Taiga Nomi
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without
6  modification, are permitted provided that the following conditions are met:
7  * Redistributions of source code must retain the above copyright
8  notice, this list of conditions and the following disclaimer.
9  * Redistributions in binary form must reproduce the above copyright
10  notice, this list of conditions and the following disclaimer in the
11  documentation and/or other materials provided with the distribution.
12  * Neither the name of the <organization> nor the
13  names of its contributors may be used to endorse or promote products
14  derived from this software without specific prior written permission.
15 
16  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY
17  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY
20  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */
27 #pragma once
28 
29 #include "tiny_dnn/config.h"
30 #include "tiny_dnn/network.h"
31 #include "tiny_dnn/nodes.h"
32 
33 #include "tiny_dnn/core/framework/tensor.h"
34 
35 #include "tiny_dnn/core/framework/device.h"
36 #include "tiny_dnn/core/framework/program_manager.h"
37 
38 #include "tiny_dnn/layers/input_layer.h"
39 #include "tiny_dnn/layers/feedforward_layer.h"
40 #include "tiny_dnn/layers/convolutional_layer.h"
41 #include "tiny_dnn/layers/quantized_convolutional_layer.h"
42 #include "tiny_dnn/layers/deconvolutional_layer.h"
43 #include "tiny_dnn/layers/quantized_deconvolutional_layer.h"
44 #include "tiny_dnn/layers/fully_connected_layer.h"
45 #include "tiny_dnn/layers/quantized_fully_connected_layer.h"
46 #include "tiny_dnn/layers/average_pooling_layer.h"
47 #include "tiny_dnn/layers/max_pooling_layer.h"
48 #include "tiny_dnn/layers/linear_layer.h"
49 #include "tiny_dnn/layers/lrn_layer.h"
50 #include "tiny_dnn/layers/dropout_layer.h"
51 #include "tiny_dnn/layers/arithmetic_layer.h"
52 #include "tiny_dnn/layers/concat_layer.h"
53 #include "tiny_dnn/layers/max_unpooling_layer.h"
54 #include "tiny_dnn/layers/average_unpooling_layer.h"
55 #include "tiny_dnn/layers/batch_normalization_layer.h"
56 #include "tiny_dnn/layers/slice_layer.h"
57 #include "tiny_dnn/layers/power_layer.h"
58 
59 #include "tiny_dnn/activations/activation_function.h"
60 #include "tiny_dnn/lossfunctions/loss_function.h"
61 #include "tiny_dnn/optimizers/optimizer.h"
62 
63 #include "tiny_dnn/util/weight_init.h"
64 #include "tiny_dnn/util/image.h"
65 #include "tiny_dnn/util/deform.h"
66 #include "tiny_dnn/util/product.h"
67 #include "tiny_dnn/util/graph_visualizer.h"
68 
69 #include "tiny_dnn/io/mnist_parser.h"
70 #include "tiny_dnn/io/cifar10_parser.h"
71 #include "tiny_dnn/io/display.h"
72 #include "tiny_dnn/io/layer_factory.h"
73 #include "tiny_dnn/util/serialization_helper.h"
74 #include "tiny_dnn/util/deserialization_helper.h"
75 
76 #ifdef CNN_USE_CAFFE_CONVERTER
77 // experimental / require google protobuf
78 #include "tiny_dnn/io/caffe/layer_factory.h"
79 #endif
80 
81 
82 // shortcut version of layer names
83 namespace tiny_dnn {
84 namespace layers {
85 
86 template <class T>
88 
89 template <class T>
91 
92 template <class T>
94 
95 template <class T>
97 
98 template <class T>
100 
101 template <class T>
103 
105 
107 
109 
110 template <class T>
112 
114 
116 
117 template <class T>
119 
120 template <class T>
122 
123 template <class T>
125 
126 }
127 
128 #include "tiny_dnn/models/alexnet.h"
129 
130 using batch_norm = tiny_dnn::batch_normalization_layer;
131 
132 using slice = tiny_dnn::slice_layer;
133 
134 using power = tiny_dnn::power_layer;
135 
136 using batch_norm = tiny_dnn::batch_normalization_layer;
137 
138 using slice = tiny_dnn::slice_layer;
139 
140 using power = tiny_dnn::power_layer;
141 
142 }
average pooling with trainable weights
Definition: average_pooling_layer.h:136
average pooling with trainable weights
Definition: average_unpooling_layer.h:134
Batch Normalization.
Definition: batch_normalization_layer.h:42
concat N layers along depth
Definition: concat_layer.h:44
2D convolution layer
Definition: convolutional_layer.h:52
2D deconvolution layer
Definition: deconvolutional_layer.h:54
applies dropout to the input
Definition: dropout_layer.h:37
element-wise add N vectors y_i = x0_i + x1_i + ...
Definition: arithmetic_layer.h:36
compute fully-connected(matmul) operation
Definition: fully_connected_layer.h:39
Definition: input_layer.h:32
local response normalization
Definition: lrn_layer.h:42
applies max-pooing operaton to the spatial data
Definition: max_pooling_layer.h:53
applies max-pooing operaton to the spatial data
Definition: max_unpooling_layer.h:38
element-wise pow: y = scale*x^factor
Definition: power_layer.h:38
2D convolution layer
Definition: quantized_convolutional_layer.h:54
slice an input data into multiple outputs along a given slice dimension.
Definition: slice_layer.h:42