- 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:
@@ -227,6 +227,11 @@ arma::mat& DrawComponent::getData ()
|
|||||||
|
|
||||||
void DrawComponent::DrawData ()
|
void DrawComponent::DrawData ()
|
||||||
{
|
{
|
||||||
|
if (m_data.n_elem == 0)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
double max = arma::abs(m_data).max();
|
double max = arma::abs(m_data).max();
|
||||||
|
|
||||||
if (max < 1.0)
|
if (max < 1.0)
|
||||||
|
|||||||
@@ -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
|
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);
|
return vc.submat(0, numVisible() - numContext(), 0, numVisible() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -40,14 +40,11 @@ RbmComponent::RbmComponent (const std::string &name, size_t id, size_t numVisibl
|
|||||||
addAndMakeVisible (DrawHidden = new DrawComponent (numHidden, 1));
|
addAndMakeVisible (DrawHidden = new DrawComponent (numHidden, 1));
|
||||||
DrawHidden->setListener(this);
|
DrawHidden->setListener(this);
|
||||||
|
|
||||||
if (numContext)
|
|
||||||
{
|
|
||||||
addAndMakeVisible (DrawContextTrain = new DrawComponent (numContext, 1));
|
addAndMakeVisible (DrawContextTrain = new DrawComponent (numContext, 1));
|
||||||
DrawContextTrain->setListener(this);
|
DrawContextTrain->setListener(this);
|
||||||
|
|
||||||
addAndMakeVisible (DrawContextReconst = new DrawComponent (numContext, 1));
|
addAndMakeVisible (DrawContextReconst = new DrawComponent (numContext, 1));
|
||||||
DrawContextReconst->setListener(this);
|
DrawContextReconst->setListener(this);
|
||||||
}
|
|
||||||
|
|
||||||
addAndMakeVisible (DrawVisibleReconst = new DrawComponent (numVisibleX, numVisibleY));
|
addAndMakeVisible (DrawVisibleReconst = new DrawComponent (numVisibleX, numVisibleY));
|
||||||
addAndMakeVisible (DrawWeights = new DrawComponent (numVisibleX, numVisibleY, 0.5, 0.5));
|
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);
|
DrawVisibleTrain->setBoundsRelative(0, 0, 100./m_sizeX, 100./m_sizeY);
|
||||||
DrawVisibleReconst->setBoundsRelative(110./m_sizeX, 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);
|
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);
|
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);
|
DrawContextReconst->setBoundsRelative (0, 140./m_sizeY, 430./m_sizeX, 20./m_sizeY);
|
||||||
}
|
|
||||||
DrawHidden->setBoundsRelative (0, 170./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);
|
m_toggleEnable->setBoundsRelative (330./m_sizeX, 0, 80./m_sizeX, 24./m_sizeY);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user