[RBM]
- GUI: added gaussian hidden, added mini batch size - Rbm: added mini batch training revised sample functions, reverted to old weight decay git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@305 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
+10
-3
@@ -29,6 +29,7 @@ public:
|
||||
, m_muSparsity(0.01)
|
||||
, m_momentum(0.5)
|
||||
, m_useVisibleGaussian(false)
|
||||
, m_useHiddenGaussian(false)
|
||||
, m_doRaoBlackwell(true)
|
||||
, m_doSampleVisible(false)
|
||||
, m_doSampleBatch(false)
|
||||
@@ -36,6 +37,7 @@ public:
|
||||
, m_doNormalizeData(false)
|
||||
, m_doLearnVariance(false)
|
||||
, m_numGibbs(1)
|
||||
, m_miniBatchSize(100)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -48,6 +50,7 @@ public:
|
||||
double m_muSparsity;
|
||||
double m_momentum;
|
||||
bool m_useVisibleGaussian;
|
||||
bool m_useHiddenGaussian;
|
||||
bool m_doRaoBlackwell;
|
||||
bool m_doSampleVisible;
|
||||
bool m_doSampleBatch;
|
||||
@@ -55,6 +58,7 @@ public:
|
||||
bool m_doNormalizeData;
|
||||
bool m_doLearnVariance;
|
||||
size_t m_numGibbs;
|
||||
size_t m_miniBatchSize;
|
||||
};
|
||||
|
||||
Rbm(Weights &weights, const MatrixXd &batch);
|
||||
@@ -68,7 +72,8 @@ public:
|
||||
static void probsGaussian(MatrixXd &src, const MatrixXd &sigma);
|
||||
static void probsGaussian(RowVectorXd &src, const RowVectorXd &sigma);
|
||||
void sampleGaussian(MatrixXd &dst, MatrixXd const &src, const MatrixXd &sigma);
|
||||
void sampleGaussian(MatrixXd &src, const MatrixXd &sigma);
|
||||
void sampleGaussian(MatrixXd &srcDst, const MatrixXd &sigma);
|
||||
void sampleGaussian(MatrixXd &srcDst, const double &sigma);
|
||||
RowVectorXd normalizeData(RowVectorXd const &src, RowVectorXd const &mu, RowVectorXd const &var);
|
||||
RowVectorXd calcMean(MatrixXd const &batch);
|
||||
RowVectorXd calcSigma(MatrixXd const &batch);
|
||||
@@ -85,6 +90,7 @@ public:
|
||||
void setLambda(double value);
|
||||
void setSparsity(double value);
|
||||
void setUseVisibleGaussian(bool flag);
|
||||
void setUseHiddenGaussian(bool flag);
|
||||
void setDoRaoBlackwell(bool flag);
|
||||
void setDoSampleVisible(bool flag);
|
||||
void setDoSampleBatch(bool flag);
|
||||
@@ -92,11 +98,11 @@ public:
|
||||
void setNormalizeData(bool flag);
|
||||
void setDoLearnVariance(bool flag);
|
||||
void setNumGibbs(size_t value);
|
||||
void setMiniBatchSize(size_t size);
|
||||
void setMuWeights(double value);
|
||||
void setMuSparsity(double value);
|
||||
void setMomentum(double value);
|
||||
MatrixXd const& getHiddenBatch();
|
||||
MatrixXd const& getVisibleBatch();
|
||||
MatrixXd const& getBatch();
|
||||
void updateHiddenBatch();
|
||||
Params const& params();
|
||||
@@ -104,12 +110,13 @@ public:
|
||||
private:
|
||||
Weights &m_w;
|
||||
MatrixXd const &m_batch;
|
||||
MatrixXd m_v;
|
||||
MatrixXd m_h;
|
||||
RowVectorXd m_variableSigma;
|
||||
noise_gen_t m_noise;
|
||||
double m_progress;
|
||||
Params m_params;
|
||||
void noiseGaussian(MatrixXd &dst);
|
||||
void noiseUniform(MatrixXd &dst);
|
||||
|
||||
protected:
|
||||
virtual void onProgressChanged()
|
||||
|
||||
Reference in New Issue
Block a user