项目作者: quziyan

项目描述 :
cuda version data augumentation layer in caffe
高级语言: Cuda
项目地址: git://github.com/quziyan/DataTransformerLayer.git
创建时间: 2017-12-29T07:47:35Z
项目社区:https://github.com/quziyan/DataTransformerLayer

开源协议:

下载


DataTransformerLayer

CAFFE IMPLEMENTATION OF data augumentation (CUDA version)
Deduction and results are in folder [./attachments]
proto definition:

  1. message DataTranformerLParameter {
  2. //output-canvas size, default is correspond to input size
  3. optional int32 canvas_w = 14 [default = -1];
  4. optional int32 canvas_h = 15 [default = -1];
  5. //absolute distortion
  6. optional float delta1_sigma = 1 [default = 12.75];
  7. //relative distortion
  8. optional float delta2_sigma = 2 [default = 0.15];
  9. //height-wise distortion
  10. optional float delta3_sigma = 3 [default = 0];
  11. //width-wise distortion
  12. optional float delta4_sigma = 4 [default = 0];
  13. optional float rotate_angle_scope = 5 [default = 0.349];//20 degree
  14. optional float translation_w_scope = 6 [default = 8];
  15. optional float translation_h_scope = 7 [default = 8];
  16. optional float scale_w_scope = 8 [default = 1.2];
  17. optional float scale_h_scope = 9 [default = 1.2];
  18. // do mirror
  19. optional bool h_flip = 10 [default = true];
  20. // elastic transform
  21. optional bool elastic_transform = 13 [default = false];
  22. optional float amplitude = 11 [default = 1];
  23. optional float radius = 12 [default = 1];
  24. }

Usage:

  1. name: "CIFAR10_full"
  2. layer {
  3. name: "cifar"
  4. type: "Data"
  5. top: "data"
  6. top: "label"
  7. include {
  8. phase: TRAIN
  9. }
  10. transform_param {
  11. mean_file: "../../data/mean.binaryproto"
  12. }
  13. data_param {
  14. source: "../../data/cifar10_train_lmdb"
  15. batch_size: 100
  16. backend: LMDB
  17. }
  18. }
  19. layer {
  20. name: "cifar"
  21. type: "Data"
  22. top: "data"
  23. top: "label"
  24. include {
  25. phase: TEST
  26. }
  27. transform_param {
  28. mean_file: "../../data/mean.binaryproto"
  29. }
  30. data_param {
  31. source: "../../data/cifar10_test_lmdb"
  32. batch_size: 10
  33. backend: LMDB
  34. }
  35. }
  36. layer {
  37. name: "data_transformer"
  38. type: "DataTransformer"
  39. bottom: "data"
  40. top: "data"
  41. include {
  42. phase: TRAIN
  43. }
  44. data_transformer_l_param {
  45. delta1_sigma: 10.5
  46. delta2_sigma: 0.15
  47. delta3_sigma: 1.1 #2.4
  48. delta4_sigma: 1.1 #2.4
  49. rotate_angle_scope: 0.349 #20degree
  50. translation_w_scope: 16
  51. translation_h_scope: 16
  52. scale_w_scope: 1.2
  53. scale_h_scope: 1.2
  54. h_flip: true
  55. elastic_transform: false
  56. amplitude: 1
  57. radius: 1
  58. }
  59. }
  60. //.......