Advertisement
Guest User

Train

a guest
Jun 21st, 2020
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 13.07 KB | None | 0 0
  1. #This network is like a pre-alpha version. I just sort of wrote it out of the blue.
  2. #data size is 227x227x3
  3. layer {
  4.   name: "data"
  5.   type: "Data"
  6.   top: "data"
  7.   include {
  8.     phase: TRAIN
  9.   }
  10.   transform_param {
  11.     scale: 1
  12.   }
  13.   data_param {
  14.     source: "C:/Users/apple/models/wilde"
  15.     batch_size: 1 #about 20 iterations per second on a gtx1050
  16.     backend: LMDB
  17.   }
  18. }
  19. layer {
  20.   name: "conv1_a"
  21.   type: "Convolution"
  22.   bottom: "data"
  23.   top: "conv1_a"
  24.   param {
  25.     lr_mult: 1
  26.     decay_mult: 1
  27.   }
  28.   param {
  29.     lr_mult: 2
  30.     decay_mult: 0
  31.   }
  32.   convolution_param {
  33.     num_output: 16
  34.     pad: 2
  35.     kernel_size: 5
  36.     weight_filler {
  37.       type: "msra"
  38.     }
  39.     bias_filler {
  40.       type: "constant"
  41.       value: 0
  42.     }
  43.   }
  44. }
  45. layer {
  46.   name: "relu1_a"
  47.   type: "ELU"
  48.   bottom: "conv1_a"
  49.   top: "conv1_a"
  50. }
  51. layer {
  52.   name: "conv2_a"
  53.   type: "Convolution"
  54.   bottom: "conv1_a"
  55.   top: "conv2_a"
  56.   param {
  57.     lr_mult: 1
  58.     decay_mult: 1
  59.   }
  60.   param {
  61.     lr_mult: 2
  62.     decay_mult: 0
  63.   }
  64.   convolution_param {
  65.     num_output: 16
  66.     pad: 2
  67.     kernel_size: 5
  68.     weight_filler {
  69.       type: "msra"
  70.     }
  71.     bias_filler {
  72.       type: "constant"
  73.       value: 0
  74.     }
  75.   }
  76. }
  77. layer {
  78.   name: "relu2_a"
  79.   type: "ELU"
  80.   bottom: "conv2_a"
  81.   top: "conv2_a"
  82. }
  83. layer {
  84.   name: "conv3_a"
  85.   type: "Convolution"
  86.   bottom: "conv2_a"
  87.   top: "conv3_a"
  88.   param {
  89.     lr_mult: 1
  90.     decay_mult: 1
  91.   }
  92.   param {
  93.     lr_mult: 2
  94.     decay_mult: 0
  95.   }
  96.   convolution_param {
  97.     num_output: 16
  98.     pad: 1
  99.     kernel_size: 3
  100.     weight_filler {
  101.       type: "msra"
  102.     }
  103.     bias_filler {
  104.       type: "constant"
  105.       value: 0
  106.     }
  107.   }
  108. }
  109. layer {
  110.   name: "relu3_a"
  111.   type: "ELU"
  112.   bottom: "conv3_a"
  113.   top: "conv3_a"
  114. }
  115. layer {
  116.   name: "pool3_a"
  117.   type: "Pooling"
  118.   bottom: "conv3_a"
  119.   top: "pool3_a"
  120.   pooling_param {
  121.     pool: MAX
  122.     kernel_size: 3
  123.     stride: 2
  124.   }
  125. }
  126. layer {
  127.   name: "conv1_b"
  128.   type: "Convolution"
  129.   bottom: "pool3_a"
  130.   top: "conv1_b"
  131.   param {
  132.     lr_mult: 1
  133.     decay_mult: 1
  134.   }
  135.   param {
  136.     lr_mult: 2
  137.     decay_mult: 0
  138.   }
  139.   convolution_param {
  140.     num_output: 32
  141.     pad: 2
  142.     kernel_size: 5
  143.     weight_filler {
  144.       type: "msra"
  145.     }
  146.     bias_filler {
  147.       type: "constant"
  148.       value: 0
  149.     }
  150.   }
  151. }
  152. layer {
  153.   name: "relu1_b"
  154.   type: "ELU"
  155.   bottom: "conv1_b"
  156.   top: "conv1_b"
  157. }
  158. layer {
  159.   name: "conv2_b"
  160.   type: "Convolution"
  161.   bottom: "conv1_b"
  162.   top: "conv2_b"
  163.   param {
  164.     lr_mult: 1
  165.     decay_mult: 1
  166.   }
  167.   param {
  168.     lr_mult: 2
  169.     decay_mult: 0
  170.   }
  171.   convolution_param {
  172.     num_output: 32
  173.     pad: 2
  174.     kernel_size: 5
  175.     weight_filler {
  176.       type: "msra"
  177.     }
  178.     bias_filler {
  179.       type: "constant"
  180.       value: 0
  181.     }
  182.   }
  183. }
  184. layer {
  185.   name: "relu2_b"
  186.   type: "ELU"
  187.   bottom: "conv2_b"
  188.   top: "conv2_b"
  189. }
  190. layer {
  191.   name: "conv3_b"
  192.   type: "Convolution"
  193.   bottom: "conv2_b"
  194.   top: "conv3_b"
  195.   param {
  196.     lr_mult: 1
  197.     decay_mult: 1
  198.   }
  199.   param {
  200.     lr_mult: 2
  201.     decay_mult: 0
  202.   }
  203.   convolution_param {
  204.     num_output: 32
  205.     pad: 1
  206.     kernel_size: 3
  207.     weight_filler {
  208.       type: "msra"
  209.     }
  210.     bias_filler {
  211.       type: "constant"
  212.       value: 0
  213.     }
  214.   }
  215. }
  216. layer {
  217.   name: "relu3_b"
  218.   type: "ELU"
  219.   bottom: "conv3_b"
  220.   top: "conv3_b"
  221. }
  222. layer {
  223.   name: "pool3_b"
  224.   type: "Pooling"
  225.   bottom: "conv3_b"
  226.   top: "pool3_b"
  227.   pooling_param {
  228.     pool: MAX
  229.     kernel_size: 3
  230.     stride: 2
  231.   }
  232. }
  233. layer {
  234.   name: "conv1_c"
  235.   type: "Convolution"
  236.   bottom: "pool3_b"
  237.   top: "conv1_c"
  238.   param {
  239.     lr_mult: 1
  240.     decay_mult: 1
  241.   }
  242.   param {
  243.     lr_mult: 2
  244.     decay_mult: 0
  245.   }
  246.   convolution_param {
  247.     num_output: 64
  248.     pad: 2
  249.     kernel_size: 5
  250.     weight_filler {
  251.       type: "msra"
  252.     }
  253.     bias_filler {
  254.       type: "constant"
  255.       value: 0
  256.     }
  257.   }
  258. }
  259. layer {
  260.   name: "relu1_c"
  261.   type: "ELU"
  262.   bottom: "conv1_c"
  263.   top: "conv1_c"
  264. }
  265. layer {
  266.   name: "conv2_c"
  267.   type: "Convolution"
  268.   bottom: "conv1_c"
  269.   top: "conv2_c"
  270.   param {
  271.     lr_mult: 1
  272.     decay_mult: 1
  273.   }
  274.   param {
  275.     lr_mult: 2
  276.     decay_mult: 0
  277.   }
  278.   convolution_param {
  279.     num_output: 64
  280.     pad: 2
  281.     kernel_size: 5
  282.     weight_filler {
  283.       type: "msra"
  284.     }
  285.     bias_filler {
  286.       type: "constant"
  287.       value: 0
  288.     }
  289.   }
  290. }
  291. layer {
  292.   name: "relu2_c"
  293.   type: "ELU"
  294.   bottom: "conv2_c"
  295.   top: "conv2_c"
  296. }
  297. layer {
  298.   name: "conv3_c"
  299.   type: "Convolution"
  300.   bottom: "conv2_c"
  301.   top: "conv3_c"
  302.   param {
  303.     lr_mult: 1
  304.     decay_mult: 1
  305.   }
  306.   param {
  307.     lr_mult: 2
  308.     decay_mult: 0
  309.   }
  310.   convolution_param {
  311.     num_output: 64
  312.     pad: 1
  313.     kernel_size: 3
  314.     weight_filler {
  315.       type: "msra"
  316.     }
  317.     bias_filler {
  318.       type: "constant"
  319.       value: 0
  320.     }
  321.   }
  322. }
  323. layer {
  324.   name: "relu3_c"
  325.   type: "ELU"
  326.   bottom: "conv3_c"
  327.   top: "conv3_c"
  328. }
  329. layer {
  330.   name: "pool3_c"
  331.   type: "Pooling"
  332.   bottom: "conv3_c"
  333.   top: "pool3_c"
  334.   pooling_param {
  335.     pool: MAX
  336.     kernel_size: 3
  337.     stride: 2
  338.   }
  339. }
  340. layer {
  341.   name: "conv1_d"
  342.   type: "Convolution"
  343.   bottom: "pool3_c"
  344.   top: "conv1_d"
  345.   param {
  346.     lr_mult: 1
  347.     decay_mult: 1
  348.   }
  349.   param {
  350.     lr_mult: 2
  351.     decay_mult: 0
  352.   }
  353.   convolution_param {
  354.     num_output: 96
  355.     pad: 2
  356.     kernel_size: 5
  357.     weight_filler {
  358.       type: "msra"
  359.     }
  360.     bias_filler {
  361.       type: "constant"
  362.       value: 0
  363.     }
  364.   }
  365. }
  366. layer {
  367.   name: "relu1_d"
  368.   type: "ELU"
  369.   bottom: "conv1_d"
  370.   top: "conv1_d"
  371. }
  372. layer {
  373.   name: "conv2_d"
  374.   type: "Convolution"
  375.   bottom: "conv1_d"
  376.   top: "conv2_d"
  377.   param {
  378.     lr_mult: 1
  379.     decay_mult: 1
  380.   }
  381.   param {
  382.     lr_mult: 2
  383.     decay_mult: 0
  384.   }
  385.   convolution_param {
  386.     num_output: 96
  387.     pad: 2
  388.     kernel_size: 5
  389.     weight_filler {
  390.       type: "msra"
  391.     }
  392.     bias_filler {
  393.       type: "constant"
  394.       value: 0
  395.     }
  396.   }
  397. }
  398. layer {
  399.   name: "relu2_d"
  400.   type: "ELU"
  401.   bottom: "conv2_d"
  402.   top: "conv2_d"
  403. }
  404. layer {
  405.   name: "conv3_d"
  406.   type: "Convolution"
  407.   bottom: "conv2_d"
  408.   top: "conv3_d"
  409.   param {
  410.     lr_mult: 1
  411.     decay_mult: 1
  412.   }
  413.   param {
  414.     lr_mult: 2
  415.     decay_mult: 0
  416.   }
  417.   convolution_param {
  418.     num_output: 96
  419.     pad: 1
  420.     kernel_size: 3
  421.     weight_filler {
  422.       type: "msra"
  423.     }
  424.     bias_filler {
  425.       type: "constant"
  426.       value: 0
  427.     }
  428.   }
  429. }
  430. layer {
  431.   name: "relu3_d"
  432.   type: "ELU"
  433.   bottom: "conv3_d"
  434.   top: "conv3_d"
  435. }
  436. layer {
  437.   name: "pool3_d"
  438.   type: "Pooling"
  439.   bottom: "conv3_d"
  440.   top: "pool3_d"
  441.   pooling_param {
  442.     pool: MAX
  443.     kernel_size: 3
  444.     stride: 2
  445.   }
  446. }
  447. layer {
  448.   name: "conv1_e"
  449.   type: "Convolution"
  450.   bottom: "pool3_d"
  451.   top: "conv1_e"
  452.   param {
  453.     lr_mult: 1
  454.     decay_mult: 1
  455.   }
  456.   param {
  457.     lr_mult: 2
  458.     decay_mult: 0
  459.   }
  460.   convolution_param {
  461.     num_output: 64
  462.     pad: 2
  463.     kernel_size: 5
  464.     weight_filler {
  465.       type: "msra"
  466.     }
  467.     bias_filler {
  468.       type: "constant"
  469.       value: 0
  470.     }
  471.   }
  472. }
  473. layer {
  474.   name: "relu1_e"
  475.   type: "ELU"
  476.   bottom: "conv1_e"
  477.   top: "conv1_e"
  478. }
  479. layer {
  480.   name: "conv2_e"
  481.   type: "Convolution"
  482.   bottom: "conv1_e"
  483.   top: "conv2_e"
  484.   param {
  485.     lr_mult: 1
  486.     decay_mult: 1
  487.   }
  488.   param {
  489.     lr_mult: 2
  490.     decay_mult: 0
  491.   }
  492.   convolution_param {
  493.     num_output: 64
  494.     pad: 2
  495.     kernel_size: 5
  496.     weight_filler {
  497.       type: "msra"
  498.     }
  499.     bias_filler {
  500.       type: "constant"
  501.       value: 0
  502.     }
  503.   }
  504. }
  505. layer {
  506.   name: "relu2_e"
  507.   type: "ELU"
  508.   bottom: "conv2_e"
  509.   top: "conv2_e"
  510. }
  511. layer {
  512.   name: "conv3_e"
  513.   type: "Convolution"
  514.   bottom: "conv2_e"
  515.   top: "conv3_e"
  516.   param {
  517.     lr_mult: 1
  518.     decay_mult: 1
  519.   }
  520.   param {
  521.     lr_mult: 2
  522.     decay_mult: 0
  523.   }
  524.   convolution_param {
  525.     num_output: 64
  526.     pad: 1
  527.     kernel_size: 3
  528.     weight_filler {
  529.       type: "msra"
  530.     }
  531.     bias_filler {
  532.       type: "constant"
  533.       value: 0
  534.     }
  535.   }
  536. }
  537. layer {
  538.   name: "relu3_e"
  539.   type: "ELU"
  540.   bottom: "conv3_e"
  541.   top: "conv3_e"
  542. }
  543. layer {
  544.   name: "deconv_fc1"
  545.   type: "InnerProduct"
  546.   bottom: "conv3_e"
  547.   top: "deconv_fc1"
  548.   param {
  549.     lr_mult: 1
  550.     decay_mult: 0
  551.   }
  552.   param {
  553.     lr_mult: 2
  554.     decay_mult: 0
  555.   }
  556.   inner_product_param {
  557.     num_output: 512
  558.     weight_filler {
  559.       type: "msra"
  560.     }
  561.   }
  562. }
  563. layer {
  564.   name: "relu_deconv_fc1"
  565.   type: "ELU"
  566.   bottom: "deconv_fc1"
  567.   top: "deconv_fc1"
  568. }
  569. layer {
  570.   name: "deconv_fc2"
  571.   type: "InnerProduct"
  572.   bottom: "deconv_fc1"
  573.   top: "deconv_fc2"
  574.   param {
  575.     lr_mult: 1
  576.     decay_mult: 0
  577.   }
  578.   param {
  579.     lr_mult: 2
  580.     decay_mult: 0
  581.   }
  582.   inner_product_param {
  583.     num_output: 1024
  584.     weight_filler {
  585.       type: "msra"
  586.     }
  587.   }
  588. }
  589. layer {
  590.   name: "relu_deconv_fc2"
  591.   type: "ELU"
  592.   bottom: "deconv_fc2"
  593.   top: "deconv_fc2"
  594. }
  595. layer {
  596.   name: "deconv_fc3_"
  597.   type: "InnerProduct"
  598.   bottom: "deconv_fc2"
  599.   top: "deconv_fc3_"
  600.   param {
  601.     lr_mult: 1
  602.     decay_mult: 0
  603.   }
  604.   param {
  605.     lr_mult: 2
  606.     decay_mult: 0
  607.   }
  608.   inner_product_param {
  609.     num_output: 12544
  610. # this is probably a bit excessive but it can be reshaped back into the size of layer "conv3_e" which is 1x64x14x14 which aids a lot in creating a spicy decoder.
  611. #Other values could work, as long as it can be reshaped back into Cx14x14
  612.     weight_filler {
  613.       type: "msra"
  614.     }
  615.   }
  616. }
  617. layer {
  618.   name: "relu_deconv_fc3_"
  619.   type: "ELU"
  620.   bottom: "deconv_fc3_"
  621.   top: "deconv_fc3_"
  622. }
  623. layer {
  624.   name: "reshape_fc"
  625.   type: "Reshape"
  626.   bottom: "deconv_fc3_"
  627.   top: "reshape_fc"
  628.   reshape_param {
  629.     shape {
  630.       dim: 1
  631.       dim: -1
  632.       dim: 14
  633.       dim: 14
  634.     }
  635.   }
  636. }
  637. layer {
  638.   name: "conv1_e_t"
  639.   type: "Deconvolution"
  640.   bottom: "reshape_fc"
  641.   top: "conv1_e_t"
  642.   param {
  643.     lr_mult: 1
  644.     decay_mult: 1
  645.   }
  646.   param {
  647.     lr_mult: 0
  648.     decay_mult: 0
  649.   }
  650.   convolution_param {
  651.     num_output: 96
  652.     pad: 1
  653.     kernel_size: 3
  654.     weight_filler {
  655.       type: "msra"
  656.     }
  657.     bias_filler {
  658.       type: "constant"
  659.       value: 0
  660.     }
  661.   }
  662. }
  663. layer {
  664.   name: "relu1_e_t"
  665.   type: "ELU"
  666.   bottom: "conv1_e_t"
  667.   top: "conv1_e_t"
  668. }
  669. layer {
  670.   name: "pool3_d_t"
  671.   type: "Resize"
  672.   bottom: "conv1_e_t"
  673.   top: "pool3_d_t"
  674.   resize_param {
  675.     interpolation: LINEAR
  676.     height: 28
  677.     width: 28
  678.   }
  679. }
  680. layer {
  681.   name: "conv1_d_t"
  682.   type: "Deconvolution"
  683.   bottom: "pool3_d_t"
  684.   top: "conv1_d_t"
  685.   param {
  686.     lr_mult: 1
  687.     decay_mult: 1
  688.   }
  689.   param {
  690.     lr_mult: 0
  691.     decay_mult: 0
  692.   }
  693.   convolution_param {
  694.     num_output: 64
  695.     pad: 1
  696.     kernel_size: 3
  697.     weight_filler {
  698.       type: "msra"
  699.     }
  700.     bias_filler {
  701.       type: "constant"
  702.       value: 0
  703.     }
  704.   }
  705. }
  706. layer {
  707.   name: "relu1_d_t"
  708.   type: "ELU"
  709.   bottom: "conv1_d_t"
  710.   top: "conv1_d_t"
  711. }
  712. layer {
  713.   name: "pool3_c_t"
  714.   type: "Resize"
  715.   bottom: "conv1_d_t"
  716.   top: "pool3_c_t"
  717.   resize_param {
  718.     interpolation: LINEAR
  719.     height: 56
  720.     width: 56
  721.   }
  722. }
  723. layer {
  724.   name: "conv1_c_t"
  725.   type: "Deconvolution"
  726.   bottom: "pool3_c_t"
  727.   top: "conv1_c_t"
  728.   param {
  729.     lr_mult: 1
  730.     decay_mult: 1
  731.   }
  732.   param {
  733.     lr_mult: 0
  734.     decay_mult: 0
  735.   }
  736.   convolution_param {
  737.     num_output: 32
  738.     pad: 1
  739.     kernel_size: 3
  740.     weight_filler {
  741.       type: "msra"
  742.     }
  743.     bias_filler {
  744.       type: "constant"
  745.       value: 0
  746.     }
  747.   }
  748. }
  749. layer {
  750.   name: "relu1_c_t"
  751.   type: "ELU"
  752.   bottom: "conv1_c_t"
  753.   top: "conv1_c_t"
  754. }
  755. layer {
  756.   name: "pool3_b_t"
  757.   type: "Resize"
  758.   bottom: "conv1_c_t"
  759.   top: "pool3_b_t"
  760.   resize_param {
  761.     interpolation: LINEAR
  762.     height: 113
  763.     width: 113
  764.   }
  765. }
  766. layer {
  767.   name: "conv1_b_t"
  768.   type: "Deconvolution"
  769.   bottom: "pool3_b_t"
  770.   top: "conv1_b_t"
  771.   param {
  772.     lr_mult: 1
  773.     decay_mult: 1
  774.   }
  775.   param {
  776.     lr_mult: 0
  777.     decay_mult: 0
  778.   }
  779.   convolution_param {
  780.     num_output: 16
  781.     pad: 1
  782.     kernel_size: 3
  783.     weight_filler {
  784.       type: "msra"
  785.     }
  786.     bias_filler {
  787.       type: "constant"
  788.       value: 0
  789.     }
  790.   }
  791. }
  792. layer {
  793.   name: "relu1_b_t"
  794.   type: "ELU"
  795.   bottom: "conv1_b_t"
  796.   top: "conv1_b_t"
  797. }
  798. layer {
  799.   name: "pool3_a_t"
  800.   type: "Resize"
  801.   bottom: "conv1_b_t"
  802.   top: "pool3_a_t"
  803.   resize_param {
  804.     interpolation: LINEAR
  805.     height: 227
  806.     width: 227
  807.   }
  808. }
  809. layer {
  810.   name: "conv1_a_t"
  811.   type: "Deconvolution"
  812.   bottom: "pool3_a_t"
  813.   top: "conv1_a_t"
  814.   param {
  815.     lr_mult: 1
  816.     decay_mult: 1
  817.   }
  818.   param {
  819.     lr_mult: 0
  820.     decay_mult: 0
  821.   }
  822.   convolution_param {
  823.     num_output: 3 #Change to 4 if you're feeling ambitious and want to train on images with an alpha (transparency channel(.
  824.    pad: 1
  825.    kernel_size: 3
  826.    weight_filler {
  827.      type: "msra"
  828.    }
  829.    bias_filler {
  830.      type: "constant"
  831.      value: 0
  832.    }
  833.  }
  834. }
  835. layer {
  836.  name: "relu1_a_t"
  837.  type: "ELU"
  838.  bottom: "conv1_a_t"
  839.  top: "conv1_a_t"
  840. }
  841. layer {
  842.  name: "mse_loss"
  843.  type: "EuclideanLoss"
  844.  bottom: "data"
  845.  bottom: "conv1_a_t"
  846.  top: "mse_loss"
  847.  loss_weight: 1e-09 #scales down the loss into something more acceptable; it probably comes from the fact that either the "data" or the "conv1_at" need more than just an "ELU" layer for normalization.
  848. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement