You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

config.py 3.7 kB

4 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  1. # Copyright 2020 Huawei Technologies Co., Ltd
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. #" :===========================================================================
  15. """
  16. network config setting, will be used in train.py and eval.py
  17. """
  18. from easydict import EasyDict as ed
  19. config_yelpp = ed({
  20. 'vocab_size': 6414979,
  21. 'buckets': [64, 128, 256, 512, 2955],
  22. 'test_buckets': [64, 128, 256, 512, 2955],
  23. 'batch_size': 2048,
  24. 'embedding_dims': 16,
  25. 'num_class': 2,
  26. 'epoch': 5,
  27. 'lr': 0.30,
  28. 'min_lr': 1e-6,
  29. 'decay_steps': 549,
  30. 'warmup_steps': 400000,
  31. 'poly_lr_scheduler_power': 0.5,
  32. 'epoch_count': 1,
  33. 'pretrain_ckpt_dir': None,
  34. 'save_ckpt_steps': 549,
  35. 'keep_ckpt_max': 10,
  36. })
  37. config_db = ed({
  38. 'vocab_size': 6596536,
  39. 'buckets': [64, 128, 256, 512, 3013],
  40. 'test_buckets': [64, 128, 256, 512, 1120],
  41. 'batch_size': 4096,
  42. 'embedding_dims': 16,
  43. 'num_class': 14,
  44. 'epoch': 5,
  45. 'lr': 0.8,
  46. 'min_lr': 1e-6,
  47. 'decay_steps': 549,
  48. 'warmup_steps': 400000,
  49. 'poly_lr_scheduler_power': 0.5,
  50. 'epoch_count': 1,
  51. 'pretrain_ckpt_dir': None,
  52. 'save_ckpt_steps': 548,
  53. 'keep_ckpt_max': 10,
  54. })
  55. config_ag = ed({
  56. 'vocab_size': 1383812,
  57. 'buckets': [64, 128, 467],
  58. 'test_buckets': [467],
  59. 'batch_size': 512,
  60. 'embedding_dims': 16,
  61. 'num_class': 4,
  62. 'epoch': 5,
  63. 'lr': 0.2,
  64. 'min_lr': 1e-6,
  65. 'decay_steps': 115,
  66. 'warmup_steps': 400000,
  67. 'poly_lr_scheduler_power': 0.001,
  68. 'epoch_count': 1,
  69. 'pretrain_ckpt_dir': None,
  70. 'save_ckpt_steps': 116,
  71. 'keep_ckpt_max': 10,
  72. })
  73. config_yelpp_gpu = ed({
  74. 'vocab_size': 6414979,
  75. 'buckets': [64, 128, 256, 512, 2955],
  76. 'test_buckets': [64, 128, 256, 512, 2955],
  77. 'batch_size': 2048,
  78. 'distribute_batch_size': 512,
  79. 'embedding_dims': 16,
  80. 'num_class': 2,
  81. 'epoch': 5,
  82. 'lr': 0.30,
  83. 'min_lr': 1e-6,
  84. 'decay_steps': 549,
  85. 'warmup_steps': 400000,
  86. 'poly_lr_scheduler_power': 0.5,
  87. 'epoch_count': 1,
  88. 'pretrain_ckpt_dir': None,
  89. 'save_ckpt_steps': 549,
  90. 'keep_ckpt_max': 10,
  91. })
  92. config_db_gpu = ed({
  93. 'vocab_size': 6596536,
  94. 'buckets': [64, 128, 256, 512, 3013],
  95. 'test_buckets': [64, 128, 256, 512, 1120],
  96. 'batch_size': 4096,
  97. 'distribute_batch_size': 512,
  98. 'embedding_dims': 16,
  99. 'num_class': 14,
  100. 'epoch': 5,
  101. 'lr': 0.8,
  102. 'min_lr': 1e-6,
  103. 'decay_steps': 549,
  104. 'warmup_steps': 400000,
  105. 'poly_lr_scheduler_power': 0.5,
  106. 'epoch_count': 1,
  107. 'pretrain_ckpt_dir': None,
  108. 'save_ckpt_steps': 548,
  109. 'keep_ckpt_max': 10,
  110. })
  111. config_ag_gpu = ed({
  112. 'vocab_size': 1383812,
  113. 'buckets': [64, 128, 467],
  114. 'test_buckets': [467],
  115. 'batch_size': 512,
  116. 'distribute_batch_size': 64,
  117. 'embedding_dims': 16,
  118. 'num_class': 4,
  119. 'epoch': 5,
  120. 'lr': 0.2,
  121. 'min_lr': 1e-6,
  122. 'decay_steps': 115,
  123. 'warmup_steps': 400000,
  124. 'poly_lr_scheduler_power': 0.001,
  125. 'epoch_count': 1,
  126. 'pretrain_ckpt_dir': None,
  127. 'save_ckpt_steps': 116,
  128. 'keep_ckpt_max': 10,
  129. })