- refactored
- constify
This commit is contained in:
+10
-10
@@ -224,15 +224,15 @@ void RbmComponent::onDraw(DrawComponent &obj)
|
||||
{
|
||||
if (&obj == DrawHidden)
|
||||
{
|
||||
m_stack.downPass(id(), obj.getData());
|
||||
m_stack.downPass(this, obj.getData());
|
||||
}
|
||||
if (&obj == DrawVisibleTrain)
|
||||
{
|
||||
m_stack.upDownPass(id(), getTraining());
|
||||
m_stack.upDownPass(this, getTraining());
|
||||
}
|
||||
if (&obj == DrawContextTrain)
|
||||
{
|
||||
m_stack.upDownPass(id(), getTraining());
|
||||
m_stack.upDownPass(this, getTraining());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ void RbmComponent::buttonClicked(Button* buttonThatWasClicked)
|
||||
if (m_numContext)
|
||||
{
|
||||
DrawContextTrain->getData() = DrawHidden->getData();
|
||||
m_stack.upDownPass(id(), getTraining());
|
||||
m_stack.upDownPass(this, getTraining());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -274,7 +274,7 @@ void RbmComponent::buttonClicked(Button* buttonThatWasClicked)
|
||||
void RbmComponent::redrawReconstruction()
|
||||
{
|
||||
RbmComponent *pComp = static_cast<RbmComponent*> (root());
|
||||
m_stack.upDownPass(pComp->id(), pComp->getTraining());
|
||||
m_stack.upDownPass(pComp, pComp->getTraining());
|
||||
}
|
||||
|
||||
arma::mat RbmComponent::getTraining() const
|
||||
@@ -287,7 +287,7 @@ arma::mat RbmComponent::getReconst() const
|
||||
return arma::join_rows(DrawVisibleReconst->getData(), DrawContextReconst->getData());
|
||||
}
|
||||
|
||||
void RbmComponent::trainRedraw(const arma::mat& vc)
|
||||
void RbmComponent::trainRedraw(const arma::mat& vc) const
|
||||
{
|
||||
DrawVisibleTrain->getData() = vc_to_v(vc);
|
||||
DrawContextTrain->getData() = vc_to_c(vc);
|
||||
@@ -295,7 +295,7 @@ void RbmComponent::trainRedraw(const arma::mat& vc)
|
||||
DrawContextTrain->DrawData();
|
||||
}
|
||||
|
||||
void RbmComponent::reconstRedraw(const arma::mat& vc)
|
||||
void RbmComponent::reconstRedraw(const arma::mat& vc) const
|
||||
{
|
||||
DrawVisibleReconst->getData() = vc_to_v(vc);
|
||||
DrawContextReconst->getData() = vc_to_c(vc);
|
||||
@@ -303,7 +303,7 @@ void RbmComponent::reconstRedraw(const arma::mat& vc)
|
||||
DrawContextReconst->DrawData();
|
||||
}
|
||||
|
||||
void RbmComponent::onUpPass(const arma::mat& v)
|
||||
void RbmComponent::onUpPass(const arma::mat& v) const
|
||||
{
|
||||
DrawVisibleTrain->getData() = vc_to_v(v);
|
||||
DrawVisibleTrain->DrawData();
|
||||
@@ -312,7 +312,7 @@ void RbmComponent::onUpPass(const arma::mat& v)
|
||||
trainRedraw(v);
|
||||
}
|
||||
|
||||
void RbmComponent::onDownPass(const arma::mat& h)
|
||||
void RbmComponent::onDownPass(const arma::mat& h) const
|
||||
{
|
||||
DrawHidden->getData() = h;
|
||||
DrawHidden->DrawData();
|
||||
@@ -349,7 +349,7 @@ void RbmComponent::redrawWeights(size_t index)
|
||||
void RbmComponent::setTrainingData(arma::mat const& batch)
|
||||
{
|
||||
RbmComponent *pComp = static_cast<RbmComponent*> (root());
|
||||
m_stack.upDownPass(id(), batch);
|
||||
m_stack.upDownPass(this, batch);
|
||||
}
|
||||
//[/MiscUserCode]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user