| 78 | } |
| 79 | |
| 80 | LayerConf GenDenseConf(string name, int num_output, float std, float wd) { |
| 81 | LayerConf conf; |
| 82 | conf.set_name(name); |
| 83 | conf.set_type("singa_dense"); |
| 84 | DenseConf *dense = conf.mutable_dense_conf(); |
| 85 | dense->set_num_output(num_output); |
| 86 | |
| 87 | ParamSpec *wspec = conf.add_param(); |
| 88 | wspec->set_name(name + "_weight"); |
| 89 | wspec->set_decay_mult(wd); |
| 90 | auto wfill = wspec->mutable_filler(); |
| 91 | wfill->set_type("Gaussian"); |
| 92 | wfill->set_std(std); |
| 93 | |
| 94 | ParamSpec *bspec = conf.add_param(); |
| 95 | bspec->set_name(name + "_bias"); |
| 96 | bspec->set_lr_mult(2); |
| 97 | bspec->set_decay_mult(0); |
| 98 | |
| 99 | return conf; |
| 100 | } |
| 101 | |
| 102 | LayerConf GenLRNConf(string name) { |
| 103 | LayerConf conf; |