Sharing weights between 2 networks from different databases

21 views
Skip to first unread message

TA

unread,
Sep 4, 2017, 10:18:01 AM9/4/17
to Caffe Users
Hello,

How to share weights between 2 networks each network has different input database. For example:

layer {
  name: "Img-1"
  type: "Data"
  top: "blob0" 
 
  include {
    phase: TRAIN
  }
 

  data_param {
    source: "/home/LMDBs/train-img1-lmdb-Exp"
    batch_size: 8
    backend: LMDB
    encoding: UINT8
    verbose: true
  }
}

layer {
  name: "Img-2"
  type: "Data"
  top: "blob1" 
 
  include {
    phase: TRAIN
  }
 

  data_param {
    source: "/home/LMDBs/train-img2-lmdb-Exp"
    batch_size: 8
    backend: LMDB
    encoding: UINT8
    verbose: true
  }
}


layer {
  name: "Concat1"
  type: "Concat"
  bottom: "blob0"
  top: "img1"
  concat_param {
    axis: 0
  }
}
layer {
  name: "Concat2"
  type: "Concat"
  bottom: "blob1"
  top: "img2"

  concat_param {
    axis: 0
  }
}


layer {
  name: "conv0"
  type: "Convolution"
  bottom: "img1"
  top: "blob2"
  param {
    lr_mult: 0
    decay_mult: 0
  }
  param {
    lr_mult: 0
    decay_mult: 0
  }
  convolution_param {
    num_output: 64
    pad: 1
    kernel_size: 3
    stride: 1
    weight_filler {
      type: "msra"
    }
    bias_filler {
      type: "constant"
    }
    engine: CUDNN
  }
}

layer {
  name: "conv1"
  type: "Convolution"
  bottom: "img2"
  top: "blob3"
  param {
    lr_mult: 0
    decay_mult: 0
  }
  param {
    lr_mult: 0
    decay_mult: 0
  }
  convolution_param {
    num_output: 64
    pad: 1
    kernel_size: 3
    stride: 1
    weight_filler {
      type: "msra"
    }
    bias_filler {
      type: "constant"
    }
    engine: CUDNN
  }
}


Thanks
Reply all
Reply to author
Forward
0 new messages