- refactored
- constify
This commit is contained in:
+25
-9
@@ -26,6 +26,7 @@ AStack::AStack(StackType type, const std::string &name)
|
||||
: m_name(name)
|
||||
, m_type(type)
|
||||
, m_pLayers(nullptr)
|
||||
, m_numLayers(0)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -50,16 +51,9 @@ void AStack::setName(const std::string& name)
|
||||
m_name = name;
|
||||
}
|
||||
|
||||
size_t AStack::numLayers()
|
||||
size_t AStack::numLayers() const
|
||||
{
|
||||
size_t count = 0;
|
||||
Layer *pLayer = m_pLayers;
|
||||
while(pLayer)
|
||||
{
|
||||
count++;
|
||||
pLayer = pLayer->next;
|
||||
}
|
||||
return count;
|
||||
return m_numLayers;
|
||||
}
|
||||
|
||||
void AStack::addLayer(Layer *pOtherLayer)
|
||||
@@ -79,6 +73,7 @@ void AStack::addLayer(Layer *pOtherLayer)
|
||||
pLayer->next = pOtherLayer;
|
||||
pOtherLayer->prev = pLayer;
|
||||
}
|
||||
updateNumLayers();
|
||||
}
|
||||
|
||||
void AStack::delLayer(Layer* pLayer)
|
||||
@@ -86,6 +81,17 @@ void AStack::delLayer(Layer* pLayer)
|
||||
assert(!"Stack::delLayer: Not implemented!");
|
||||
}
|
||||
|
||||
void AStack::updateNumLayers()
|
||||
{
|
||||
m_numLayers = 0;
|
||||
Layer *pLayer = m_pLayers;
|
||||
while(pLayer)
|
||||
{
|
||||
m_numLayers++;
|
||||
pLayer = pLayer->next;
|
||||
}
|
||||
}
|
||||
|
||||
Layer* AStack::getLayer(size_t layerId) const
|
||||
{
|
||||
Layer *pLayer = m_pLayers;
|
||||
@@ -101,6 +107,16 @@ Layer* AStack::getLayer(size_t layerId) const
|
||||
|
||||
}
|
||||
|
||||
Layer* AStack::getFirstLayer() const
|
||||
{
|
||||
return getLayer(0);
|
||||
}
|
||||
|
||||
Layer* AStack::getLastLayer() const
|
||||
{
|
||||
return getLayer(numLayers()-1);
|
||||
}
|
||||
|
||||
bool AStack::save(const std::string &dir)
|
||||
{
|
||||
return StackCreator::toFile(this, dir, m_name);
|
||||
|
||||
+5
-1
@@ -53,7 +53,7 @@ public:
|
||||
|
||||
StackType type();
|
||||
void setName(const std::string &name);
|
||||
size_t numLayers();
|
||||
size_t numLayers() const;
|
||||
virtual size_t numContext()
|
||||
{
|
||||
return 0;
|
||||
@@ -62,6 +62,8 @@ public:
|
||||
void delLayer(Layer *pLayer);
|
||||
|
||||
Layer* getLayer(size_t layerId) const;
|
||||
Layer* getFirstLayer() const;
|
||||
Layer* getLastLayer() const;
|
||||
|
||||
bool save(const std::string &dir);
|
||||
|
||||
@@ -85,6 +87,8 @@ protected:
|
||||
|
||||
private:
|
||||
arma::mat m_trainingBatch;
|
||||
size_t m_numLayers;
|
||||
void updateNumLayers();
|
||||
|
||||
};
|
||||
|
||||
|
||||
+18
-37
@@ -24,18 +24,18 @@ DeepStack::~DeepStack()
|
||||
{
|
||||
}
|
||||
|
||||
arma::mat DeepStack::trainingBatchFrom(size_t layerId, const arma::mat& batch)
|
||||
arma::mat DeepStack::trainingBatchFrom(Layer *pLayer, const arma::mat& batch)
|
||||
{
|
||||
arma::mat thisBatch = batch;
|
||||
Layer *pLayer = getLayer(0);
|
||||
while (pLayer)
|
||||
Layer *pLayerForward = getFirstLayer();
|
||||
while (pLayerForward)
|
||||
{
|
||||
if (pLayer->id() == layerId)
|
||||
if (pLayerForward == pLayer)
|
||||
{
|
||||
break;
|
||||
}
|
||||
thisBatch = pLayer->toHiddenProbs(thisBatch);
|
||||
pLayer = pLayer->next;
|
||||
thisBatch = pLayerForward->toHiddenProbs(thisBatch);
|
||||
pLayerForward = pLayerForward->next;
|
||||
}
|
||||
return thisBatch;
|
||||
}
|
||||
@@ -43,48 +43,21 @@ arma::mat DeepStack::trainingBatchFrom(size_t layerId, const arma::mat& batch)
|
||||
void DeepStack::train(const arma::mat& batch, Rbm::IListener* pListener)
|
||||
{
|
||||
arma::mat thisBatch = batch;
|
||||
Layer *pLayer = getLayer(0);
|
||||
Layer *pLayer = getFirstLayer();
|
||||
while (pLayer)
|
||||
{
|
||||
thisBatch = trainingBatchFrom(pLayer->id(), thisBatch);
|
||||
thisBatch = trainingBatchFrom(pLayer, thisBatch);
|
||||
pLayer->train(thisBatch, pListener);
|
||||
pLayer = pLayer->next;
|
||||
}
|
||||
}
|
||||
|
||||
void DeepStack::train(size_t layerId, const arma::mat& batch, Rbm::IListener* pListener)
|
||||
void DeepStack::train(Layer *pLayer, const arma::mat& batch, Rbm::IListener* pListener)
|
||||
{
|
||||
arma::mat thisBatch = batch;
|
||||
Layer *pLayer = getLayer(0);
|
||||
while (pLayer)
|
||||
{
|
||||
if (pLayer->id() == layerId)
|
||||
{
|
||||
break;
|
||||
}
|
||||
thisBatch = pLayer->toHiddenProbs(thisBatch);
|
||||
pLayer = pLayer->next;
|
||||
}
|
||||
arma::mat thisBatch = trainingBatchFrom(pLayer, batch);
|
||||
pLayer->train(thisBatch, pListener);
|
||||
}
|
||||
|
||||
arma::mat DeepStack::upPass(size_t layerId, const arma::mat& v)
|
||||
{
|
||||
return upPass(getLayer(layerId), v);
|
||||
}
|
||||
|
||||
arma::mat DeepStack::downPass(size_t layerId, const arma::mat& h)
|
||||
{
|
||||
return downPass(getLayer(layerId), h);
|
||||
}
|
||||
|
||||
arma::mat DeepStack::upDownPass(size_t layerId, const arma::mat& v)
|
||||
{
|
||||
arma::mat h = upPass(layerId, v);
|
||||
arma::mat r = downPass(numLayers()-1, h);
|
||||
return r;
|
||||
}
|
||||
|
||||
arma::mat DeepStack::upPass(Layer *pLayer, arma::mat const &v)
|
||||
{
|
||||
arma::mat h = v;
|
||||
@@ -112,3 +85,11 @@ arma::mat DeepStack::downPass(Layer *pLayer, arma::mat const &h)
|
||||
}
|
||||
return v;
|
||||
}
|
||||
|
||||
arma::mat DeepStack::upDownPass(Layer *pLayer, const arma::mat& v)
|
||||
{
|
||||
arma::mat h = upPass(pLayer, v);
|
||||
arma::mat r = downPass(getLastLayer(), h);
|
||||
return r;
|
||||
}
|
||||
|
||||
|
||||
@@ -29,16 +29,13 @@ public:
|
||||
virtual ~DeepStack();
|
||||
|
||||
void train(const arma::mat& batch, Rbm::IListener* pListener) override;
|
||||
arma::mat trainingBatchFrom(size_t layerId, const arma::mat& batch);
|
||||
void train(size_t layerId, const arma::mat& batch, Rbm::IListener* pListener);
|
||||
|
||||
arma::mat upPass(size_t layerId, arma::mat const &v);
|
||||
arma::mat downPass(size_t layerId, arma::mat const &h);
|
||||
arma::mat upDownPass(size_t layerId, arma::mat const &v);
|
||||
void train(Layer *pLayer, const arma::mat& batch, Rbm::IListener* pListener);
|
||||
|
||||
arma::mat trainingBatchFrom(Layer *pLayer, const arma::mat& batch);
|
||||
|
||||
arma::mat upPass(Layer *pLayer, arma::mat const &v);
|
||||
arma::mat upDownPass(Layer *pLayer, const arma::mat& v);
|
||||
arma::mat downPass(Layer *pLayer, arma::mat const &h);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
+2
-2
@@ -89,7 +89,7 @@ Layer* Layer::root()
|
||||
return pLayer;
|
||||
}
|
||||
|
||||
arma::mat Layer::to_h_gibbs(const arma::mat& v_probs)
|
||||
arma::mat Layer::to_h_gibbs(const arma::mat& v_probs) const
|
||||
{
|
||||
onUpPass(v_probs);
|
||||
|
||||
@@ -99,7 +99,7 @@ arma::mat Layer::to_h_gibbs(const arma::mat& v_probs)
|
||||
return h;
|
||||
}
|
||||
|
||||
arma::mat Layer::to_v_gibbs(const arma::mat& h_probs)
|
||||
arma::mat Layer::to_v_gibbs(const arma::mat& h_probs) const
|
||||
{
|
||||
onDownPass(h_probs);
|
||||
|
||||
|
||||
+4
-4
@@ -51,8 +51,8 @@ public:
|
||||
void calcContextBatch(arma::mat &batch);
|
||||
void train(arma::mat const &batch, IListener *pListener=nullptr);
|
||||
|
||||
arma::mat to_h_gibbs(const arma::mat& v_probs);
|
||||
arma::mat to_v_gibbs(const arma::mat& h_probs);
|
||||
arma::mat to_h_gibbs(const arma::mat& v_probs) const;
|
||||
arma::mat to_v_gibbs(const arma::mat& h_probs) const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -67,8 +67,8 @@ protected:
|
||||
size_t m_numVisibleY;
|
||||
size_t m_numContext;
|
||||
|
||||
virtual void onUpPass(const arma::mat& v) {}
|
||||
virtual void onDownPass(const arma::mat& h) {}
|
||||
virtual void onUpPass(const arma::mat& v)const {}
|
||||
virtual void onDownPass(const arma::mat& h) const {}
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -685,8 +685,13 @@ void MainComponent::sliderValueChanged (Slider* sliderThatWasMoved)
|
||||
if (sliderThatWasMoved == patterSlider)
|
||||
{
|
||||
//[UserSliderCode_patterSlider] -- add your slider handling code here..
|
||||
m_trainingIndex = (int)sliderThatWasMoved->getValue();
|
||||
m_stack->upDownPass(m_pLayer->id(), m_stack->trainingBatchFrom(m_pLayer->id(), trainingAt(m_trainingIndex)));
|
||||
|
||||
size_t trainingIndex = (size_t)sliderThatWasMoved->getValue();
|
||||
if (trainingIndex < m_stack->numTraining())
|
||||
{
|
||||
m_trainingIndex = trainingIndex;
|
||||
m_stack->upDownPass(m_pLayer, m_stack->trainingBatchFrom(m_pLayer, trainingAt(m_trainingIndex)));
|
||||
}
|
||||
//[/UserSliderCode_patterSlider]
|
||||
}
|
||||
else if (sliderThatWasMoved == WeightsSlider)
|
||||
@@ -822,7 +827,7 @@ void MainComponent::comboBoxChanged (ComboBox* comboBoxThatHasChanged)
|
||||
m_pLayer->redrawWeights(m_weightIndex);
|
||||
if (m_stack->trainingBatch().n_rows > 0)
|
||||
{
|
||||
m_stack->upDownPass(index, m_stack->trainingBatchFrom(index, trainingAt(m_trainingIndex)));
|
||||
m_stack->upDownPass(m_pLayer, m_stack->trainingBatchFrom(m_pLayer, trainingAt(m_trainingIndex)));
|
||||
}
|
||||
//[/UserComboBoxCode_m_rbmSelect]
|
||||
}
|
||||
@@ -906,7 +911,7 @@ void MainComponent::run()
|
||||
{
|
||||
trainButton->setButtonText (TRANS("Stop"));
|
||||
m_pLayer->calcContextBatch(m_stack->trainingBatch());
|
||||
m_stack->train(m_pLayer->id(), m_stack->trainingBatch(), this);
|
||||
m_stack->train(m_pLayer, m_stack->trainingBatch(), this);
|
||||
trainButton->setButtonText (TRANS("Train"));
|
||||
}
|
||||
|
||||
@@ -922,7 +927,7 @@ bool MainComponent::onProgress(Rbm *pRbm, const Rbm::Status &status)
|
||||
}
|
||||
|
||||
RbmComponent *pComp = static_cast<RbmComponent*>(pRbm);
|
||||
m_stack->upPass(pComp->id(), pComp->getTraining());
|
||||
m_stack->upPass(pComp, pComp->getTraining());
|
||||
// pComp->upPass(pComp->getTraining());
|
||||
pComp->redrawReconstruction();
|
||||
pComp->redrawWeights();
|
||||
|
||||
@@ -86,8 +86,8 @@ private:
|
||||
static const size_t DBN_SIZE = 4;
|
||||
ScopedPointer<DeepStack> m_stack;
|
||||
RbmComponent *m_pLayer;
|
||||
int m_weightIndex;
|
||||
int m_trainingIndex;
|
||||
size_t m_weightIndex;
|
||||
size_t m_trainingIndex;
|
||||
void save();
|
||||
const juce::String& getBaseDir();
|
||||
void run();
|
||||
|
||||
+2
-2
@@ -104,7 +104,7 @@ Json::Value Rbm::toJson() const
|
||||
return rbm;
|
||||
}
|
||||
|
||||
void Rbm::gibbs_vh(arma::mat &v_probs, arma::mat &h_probs)
|
||||
void Rbm::gibbs_vh(arma::mat &v_probs, arma::mat &h_probs) const
|
||||
{
|
||||
for (int i=0; i < m_params.numGibbs; i++)
|
||||
{
|
||||
@@ -116,7 +116,7 @@ void Rbm::gibbs_vh(arma::mat &v_probs, arma::mat &h_probs)
|
||||
}
|
||||
}
|
||||
|
||||
void Rbm::gibbs_hv(arma::mat &h_probs, arma::mat &v_probs)
|
||||
void Rbm::gibbs_hv(arma::mat &h_probs, arma::mat &v_probs) const
|
||||
{
|
||||
for (int i=0; i < m_params.numGibbs; i++)
|
||||
{
|
||||
|
||||
+2
-2
@@ -141,8 +141,8 @@ public:
|
||||
arma::mat h_to_v(const arma::mat &hidden) const;
|
||||
static arma::mat prob(arma::mat const &src);
|
||||
|
||||
void gibbs_hv(arma::mat &h_probs, arma::mat &v_probs);
|
||||
void gibbs_vh(arma::mat &v_probs, arma::mat &h_probs);
|
||||
void gibbs_hv(arma::mat &h_probs, arma::mat &v_probs) const;
|
||||
void gibbs_vh(arma::mat &v_probs, arma::mat &h_probs) const;
|
||||
|
||||
static double rms_error_accu(arma::mat diffErr);
|
||||
static arma::mat rms_error(arma::mat diffErr);
|
||||
|
||||
+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]
|
||||
|
||||
|
||||
@@ -73,8 +73,8 @@ public:
|
||||
ScopedPointer<DrawComponent> DrawContextTrain;
|
||||
arma::mat getTraining() const;
|
||||
arma::mat getReconst() const;
|
||||
void trainRedraw(const arma::mat& vc);
|
||||
void reconstRedraw(const arma::mat& vc);
|
||||
void trainRedraw(const arma::mat& vc) const;
|
||||
void reconstRedraw(const arma::mat& vc) const;
|
||||
|
||||
private:
|
||||
//[UserVariables] -- You can add your own custom variables in this section.
|
||||
@@ -84,8 +84,8 @@ private:
|
||||
ScopedPointer<ToggleButton> m_toggleEnable;
|
||||
ScopedPointer<TextButton> m_buttonCopyH2C;
|
||||
|
||||
void onUpPass(const arma::mat& v) override;
|
||||
void onDownPass(const arma::mat& h) override;
|
||||
void onUpPass(const arma::mat& v) const override;
|
||||
void onDownPass(const arma::mat& h) const override;
|
||||
|
||||
DeepStack &m_stack;
|
||||
size_t m_currWeightIndexToDraw;
|
||||
|
||||
@@ -212,15 +212,15 @@ void RnnComponentLayer::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());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -252,14 +252,14 @@ void RnnComponentLayer::buttonClicked(Button* buttonThatWasClicked)
|
||||
else if (buttonThatWasClicked == m_buttonCopyH2C)
|
||||
{
|
||||
DrawContextTrain->getData() = DrawHidden->getData();
|
||||
m_stack.upDownPass(id(), getTraining());
|
||||
m_stack.upDownPass(this, getTraining());
|
||||
}
|
||||
}
|
||||
|
||||
void RnnComponentLayer::redrawReconstruction()
|
||||
{
|
||||
RnnComponentLayer *pComp = static_cast<RnnComponentLayer*> (root());
|
||||
m_stack.upDownPass(pComp->id(), pComp->getTraining());
|
||||
m_stack.upDownPass(pComp, pComp->getTraining());
|
||||
}
|
||||
|
||||
arma::mat RnnComponentLayer::getTraining() const
|
||||
@@ -272,7 +272,7 @@ arma::mat RnnComponentLayer::getReconst() const
|
||||
return arma::join_rows(DrawVisibleReconst->getData(), DrawContextReconst->getData());
|
||||
}
|
||||
|
||||
void RnnComponentLayer::trainRedraw(const arma::mat& vc)
|
||||
void RnnComponentLayer::trainRedraw(const arma::mat& vc) const
|
||||
{
|
||||
DrawVisibleTrain->getData() = vc_to_v(vc);
|
||||
DrawContextTrain->getData() = vc_to_c(vc);
|
||||
@@ -280,7 +280,7 @@ void RnnComponentLayer::trainRedraw(const arma::mat& vc)
|
||||
DrawContextTrain->DrawData();
|
||||
}
|
||||
|
||||
void RnnComponentLayer::reconstRedraw(const arma::mat& vc)
|
||||
void RnnComponentLayer::reconstRedraw(const arma::mat& vc) const
|
||||
{
|
||||
DrawVisibleReconst->getData() = vc_to_v(vc);
|
||||
DrawContextReconst->getData() = vc_to_c(vc);
|
||||
@@ -288,7 +288,7 @@ void RnnComponentLayer::reconstRedraw(const arma::mat& vc)
|
||||
DrawContextReconst->DrawData();
|
||||
}
|
||||
|
||||
void RnnComponentLayer::onUpPass(const arma::mat& v)
|
||||
void RnnComponentLayer::onUpPass(const arma::mat& v) const
|
||||
{
|
||||
DrawVisibleTrain->getData() = vc_to_v(v);
|
||||
DrawVisibleTrain->DrawData();
|
||||
@@ -297,7 +297,7 @@ void RnnComponentLayer::onUpPass(const arma::mat& v)
|
||||
trainRedraw(v);
|
||||
}
|
||||
|
||||
void RnnComponentLayer::onDownPass(const arma::mat& h)
|
||||
void RnnComponentLayer::onDownPass(const arma::mat& h) const
|
||||
{
|
||||
DrawHidden->getData() = h;
|
||||
DrawHidden->DrawData();
|
||||
@@ -334,7 +334,7 @@ void RnnComponentLayer::redrawWeights(size_t index)
|
||||
void RnnComponentLayer::setTrainingData(arma::mat const& batch)
|
||||
{
|
||||
RnnComponentLayer *pComp = static_cast<RnnComponentLayer*> (root());
|
||||
m_stack.upDownPass(id(), batch);
|
||||
m_stack.upDownPass(this, batch);
|
||||
}
|
||||
//[/MiscUserCode]
|
||||
|
||||
|
||||
@@ -73,8 +73,8 @@ public:
|
||||
ScopedPointer<DrawComponent> DrawContextTrain;
|
||||
arma::mat getTraining() const;
|
||||
arma::mat getReconst() const;
|
||||
void trainRedraw(const arma::mat& vc);
|
||||
void reconstRedraw(const arma::mat& vc);
|
||||
void trainRedraw(const arma::mat& vc) const;
|
||||
void reconstRedraw(const arma::mat& vc) const;
|
||||
|
||||
private:
|
||||
//[UserVariables] -- You can add your own custom variables in this section.
|
||||
@@ -84,8 +84,8 @@ private:
|
||||
ScopedPointer<ToggleButton> m_toggleEnable;
|
||||
ScopedPointer<TextButton> m_buttonCopyH2C;
|
||||
|
||||
void onUpPass(const arma::mat& v) override;
|
||||
void onDownPass(const arma::mat& h) override;
|
||||
void onUpPass(const arma::mat& v) const override;
|
||||
void onDownPass(const arma::mat& h) const override;
|
||||
|
||||
DeepStack &m_stack;
|
||||
size_t m_currWeightIndexToDraw;
|
||||
|
||||
Reference in New Issue
Block a user