- weightInit are construction time parameter
git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@593 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+3
-6
@@ -26,9 +26,8 @@ public:
|
||||
struct Params
|
||||
{
|
||||
Params()
|
||||
: weightInit(0.01)
|
||||
: learningRate(0.1)
|
||||
, weightDecay(0.0)
|
||||
, learningRate(0.1)
|
||||
, momentum(0.5)
|
||||
, doRaoBlackwell(true)
|
||||
, gibbsDoSampleVisible(false)
|
||||
@@ -42,7 +41,6 @@ public:
|
||||
{
|
||||
std::cout << "Exporting Rbm::Params" << std::endl;
|
||||
Json::Value params;
|
||||
params["weightInit"] = weightInit;
|
||||
params["weightDecay"] = weightDecay;
|
||||
params["learningRate"] = learningRate;
|
||||
params["momentum"] = momentum;
|
||||
@@ -57,7 +55,6 @@ public:
|
||||
|
||||
void fromJson(Json::Value params)
|
||||
{
|
||||
weightInit = params["weightInit"].asDouble();
|
||||
weightDecay = params["weightDecay"].asDouble();
|
||||
learningRate = params["learningRate"].asDouble();
|
||||
momentum = params["momentum"].asDouble();
|
||||
@@ -68,7 +65,6 @@ public:
|
||||
numGibbs = params["numGibbs"].asUInt();
|
||||
}
|
||||
|
||||
double weightInit;
|
||||
double weightDecay;
|
||||
double learningRate;
|
||||
double momentum;
|
||||
@@ -112,7 +108,7 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
Rbm(size_t numVisible, size_t numHidden);
|
||||
Rbm(size_t numVisible, size_t numHidden, double weightInit=0.01);
|
||||
Rbm(const Rbm& orig);
|
||||
virtual ~Rbm();
|
||||
|
||||
@@ -132,6 +128,7 @@ public:
|
||||
|
||||
private:
|
||||
const Params m_params;
|
||||
double m_weightInit;
|
||||
arma::mat sample(arma::mat const &src);
|
||||
static arma::mat probsLogistic(arma::mat const &src);
|
||||
void uniform(arma::mat &srcDst, double mu=0.0, double stdDev=1.0);
|
||||
|
||||
Reference in New Issue
Block a user