| #!/bin/bash |
| # Licensed to the Apache Software Foundation (ASF) under one or more |
| # contributor license agreements. See the NOTICE file distributed with |
| # this work for additional information regarding copyright ownership. |
| # The ASF licenses this file to You under the Apache License, Version 2.0 |
| # (the "License"); you may not use this file except in compliance with |
| # the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, software |
| # distributed under the License is distributed on an "AS IS" BASIS, |
| # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| # See the License for the specific language governing permissions and |
| # limitations under the License. |
| |
| name: "LeNet" |
| layer { |
| name: "data" |
| type: "MemoryData" |
| top: "data" |
| top: "label" |
| include { |
| phase: TRAIN |
| } |
| source_class: "com.yahoo.ml.caffe.LMDB" |
| memory_data_param { |
| source: "file:/caffe-test/train/lmdb/" |
| batch_size: 1 |
| channels: 1 |
| height: 200 |
| width: 1000 |
| share_in_parallel: false |
| } |
| transform_param { |
| scale: 0.00390625 |
| force_color: true |
| } |
| } |
| layer { |
| name: "data" |
| type: "MemoryData" |
| top: "data" |
| top: "label" |
| include { |
| phase: TEST |
| } |
| source_class: "com.yahoo.ml.caffe.LMDB" |
| memory_data_param { |
| source: "file:/caffe-test/train/lmdb/" |
| batch_size: 1 |
| channels: 1 |
| height: 200 |
| width: 1000 |
| share_in_parallel: false |
| } |
| transform_param { |
| scale: 0.00390625 |
| force_color: true |
| } |
| } |
| layer { |
| name: "conv1" |
| type: "Convolution" |
| bottom: "data" |
| top: "conv1" |
| param { |
| lr_mult: 1 |
| } |
| param { |
| lr_mult: 2 |
| } |
| convolution_param { |
| num_output: 20 |
| kernel_size: 5 |
| stride: 1 |
| weight_filler { |
| type: "xavier" |
| } |
| bias_filler { |
| type: "constant" |
| } |
| } |
| } |
| layer { |
| name: "pool1" |
| type: "Pooling" |
| bottom: "conv1" |
| top: "pool1" |
| pooling_param { |
| pool: MAX |
| kernel_size: 2 |
| stride: 2 |
| } |
| } |
| layer { |
| name: "conv2" |
| type: "Convolution" |
| bottom: "pool1" |
| top: "conv2" |
| param { |
| lr_mult: 1 |
| } |
| param { |
| lr_mult: 2 |
| } |
| convolution_param { |
| num_output: 50 |
| kernel_size: 5 |
| stride: 1 |
| weight_filler { |
| type: "xavier" |
| } |
| bias_filler { |
| type: "constant" |
| } |
| } |
| } |
| layer { |
| name: "pool2" |
| type: "Pooling" |
| bottom: "conv2" |
| top: "pool2" |
| pooling_param { |
| pool: MAX |
| kernel_size: 2 |
| stride: 2 |
| } |
| } |
| layer { |
| name: "ip1" |
| type: "InnerProduct" |
| bottom: "pool2" |
| top: "ip1" |
| param { |
| lr_mult: 1 |
| } |
| param { |
| lr_mult: 2 |
| } |
| inner_product_param { |
| num_output: 500 |
| weight_filler { |
| type: "xavier" |
| } |
| bias_filler { |
| type: "constant" |
| } |
| } |
| } |
| layer { |
| name: "relu1" |
| type: "ReLU" |
| bottom: "ip1" |
| top: "ip1" |
| } |
| layer { |
| name: "ip2" |
| type: "InnerProduct" |
| bottom: "ip1" |
| top: "ip2" |
| param { |
| lr_mult: 1 |
| } |
| param { |
| lr_mult: 2 |
| } |
| inner_product_param { |
| num_output: 10 |
| weight_filler { |
| type: "xavier" |
| } |
| bias_filler { |
| type: "constant" |
| } |
| } |
| } |
| layer { |
| name: "accuracy" |
| type: "Accuracy" |
| bottom: "ip2" |
| bottom: "label" |
| top: "accuracy" |
| include { |
| phase: TEST |
| } |
| } |
| layer { |
| name: "loss" |
| type: "SoftmaxWithLoss" |
| bottom: "ip2" |
| bottom: "label" |
| top: "loss" |
| } |