fixed RBM

git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@283 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2016-05-30 23:53:18 +00:00
parent 7fada2a227
commit f25f5b0dab
1096 changed files with 14 additions and 426765 deletions
+5 -5
View File
@@ -34,7 +34,6 @@ DrawComponent::DrawComponent (int width, int height)
{
//[UserPreSize]
noise_gen_t noise;
m_width = width;
m_height = height;
m_scaleX = 1.0;
@@ -49,7 +48,6 @@ DrawComponent::DrawComponent (int width, int height)
//[Constructor] You can add your own custom stuff here..
// m_pG = new Graphics(m_image);
m_data.resize(width*height);
Noise_Init(&noise, 0x3231);
m_pG->setImageResamplingQuality(Graphics::lowResamplingQuality);
clear();
@@ -65,6 +63,7 @@ DrawComponent::~DrawComponent()
//[Destructor]. You can add your own custom destruction code here..
m_pG = nullptr;
m_pListener = nullptr;
//[/Destructor]
}
@@ -218,11 +217,12 @@ void DrawComponent::drawAt(int x, int y, bool setColor)
void DrawComponent::clear()
{
m_data.fill(0);
setData(m_data);
m_data.resize(m_width*m_height);
m_data = RowVectorXd::Zero(m_width*m_height);
DrawData();
}
const RowVectorXd& DrawComponent::getData ()
RowVectorXd& DrawComponent::getData ()
{
return m_data;
}
+1 -1
View File
@@ -57,7 +57,7 @@ public:
void setListener(DrawListener *pListener);
void drawAt(int x, int y, bool setColor);
void setData(const RowVectorXd& data);
const RowVectorXd& getData();
RowVectorXd& getData();
void clear();
//[/UserMethods]
+8 -1
View File
@@ -34,6 +34,7 @@ public:
LayerArray(LayerArrayListener *pListener = nullptr)
: m_pListener(pListener)
{
m_data.resize(0, 0);
}
virtual ~LayerArray()
@@ -44,7 +45,13 @@ public:
void add(const RowVectorXd &pData, uint32_t size)
{
m_data << pData;
MatrixXd C(m_data.rows()+pData.rows(), pData.cols());
if (m_data.rows())
C << m_data, pData;
else
C << pData;
m_data = C;
if (m_pListener)
{
m_pListener->onChanged(*this);
-17
View File
@@ -18,28 +18,12 @@
*/
//[Headers] You can add your own extra header files here...
#ifdef WIN32
#include <Windows.h>
#endif
#include <iostream>
#include <Eigen/Dense>
//[/Headers]
#include "MainComponent.h"
//[MiscUserDefs] You can add your own user definitions and misc code here...
#ifdef WIN32
void mylog(const char* format, ...)
{
char log_buf[257];
va_list argptr;
va_start(argptr, format);
vsprintf(log_buf, format, argptr);
va_end(argptr);
OutputDebugStringA (log_buf);
}
#else
void mylog(const char* format, ...)
{
char log_buf[257];
@@ -48,7 +32,6 @@ void mylog(const char* format, ...)
vprintf(format, argptr);
va_end(argptr);
}
#endif
//[/MiscUserDefs]