- committed local changes git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@270 b431acfa-c32f-4a4a-93f1-934dc6c82436
38 lines
610 B
C++
38 lines
610 B
C++
/*
|
|
* HiddenLayer.hpp
|
|
*
|
|
* Created on: 21.09.2014
|
|
* Author: jens
|
|
*/
|
|
|
|
#ifndef HIDDENLAYER_HPP_
|
|
#define HIDDENLAYER_HPP_
|
|
|
|
#include "Layer.hpp"
|
|
#include <cmath>
|
|
|
|
class HiddenLayer : public Layer
|
|
{
|
|
public:
|
|
HiddenLayer(uint32_t numUnits = 0, const RowVectorXd *pStatesInit = nullptr)
|
|
: Layer(numUnits, pStatesInit)
|
|
{
|
|
}
|
|
|
|
virtual ~HiddenLayer()
|
|
{
|
|
}
|
|
|
|
private:
|
|
double accum(Layer &layer, Weights &weights, uint32_t index)
|
|
{
|
|
double sum = ((Weights&)weights).hiddenBias()[index];
|
|
|
|
sum += layer.states() * ((Weights&)weights).weights().col(index);
|
|
|
|
return sum;
|
|
}
|
|
};
|
|
|
|
#endif /* HIDDENLAYER_HPP_ */
|