How can I define weight and bias learning rate coefficients by Python interface

116 views
Skip to first unread message

Erogol

unread,
Oct 1, 2015, 9:00:24 AM10/1/15
to Caffe Users
I would like to do this by python interface;

 param {
    lr_mult: 1.00001
    decay_mult: 0
  }
  param {
    lr_mult: 1.00001
    decay_mult: 0
  }

but since they shares the same name, it cannot be defined by a python dictionary following the LeNet example notebook https://github.com/BVLC/caffe/blob/master/examples/01-learning-lenet.ipynb

Is there anyway to define separate learning rate scalers for weights and biases of the layers?

Evan Shelhamer

unread,
Oct 1, 2015, 1:13:39 PM10/1/15
to Erogol, Caffe Users
Repeated fields like `param` are lists in Python net spec, so define a list of dicts for separate learning rates and decays:

n.conv1 = L.Convolution(n.data, kernel_size=5, num_output=20, weight_filler=dict(type='xavier'),
param=[dict(lr_mult=1.0, decay_mult=1.0),dict(lr_mult=2.0, decay_mult=0.0)])

​==

layer {
  name: "conv1"
  type: "Convolution"
  bottom: "data"
  top: "conv1"
  param {
    lr_mult: 1.0
    decay_mult: 1.0
  }
  param {
    lr_mult: 2.0
    decay_mult: 0.0
  }
  convolution_param {
    num_output: 20
    kernel_size: 5
    weight_filler {
      type: "xavier"
    }
  } 
}


Evan Shelhamer



--
You received this message because you are subscribed to the Google Groups "Caffe Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to caffe-users...@googlegroups.com.
To post to this group, send email to caffe...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/caffe-users/8aa8a34b-d4d0-4dc1-a3d7-c8df2ee4391c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages