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.

17 lines
684 B

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #include "cpu.h"
  2. #include "../layers/activationLayer.h"
  3. void cpuHOST::forward_layer(activationLayer *layer, cortexSTATE state){
  4. if (state.input != NULL && layer->m_pOutput != NULL){
  5. makeCopy(layer->m_nOutputVol, state.input, 1, layer->m_pOutput, 1);
  6. makeActivatedArray(layer->m_pOutput, layer->m_nOutputVol, layer->m_eActivation);
  7. };
  8. };
  9. void cpuHOST::backward_layer(activationLayer *layer, cortexSTATE state){
  10. if (state.delta != NULL && layer->m_pOutput != NULL && layer->m_pDelta!= NULL){
  11. makeGradientArray(layer->m_pOutput, layer->m_nOutputVol, layer->m_eActivation, layer->m_pDelta);
  12. makeCopy(layer->m_nDeltaVol, layer->m_pDelta, 1, state.delta, 1);
  13. };
  14. };