1. 程式人生 > >caffe 網路結構檢視 prototxt

caffe 網路結構檢視 prototxt

step 2. 將 net.prototxt 內容貼上到左側編輯框內,  按 Shift + Enter 即可在右側檢視網路結構, 滑鼠放單個節點上可以檢視節點的輸入、輸出及引數配置

# Enter your network definition here.
# Use Shift+Enter to update the visualization.
name: "ENet"
input: "data"
input_dim: 1
input_dim: 3
input_dim: 24 
input_dim: 48 

layer {
  name: "conv1"
  type: "Convolution"
  bottom: "data"
  top: "conv1"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 10
    kernel_size: 3
    stride: 1
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
      value: 0
    }
  }
}
layer {
  name: "ReLU1"
  type: "ReLU"
  bottom: "conv1"
  top: "conv1"
}
layer {
  name: "pool1"
  type: "Pooling"
  bottom: "conv1"
  top: "pool1"
  pooling_param {
    pool: MAX
    kernel_size: 2
    stride: 2
    pad: 0
  }
}
##------
layer {
  name: "conv1_2"
  type: "Convolution"
  bottom: "data"
  top: "conv1_2"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 10
    kernel_size: 5
    stride: 1
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
      value: 0
    }
  }
}
layer {
  name: "ReLU1"
  type: "ReLU"
  bottom: "conv1_2"
  top: "conv1_2"
}
layer {
  name: "pool1_2"
  type: "Pooling"
  bottom: "conv1_2"
  top: "pool1_2"
  pooling_param {
    pool: MAX
    kernel_size: 2
    stride: 2
    pad: 0
  }
}
# conv 2_2
layer {
  name: "conv2_2"
  type: "Convolution"
  bottom: "pool1_2"
  top: "conv2_2"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 16 
    kernel_size: 2
    stride: 1
     weight_filler {
      type: "xavier"
    }
    bias_filler {
	  type: "constant"
      value: 0
    }
  }
}
layer {
  name: "ReLU2_2"
  type: "ReLU"
  bottom: "conv2_2"
  top: "conv2_2"
}

#----
layer {
  name: "conv2"
  type: "Convolution"
  bottom: "pool1"
  top: "conv2"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 64 
    kernel_size: 3
    stride: 1
     weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
      value: 0
    }
  }
}
layer {
  name: "ReLU2"
  type: "ReLU"
  bottom: "conv2"
  top: "conv2"
}
#layer {
#  name: "pool2"
#  type: "Pooling"
#  bottom: "conv2"
#  top: "pool2"
#  pooling_param {
#    pool: MAX
#    kernel_size: 2
#    stride: 2
#    pad: 0
#  }
#}

# concat
layer {
   name: "concat"
   type: "Concat"
   bottom: "conv2_2"
   bottom: "conv2"
   top : "conout"
   concat_param {
       axis: 1
   }
}
# concat


layer {
  name: "conv3"
  type: "Convolution"
  bottom: "conout"
  top: "conv3"
  param {
    lr_mult: 1
    decay_mult: 1
  }
  param {
    lr_mult: 2
    decay_mult: 0
  }
  convolution_param {
    num_output: 16 
    kernel_size: 1
    stride: 1
     weight_filler {
      type: "xavier"
    }
    bias_filler {
	  type: "constant"
      value: 0
    }
  }
}
layer {
  name: "ReLU3"
  type: "ReLU"
  bottom: "conv3"
  top: "conv3"
}
layer{
  name: "transpose1"
  type: "Transpose"
  bottom: "conv3"
  top: "perm1"
  transpose_param { dim: 0 dim: 2 dim: 3 dim: 1 }
}


layer {
  name: "fc1"
  type: "InnerProduct"
  bottom: "perm1"
  top: "fc1"
  param {
    lr_mult: 0
    decay_mult: 0
  }
  param {
    lr_mult: 0
    decay_mult: 0
  }
  inner_product_param {
    num_output: 8 
    weight_filler {
      type: "xavier"
      }
    bias_filler {
      type: "constant"
      value: 0
    }
  }
}
layer {
  name: "fc2"
  type: "InnerProduct"
  bottom: "fc1"
  top: "fc2"
  param {
    lr_mult: 0
    decay_mult: 0
  }
  param {
    lr_mult: 0
    decay_mult: 0
  }
  inner_product_param {
    num_output: 2 
    weight_filler {
      type: "xavier"
      }
    bias_filler {
      type: "constant"
      value: 0
    }
  }
}

layer {
  name: "prob1"
  type: "Softmax"
  bottom: "fc2"
  top: "prob1"
}