- context drawComponents are always visible

git-svn-id: http://moon:8086/svn/software/trunk/projects/Rbm@765 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2022-01-09 13:02:52 +00:00
parent 5427287838
commit 238a6d9258
3 changed files with 15 additions and 15 deletions
+5
View File
@@ -227,6 +227,11 @@ arma::mat& DrawComponent::getData ()
void DrawComponent::DrawData ()
{
if (m_data.n_elem == 0)
{
return;
}
double max = arma::abs(m_data).max();
if (max < 1.0)
+4
View File
@@ -320,6 +320,10 @@ arma::mat Rbm::vc_to_v(const arma::mat &vc) const
arma::mat Rbm::vc_to_c(const arma::mat &vc) const
{
if (numContext() == 0)
{
return arma::mat(1,0);
}
return vc.submat(0, numVisible() - numContext(), 0, numVisible() - 1);
}
+6 -15
View File
@@ -40,14 +40,11 @@ RbmComponent::RbmComponent (const std::string &name, size_t id, size_t numVisibl
addAndMakeVisible (DrawHidden = new DrawComponent (numHidden, 1));
DrawHidden->setListener(this);
if (numContext)
{
addAndMakeVisible (DrawContextTrain = new DrawComponent (numContext, 1));
DrawContextTrain->setListener(this);
addAndMakeVisible (DrawContextTrain = new DrawComponent (numContext, 1));
DrawContextTrain->setListener(this);
addAndMakeVisible (DrawContextReconst = new DrawComponent (numContext, 1));
DrawContextReconst->setListener(this);
}
addAndMakeVisible (DrawContextReconst = new DrawComponent (numContext, 1));
DrawContextReconst->setListener(this);
addAndMakeVisible (DrawVisibleReconst = new DrawComponent (numVisibleX, numVisibleY));
addAndMakeVisible (DrawWeights = new DrawComponent (numVisibleX, numVisibleY, 0.5, 0.5));
@@ -146,14 +143,8 @@ void RbmComponent::resized()
DrawVisibleTrain->setBoundsRelative(0, 0, 100./m_sizeX, 100./m_sizeY);
DrawVisibleReconst->setBoundsRelative(110./m_sizeX, 0, 100./m_sizeX, 100./m_sizeY);
DrawWeights->setBoundsRelative (220./m_sizeX, 0, 100./m_sizeX, 100./m_sizeY);
if (DrawContextTrain)
{
DrawContextTrain->setBoundsRelative (0, 110./m_sizeY, 430./m_sizeX, 20./m_sizeY);
}
if (DrawContextReconst)
{
DrawContextReconst->setBoundsRelative (0, 140./m_sizeY, 430./m_sizeX, 20./m_sizeY);
}
DrawContextTrain->setBoundsRelative (0, 110./m_sizeY, 430./m_sizeX, 20./m_sizeY);
DrawContextReconst->setBoundsRelative (0, 140./m_sizeY, 430./m_sizeX, 20./m_sizeY);
DrawHidden->setBoundsRelative (0, 170./m_sizeY, 430./m_sizeX, 20./m_sizeY);
m_toggleEnable->setBoundsRelative (330./m_sizeX, 0, 80./m_sizeX, 24./m_sizeY);
}