Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
5.2 KiB

  1. /* *************************************************************************** */
  2. /* * NN ws programs * */
  3. /* *************************************************************************** */
  4. #ifndef SNN_HEADER_INCLUDED
  5. #define SNN_HEADER_INCLUDED
  6. #include "ams_mg.h"
  7. // ------------------- Defines -----------------------------------------------
  8. //#define PEGASUS
  9. #define MLP_LEARN_MODE 0
  10. #define MLP_EMULATE_INT 0
  11. #define MLP_BYTE_NET 0
  12. #ifdef SNN_FAT_NET_ON
  13. #define MLP_FAT_NET 1
  14. #else
  15. #define MLP_FAT_NET 0
  16. #endif
  17. #ifdef PEGASUS
  18. #ifndef MLP_PRELOAD_MODE
  19. #define MLP_PRELOAD_MODE 1
  20. #endif
  21. #define MLP_UPSCALE 1
  22. #define MLP_INT_MODE 1
  23. #else
  24. #ifndef MLP_PRELOAD_MODE
  25. #define MLP_PRELOAD_MODE 1
  26. #endif
  27. #define MLP_UPSCALE 1
  28. #define MLP_INT_MODE 1
  29. #endif
  30. #if MLP_FAT_NET
  31. #define NET_TYPE_ID ".fat"
  32. #else
  33. #define NET_TYPE_ID ".slim"
  34. #endif
  35. // ------------------- Defines -----------------------------------------------
  36. #ifdef FOR_FRENCH
  37. #define MLP_ID_STR "MLP.Network.V.4.12.f" NET_TYPE_ID
  38. #define MLP_NET_NUMOUTPUTS (92+24)
  39. #define MLP_NET_SYMCO "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" \
  40. "0123456789@#$%&!?*/+=-(){}[];:~\\<>^|" \
  41. "�� " /*"����" until next net, which will do better on these*/ \
  42. "������������" \
  43. "������������"
  44. #elif defined (FOR_GERMAN)
  45. #define MLP_ID_STR "MLP.Network.V.4.12.g" NET_TYPE_ID
  46. #define MLP_NET_NUMOUTPUTS (92+8)
  47. #define MLP_NET_SYMCO "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" \
  48. "0123456789@#$%&!?*/+=-(){}[];:~\\<>^|" \
  49. "�� " /*"����" until next net, which will do better on these*/ \
  50. "����" \
  51. "���\""
  52. #elif defined (FOR_INTERNATIONAL)
  53. #define MLP_ID_STR "MLP.Network.V.4.12.i" NET_TYPE_ID
  54. #define MLP_NET_NUMOUTPUTS (92+60)
  55. #define MLP_NET_SYMCO "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" \
  56. "0123456789@#$%&!?*/+=-(){}[];:~\\<>^|" \
  57. "�� " /*"����" until next net, which will do better on these*/ \
  58. "������������������������������" \
  59. "��������������������������ݟ��"
  60. #else
  61. #define MLP_ID_STR "MLP.Network.V.4.12.e" NET_TYPE_ID
  62. #define MLP_NET_NUMOUTPUTS 92
  63. #define MLP_NET_SYMCO "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" \
  64. "0123456789@#$%&!?*/+=-(){}[];:~\\<>^|" \
  65. "�� " /*"����" until next net, which will do better on these*/
  66. #endif
  67. #define MLP_COEF_SHARE 96
  68. #define MLP_BMP_SHARE 32
  69. #define MLP_NUM_CFF 32
  70. #define MLP_NUM_BMP (16*16)
  71. #define MLP_NET_NUMLAYERS 4
  72. #define MLP_NET_NUMINPUTS 288
  73. #define MLP_CELL_MAXINPUTS 32
  74. #define MLP_LAYER_MAXCELLS (MLP_NET_NUMOUTPUTS*MLP_CELL_MAXINPUTS)
  75. #if MLP_FAT_NET
  76. #define MLP_PREOUT_STEP 4
  77. #else
  78. #define MLP_PREOUT_STEP 2
  79. #endif
  80. #define MLP_NET_0L_NUMCELLS (MLP_NET_NUMINPUTS)
  81. #define MLP_NET_1L_NUMCELLS (MLP_COEF_SHARE+MLP_BMP_SHARE)
  82. #define MLP_NET_2L_NUMCELLS (MLP_NET_NUMOUTPUTS*MLP_PREOUT_STEP + (MLP_CELL_MAXINPUTS-MLP_PREOUT_STEP))
  83. #define MLP_NET_3L_NUMCELLS (MLP_NET_NUMOUTPUTS)
  84. #define MLP_NET_4L_NUMCELLS 0
  85. #define MLP_NET_NUMCELLS (MLP_NET_1L_NUMCELLS+MLP_NET_2L_NUMCELLS+MLP_NET_3L_NUMCELLS+MLP_NET_4L_NUMCELLS)
  86. #define MLP_NET_NUMSIGNALS (MLP_NET_0L_NUMCELLS+MLP_NET_1L_NUMCELLS+MLP_NET_2L_NUMCELLS+MLP_NET_3L_NUMCELLS+MLP_NET_4L_NUMCELLS)
  87. //#define MLP_NET_SYMCO_LONG "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%&*{}"
  88. // ------------------- Structures --------------------------------------------
  89. #if MLP_INT_MODE
  90. #if MLP_BYTE_NET
  91. typedef _SCHAR fint_c;
  92. typedef _UCHAR fint_s;
  93. #else
  94. typedef _SHORT fint_c;
  95. typedef _SHORT fint_s;
  96. #endif
  97. typedef _LONG flong;
  98. typedef fint_c * p_fint_c;
  99. typedef fint_s * p_fint_s;
  100. #else
  101. typedef float fint_c;
  102. typedef float fint_s;
  103. typedef float flong;
  104. typedef fint_c * p_fint_c;
  105. typedef fint_s * p_fint_s;
  106. #endif
  107. typedef struct {
  108. p_VOID net;
  109. fint_s signals[MLP_NET_NUMSIGNALS];
  110. } mlp_data_type, * p_mlp_data_type;
  111. // ------------------- Prototypes --------------------------------------------
  112. _INT InitSnnData(p_UCHAR name, p_mlp_data_type mlpd);
  113. _INT GetSnnResults(p_UCHAR pCoeff, p_UCHAR answs, p_mlp_data_type mlpd);
  114. int LoadNetData(p_mlp_data_type mlpd, p_CHAR net_name);
  115. int SaveNetData(p_mlp_data_type mlpd, p_CHAR net_name, float e);
  116. int DumpNetData(p_mlp_data_type mlpd, p_CHAR dmp_name, float e);
  117. #endif // SNN_HEADER_INCLUDED
  118. /* *************************************************************************** */
  119. /* * End of alll * */
  120. /* *************************************************************************** */
  121. //