caffe中使用droupout层对cifar10图片集提高准确率10%(0.62到0.72)

来源:互联网 发布:c语言中函数和 编辑:程序博客网 时间:2024/05/21 17:34


# The train/test net protocol buffer definitionnet: "D:\\CaffeInfo\\D_TrainVal\\cifar10_full_train_test.prototxt"# test_iter specifies how many forward passes the test should carry out.# In the case of MNIST, we have test batch size 100 and 100 test iterations,# covering the full 10,000 testing images.test_iter: 200# Carry out testing every 500 training iterations.test_interval: 200# The base learning rate, momentum and the weight decay of the network.base_lr: 0.01momentum: 0.9weight_decay: 0.004# The learning rate policylr_policy: "step"gamma: 0.1stepsize: 10000# Display every 100 iterationsdisplay: 200# The maximum number of iterationsmax_iter: 100000# snapshot intermediate resultssnapshot: 10000snapshot_format: HDF5snapshot_prefix:"D:\\CaffeInfo\\D_TrainVal\\cifar10_full"# solver mode: CPU or GPUsolver_mode: GPU


///////////////////////////////////////////////////////////////////////////////////////////////// 

dropout_ratio: 0.1 

name: "CIFAR10_full"layer {  name: "cifar"  type: "Data"  top: "data"  top: "label"  include {    phase: TRAIN  }  transform_param {    mean_file: "D:\\CaffeInfo\\B_DataCreate\\mean.binaryproto"  }  data_param {    source: "D:\\CaffeInfo\\B_DataCreate\\train_db"    batch_size: 50    backend: LMDB  }}layer {  name: "cifar"  type: "Data"  top: "data"  top: "label"  include {    phase: TEST  }  transform_param {    mean_file: "D:\\CaffeInfo\\B_DataCreate\\mean.binaryproto"  }  data_param {    source: "D:\\CaffeInfo\\B_DataCreate\\val_db"    batch_size: 50    backend: LMDB  }}layer {  name: "conv1"  type: "Convolution"  bottom: "data"  top: "conv1"  param {    lr_mult: 1  }  param {    lr_mult: 2  }  convolution_param {    num_output: 32    pad: 2    kernel_size: 5    stride: 1    weight_filler {      type: "gaussian"      std: 0.0001    }    bias_filler {      type: "constant"    }  }}layer {  name: "pool1"  type: "Pooling"  bottom: "conv1"  top: "pool1"  pooling_param {    pool: MAX    kernel_size: 3    stride: 2  }}layer {  name: "relu1"  type: "ReLU"  bottom: "pool1"  top: "pool1"}layer {  name: "norm1"  type: "LRN"  bottom: "pool1"  top: "norm1"  lrn_param {    local_size: 3    alpha: 5e-05    beta: 0.75    norm_region: WITHIN_CHANNEL  }}layer {  name: "conv2"  type: "Convolution"  bottom: "norm1"  top: "conv2"  param {    lr_mult: 1  }  param {    lr_mult: 2  }  convolution_param {    num_output: 32    pad: 2    kernel_size: 5    stride: 1    weight_filler {      type: "gaussian"      std: 0.01    }    bias_filler {      type: "constant"    }  }}layer {  name: "relu2"  type: "ReLU"  bottom: "conv2"  top: "conv2"}layer {  name: "pool2"  type: "Pooling"  bottom: "conv2"  top: "pool2"  pooling_param {    pool: AVE    kernel_size: 3    stride: 2  }}layer {  name: "norm2"  type: "LRN"  bottom: "pool2"  top: "norm2"  lrn_param {    local_size: 3    alpha: 5e-05    beta: 0.75    norm_region: WITHIN_CHANNEL  }}layer {  name: "conv3"  type: "Convolution"  bottom: "norm2"  top: "conv3"  convolution_param {    num_output: 64    pad: 2    kernel_size: 5    stride: 1    weight_filler {      type: "gaussian"      std: 0.01    }    bias_filler {      type: "constant"    }  }}layer {  name: "relu3"  type: "ReLU"  bottom: "conv3"  top: "conv3"}layer {  name: "pool3"  type: "Pooling"  bottom: "conv3"  top: "pool3"  pooling_param {    pool: AVE    kernel_size: 3    stride: 2  }}layer {  name: "ip1"  type: "InnerProduct"  bottom: "pool3"  top: "ip1"  param {    lr_mult: 1    decay_mult: 250  }  param {    lr_mult: 2    decay_mult: 0  }  inner_product_param {    num_output: 256    weight_filler {      type: "gaussian"      std: 0.01    }    bias_filler {      type: "constant"    }  }}layer {  name: "fc7"  type: "InnerProduct"  bottom: "ip1"  top: "fc7"  param {    lr_mult: 1    decay_mult: 1  }  param {    lr_mult: 2    decay_mult: 0  }  inner_product_param {    num_output: 10    weight_filler {      type: "gaussian"      std: 0.005    }    bias_filler {      type: "constant"      value: 1    }  }}layer {  name: "relu7"  type: "ReLU"  bottom: "fc7"  top: "fc7"}layer {  name: "drop7"  type: "Dropout"  bottom: "fc7"  top: "fc7"  dropout_param {    dropout_ratio: 0.1  }}layer {  name: "accuracy"  type: "Accuracy"  bottom: "fc7"  bottom: "label"  top: "accuracy"  include {    phase: TEST  }}layer {  name: "loss"  type: "SoftmaxWithLoss"  bottom: "fc7"  bottom: "label"  top: "loss"}




////////////////////////////////////////////////////////////////////////////////////////////////////////////

没有droupout

name: "CIFAR10_full"layer {  name: "cifar"  type: "Data"  top: "data"  top: "label"  include {    phase: TRAIN  }  transform_param {    mean_file: "D:\\CaffeInfo\\B_DataCreate\\mean.binaryproto"  }  data_param {    source: "D:\\CaffeInfo\\B_DataCreate\\train_db"    batch_size: 50    backend: LMDB  }}layer {  name: "cifar"  type: "Data"  top: "data"  top: "label"  include {    phase: TEST  }  transform_param {    mean_file: "D:\\CaffeInfo\\B_DataCreate\\mean.binaryproto"  }  data_param {    source: "D:\\CaffeInfo\\B_DataCreate\\val_db"    batch_size: 50    backend: LMDB  }}layer {  name: "conv1"  type: "Convolution"  bottom: "data"  top: "conv1"  param {    lr_mult: 1  }  param {    lr_mult: 2  }  convolution_param {    num_output: 32    pad: 2    kernel_size: 5    stride: 1    weight_filler {      type: "gaussian"      std: 0.0001    }    bias_filler {      type: "constant"    }  }}layer {  name: "pool1"  type: "Pooling"  bottom: "conv1"  top: "pool1"  pooling_param {    pool: MAX    kernel_size: 3    stride: 2  }}layer {  name: "relu1"  type: "ReLU"  bottom: "pool1"  top: "pool1"}layer {  name: "norm1"  type: "LRN"  bottom: "pool1"  top: "norm1"  lrn_param {    local_size: 3    alpha: 5e-05    beta: 0.75    norm_region: WITHIN_CHANNEL  }}layer {  name: "conv2"  type: "Convolution"  bottom: "norm1"  top: "conv2"  param {    lr_mult: 1  }  param {    lr_mult: 2  }  convolution_param {    num_output: 32    pad: 2    kernel_size: 5    stride: 1    weight_filler {      type: "gaussian"      std: 0.01    }    bias_filler {      type: "constant"    }  }}layer {  name: "relu2"  type: "ReLU"  bottom: "conv2"  top: "conv2"}layer {  name: "pool2"  type: "Pooling"  bottom: "conv2"  top: "pool2"  pooling_param {    pool: AVE    kernel_size: 3    stride: 2  }}layer {  name: "norm2"  type: "LRN"  bottom: "pool2"  top: "norm2"  lrn_param {    local_size: 3    alpha: 5e-05    beta: 0.75    norm_region: WITHIN_CHANNEL  }}layer {  name: "conv3"  type: "Convolution"  bottom: "norm2"  top: "conv3"  convolution_param {    num_output: 64    pad: 2    kernel_size: 5    stride: 1    weight_filler {      type: "gaussian"      std: 0.01    }    bias_filler {      type: "constant"    }  }}layer {  name: "relu3"  type: "ReLU"  bottom: "conv3"  top: "conv3"}layer {  name: "pool3"  type: "Pooling"  bottom: "conv3"  top: "pool3"  pooling_param {    pool: AVE    kernel_size: 3    stride: 2  }}layer {  name: "ip1"  type: "InnerProduct"  bottom: "pool3"  top: "ip1"  param {    lr_mult: 1    decay_mult: 250  }  param {    lr_mult: 2    decay_mult: 0  }  inner_product_param {    num_output: 10    weight_filler {      type: "gaussian"      std: 0.01    }    bias_filler {      type: "constant"    }  }}layer {  name: "accuracy"  type: "Accuracy"  bottom: "ip1"  bottom: "label"  top: "accuracy"  include {    phase: TEST  }}layer {  name: "loss"  type: "SoftmaxWithLoss"  bottom: "ip1"  bottom: "label"  top: "loss"}


///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
































原创粉丝点击