- pulled LayerArray out of RbmComponent

git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@293 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2016-06-16 19:16:33 +00:00
parent 4dccddd50f
commit ff88a62e73
5 changed files with 56 additions and 64 deletions
+3 -13
View File
@@ -23,10 +23,9 @@
//==============================================================================
RbmComponent::RbmComponent (Weights &weights, RbmComponentListener &listener)
RbmComponent::RbmComponent (Weights &weights, MatrixXd const &batch, RbmComponentListener &listener)
: m_weights(weights)
, m_listener(listener)
, m_layers(this)
, m_currWeightIndexToDraw(0)
, m_currTrainingIndexToDraw(0)
, DrawTraining(nullptr)
@@ -36,7 +35,7 @@ RbmComponent::RbmComponent (Weights &weights, RbmComponentListener &listener)
{
//[UserPreSize]
m_pRbm = new Rbm(m_weights, m_layers.data(), this);
m_pRbm = new Rbm(m_weights, batch, this);
size_t vNumX = m_weights.getNumVisibleX();
size_t vNumY = m_weights.getNumVisibleY();
size_t hNum = m_weights.getNumHidden();
@@ -202,11 +201,6 @@ void RbmComponent::mouseWheelMove (const MouseEvent& e, const MouseWheelDetails&
//[/UserCode_mouseWheelMove]
}
void RbmComponent::onChanged(const LayerArray &obj)
{
m_listener.onLayerSizeChanged((size_t)obj.getSize());
}
void RbmComponent::onEpochTrained(const Rbm &obj)
{
// mylog("Training %f %%\n", obj.getProgress()*100);
@@ -246,12 +240,8 @@ void RbmComponent::redrawReconstruction()
void RbmComponent::redrawWeights()
{
VectorXd w = m_weights.weights().col(m_currWeightIndexToDraw);
DrawWeights->getData() = w;
DrawWeights->getData() = m_weights.weights().col(m_currWeightIndexToDraw);
DrawWeights->DrawData();
DrawVars->getData() = m_pRbm->getVariableSigma();
DrawVars->DrawData();
}
void RbmComponent::setDoLearnVariance(bool value)