|
| 1 | +/* |
| 2 | + * This prototext file can not be used as input to model_zoo/lbann_proto; |
| 3 | + * instead, it's provided to illustrate all (or most) of the various items |
| 4 | + * that can appear in a prototext file. I'm pretty sure that comments such |
| 5 | + * as this one, and those that appear below, will cause an exception |
| 6 | + * if they're included in an actual prototext file. |
| 7 | + */ |
| 8 | + |
| 9 | +model { |
| 10 | + name: "dnn" //dnn, stacked_autoencoder, or greedy_layerwise_autoencoder |
| 11 | + objective_function: "categorical_cross_entropy" //categorical_cross_entropy or mean_squared_error |
| 12 | + metric: "categorical_accuracy" //categorical_accuracy or mean_squared_error |
| 13 | + mini_batch_size: 192 |
| 14 | + num_epochs: 10 |
| 15 | + num_parallel_readers: 0 |
| 16 | + procs_per_model: 0 |
| 17 | + use_cudnn: false |
| 18 | + num_gpus: -1 |
| 19 | + evaluation_frequency: 1 //How often to evaluate model on validation set. A value less than 1 will disable evaluation. |
| 20 | + |
| 21 | + optimizer { |
| 22 | + name: "adagrad" //adagrad, rmsprop, adam or sgd |
| 23 | + learn_rate: 0.01 |
| 24 | + momentum: 0.9 |
| 25 | + decay: 0.5 |
| 26 | + nesterov: true |
| 27 | + } |
| 28 | + |
| 29 | + /* |
| 30 | + * "data_layout" fields should be either data_parallel or model_parallel |
| 31 | + * |
| 32 | + * activation_type: sigmoid, tanh, relu, id, leaky_relu, smooth_relu or elu |
| 33 | + * (see: include/lbann/layers/lbann_layer_activations.hpp; sigmoid = 1) |
| 34 | + * |
| 35 | + * weight_initialization: zero, uniform, normal, glorot_normal, he_normal or he_uniform |
| 36 | + * (see: include/lbann/lbann_base.hpp; zero = 0 |
| 37 | + * |
| 38 | + * Each layer has a unique identifying index. These need not be sequential. |
| 39 | + * For now layers are instantiated wrt the order in which they |
| 40 | + * appear below; in the future they will be instantiated wrt the parent |
| 41 | + * and child fields, and ordering within the prototext file will be ignored |
| 42 | + * -1 indicates there is no parent or child layer |
| 43 | + */ |
| 44 | + |
| 45 | + layer { |
| 46 | + input_distributed_minibatch_parallel_io { |
| 47 | + data_layout: "data_parallel" |
| 48 | + } |
| 49 | + index: -1 |
| 50 | + parent: 0 |
| 51 | + child: 1 |
| 52 | + } |
| 53 | + |
| 54 | + layer { |
| 55 | + fully_connected { |
| 56 | + data_layout: "data_parallel" |
| 57 | + num_neurons: 100 |
| 58 | + activation_type: "sigmoid" |
| 59 | + weight_initialization: "glorot_uniform" |
| 60 | + } |
| 61 | + index: 1 |
| 62 | + parent: 0 |
| 63 | + child: 2 |
| 64 | + } |
| 65 | + |
| 66 | + layer { |
| 67 | + convolution { |
| 68 | + num_dims: 2 |
| 69 | + num_input_channels: 32 |
| 70 | + input_dims: "26 26" |
| 71 | + num_output_channels: 32 |
| 72 | + filter_dims: "3 3" |
| 73 | + conv_pads: "0 0" |
| 74 | + conv_strides: "1 1" |
| 75 | + activation_type: "relu" |
| 76 | + weight_initialization: "glorot_uniform" |
| 77 | + } |
| 78 | + index: 1 |
| 79 | + parent: 0 |
| 80 | + child: 2 |
| 81 | + } |
| 82 | + |
| 83 | + layer { |
| 84 | + pooling { |
| 85 | + num_dims: 2 |
| 86 | + num_channels: 32 |
| 87 | + input_dims: "24 24" |
| 88 | + pool_dims: "2 2" |
| 89 | + pool_pads: "0 0" |
| 90 | + pool_strides: "2 2" |
| 91 | + pool_mode: "max" //max, average, average_no_pad |
| 92 | + } |
| 93 | + index: 1 |
| 94 | + parent: 0 |
| 95 | + child: 2 |
| 96 | + } |
| 97 | + |
| 98 | + layer { |
| 99 | + softmax { |
| 100 | + data_layout: "data_parallel" |
| 101 | + num_neurons: 10 |
| 102 | + weight_initialization: "glorot_uniform" |
| 103 | + } |
| 104 | + index: 1 |
| 105 | + parent: 0 |
| 106 | + child: 2 |
| 107 | + } |
| 108 | + |
| 109 | + layer { |
| 110 | + target_distributed_minibatch_parallel_io { |
| 111 | + data_layout: "data_parallel" |
| 112 | + shared_data_reader: true |
| 113 | + } |
| 114 | + index: 5 |
| 115 | + parent: 4 |
| 116 | + child: -1 |
| 117 | + } |
| 118 | + |
| 119 | + /* |
| 120 | + * except where noted, regularizer values below are the current lbann defaults |
| 121 | + */ |
| 122 | + regularizer { |
| 123 | + batch_normalization { |
| 124 | + data_layout: model_parallel |
| 125 | + decay: .0.9 |
| 126 | + gama: 1.0 |
| 127 | + beta: 0.0 |
| 128 | + } |
| 129 | + } |
| 130 | + regularizer { |
| 131 | + dropout { |
| 132 | + data_layout: model_parallel |
| 133 | + keep_prob: 0.5 |
| 134 | + } |
| 135 | + } |
| 136 | + regularizer { |
| 137 | + l2_regularization { |
| 138 | + lambda: 0 //no default in |
| 139 | + } |
| 140 | + } |
| 141 | + |
| 142 | + /* |
| 143 | + * I'm not listing all the callbacks here ... see src/proto/lbann.proto for |
| 144 | + * aditional info |
| 145 | + */ |
| 146 | + callback { |
| 147 | + save_images { |
| 148 | + image_dir: "images" |
| 149 | + extension: "png" |
| 150 | + } |
| 151 | + } |
| 152 | + callback { |
| 153 | + print { |
| 154 | + interval: 1 |
| 155 | + } |
| 156 | + } |
| 157 | + callback { |
| 158 | + timer { |
| 159 | + dir: "none" |
| 160 | + } |
| 161 | + } |
| 162 | + callback { |
| 163 | + summary { |
| 164 | + dir: "none" |
| 165 | + interval: 1 |
| 166 | + } |
| 167 | + } |
| 168 | +} |
0 commit comments