Layer_def.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /* Layer_def.h
  2. *
  3. * Copyright (C) 2017-2018 Paul Boersma
  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.
  13. * See the GNU 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. #define ooSTRUCT Layer
  19. oo_DEFINE_CLASS (Layer, Daata)
  20. oo_INTEGER (numberOfInputNodes)
  21. oo_VEC (inputActivities, numberOfInputNodes)
  22. oo_INTEGER (numberOfOutputNodes)
  23. oo_VEC (outputActivities, numberOfOutputNodes)
  24. #if oo_DECLARING
  25. virtual void v_spreadUp (kLayer_activationType) { }
  26. virtual void v_sampleInput () { }
  27. virtual void v_spreadDown (kLayer_activationType) { }
  28. virtual void v_spreadDown_reconstruction () { }
  29. virtual void v_spreadUp_reconstruction () { }
  30. virtual void v_update (double /* learningRate */) { }
  31. virtual autoMatrix v_extractInputReconstruction () { return autoMatrix (); }
  32. virtual autoMatrix v_extractOutputReconstruction () { return autoMatrix (); }
  33. virtual autoMatrix v_extractInputBiases () { return autoMatrix (); }
  34. virtual autoMatrix v_extractOutputBiases () { return autoMatrix (); }
  35. virtual autoMatrix v_extractWeights () { return autoMatrix (); }
  36. virtual autoMAT v_getWeights () { return autoMAT (); }
  37. #endif
  38. oo_END_CLASS (Layer)
  39. #undef ooSTRUCT
  40. /* End of file Layer_def.h */