FFNet_def.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /* FFNet_def.h
  2. *
  3. * Copyright (C) 1994-2008 David Weenink
  4. *
  5. * This code is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or (at
  8. * your option) any later version.
  9. *
  10. * This code is distributed in the hope that it will be useful, but
  11. * WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this work. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /*
  19. djmw 19961104
  20. djmw 20020712 GPL header
  21. djmw 20060529 Added version number to oo_Collection
  22. djmw 20080122 float -> double
  23. */
  24. #define ooSTRUCT FFNet
  25. oo_DEFINE_CLASS (FFNet, Daata)
  26. oo_INTEGER (nLayers) /* number of layers */
  27. oo_INTEGER_VECTOR_FROM (nUnitsInLayer, 0, nLayers)
  28. oo_INT (outputsAreLinear)
  29. oo_INT (nonLinearityType)
  30. oo_INT (costFunctionType)
  31. oo_COLLECTION (Categories, outputCategories, SimpleString, 0)
  32. oo_INTEGER (nWeights) /* number of weights */
  33. oo_DOUBLE_VECTOR (w, nWeights)
  34. #if ! oo_READING && ! oo_WRITING && ! oo_COMPARING
  35. oo_INTEGER (nNodes)
  36. oo_INTEGER (nInputs)
  37. oo_INTEGER (nOutputs)
  38. oo_INTEGER (dimension)
  39. #if oo_DECLARING
  40. double (*nonLinearity) (FFNet /* me */, double /* x */, double * /* deriv */);
  41. void *nlClosure;
  42. double (*costFunction) (FFNet /* me */, const double * /* target */);
  43. void *cfClosure;
  44. #endif
  45. #if oo_DECLARING
  46. oo_DOUBLE (accumulatedCost)
  47. oo_INTEGER (nPatterns)
  48. oo_INTEGER (currentPattern)
  49. double **inputPattern, **targetActivation;
  50. #endif
  51. #if oo_DECLARING || oo_DESTROYING
  52. oo_OBJECT (Minimizer, 0, minimizer)
  53. #endif
  54. oo_DOUBLE_VECTOR (activity, nNodes)
  55. oo_INTEGER_VECTOR (isbias, nNodes)
  56. oo_INTEGER_VECTOR (nodeFirst, nNodes)
  57. oo_INTEGER_VECTOR (nodeLast, nNodes)
  58. oo_INTEGER_VECTOR (wFirst, nNodes)
  59. oo_INTEGER_VECTOR (wLast, nNodes)
  60. oo_DOUBLE_VECTOR (deriv, nNodes)
  61. oo_DOUBLE_VECTOR (error, nNodes)
  62. oo_INTEGER_VECTOR (wSelected, nWeights)
  63. oo_DOUBLE_VECTOR (dw, nWeights)
  64. oo_DOUBLE_VECTOR (dwi, nWeights)
  65. #endif
  66. #if oo_READING
  67. bookkeeping (this);
  68. FFNet_setNonLinearity (this, nonLinearityType);
  69. FFNet_setCostFunction (this, costFunctionType);
  70. #endif
  71. #if oo_COPYING
  72. thy nonLinearity = our nonLinearity;
  73. thy nlClosure = our nlClosure;
  74. thy costFunction = our costFunction;
  75. thy cfClosure = our cfClosure;
  76. #endif
  77. #if oo_DECLARING
  78. void v_info ()
  79. override;
  80. #endif
  81. oo_END_CLASS (FFNet)
  82. #undef ooSTRUCT
  83. /* End of file FFNet_def.h */