- use expectations

- improved gibbs sampling
- LayerArray is template class

git-svn-id: http://moon:8086/svn/software/trunk/projects/RBM@18 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2014-10-06 17:08:50 +00:00
parent f62f1283f8
commit fc758b853a
122 changed files with 1053 additions and 1149 deletions
@@ -83,8 +83,8 @@ public:
void transformPoint (ValueType& x, ValueType& y) const noexcept
{
const ValueType oldX = x;
x = static_cast<ValueType> (mat00 * oldX + mat01 * y + mat02);
y = static_cast<ValueType> (mat10 * oldX + mat11 * y + mat12);
x = static_cast <ValueType> (mat00 * oldX + mat01 * y + mat02);
y = static_cast <ValueType> (mat10 * oldX + mat11 * y + mat12);
}
/** Transforms two 2D coordinates using this matrix.
@@ -97,10 +97,10 @@ public:
ValueType& x2, ValueType& y2) const noexcept
{
const ValueType oldX1 = x1, oldX2 = x2;
x1 = static_cast<ValueType> (mat00 * oldX1 + mat01 * y1 + mat02);
y1 = static_cast<ValueType> (mat10 * oldX1 + mat11 * y1 + mat12);
x2 = static_cast<ValueType> (mat00 * oldX2 + mat01 * y2 + mat02);
y2 = static_cast<ValueType> (mat10 * oldX2 + mat11 * y2 + mat12);
x1 = static_cast <ValueType> (mat00 * oldX1 + mat01 * y1 + mat02);
y1 = static_cast <ValueType> (mat10 * oldX1 + mat11 * y1 + mat12);
x2 = static_cast <ValueType> (mat00 * oldX2 + mat01 * y2 + mat02);
y2 = static_cast <ValueType> (mat10 * oldX2 + mat11 * y2 + mat12);
}
/** Transforms three 2D coordinates using this matrix.
@@ -114,12 +114,12 @@ public:
ValueType& x3, ValueType& y3) const noexcept
{
const ValueType oldX1 = x1, oldX2 = x2, oldX3 = x3;
x1 = static_cast<ValueType> (mat00 * oldX1 + mat01 * y1 + mat02);
y1 = static_cast<ValueType> (mat10 * oldX1 + mat11 * y1 + mat12);
x2 = static_cast<ValueType> (mat00 * oldX2 + mat01 * y2 + mat02);
y2 = static_cast<ValueType> (mat10 * oldX2 + mat11 * y2 + mat12);
x3 = static_cast<ValueType> (mat00 * oldX3 + mat01 * y3 + mat02);
y3 = static_cast<ValueType> (mat10 * oldX3 + mat11 * y3 + mat12);
x1 = static_cast <ValueType> (mat00 * oldX1 + mat01 * y1 + mat02);
y1 = static_cast <ValueType> (mat10 * oldX1 + mat11 * y1 + mat12);
x2 = static_cast <ValueType> (mat00 * oldX2 + mat01 * y2 + mat02);
y2 = static_cast <ValueType> (mat10 * oldX2 + mat11 * y2 + mat12);
x3 = static_cast <ValueType> (mat00 * oldX3 + mat01 * y3 + mat02);
y3 = static_cast <ValueType> (mat10 * oldX3 + mat11 * y3 + mat12);
}
//==============================================================================
@@ -231,7 +231,8 @@ public:
float x10, float y10,
float x01, float y01) noexcept;
/** Returns the transform that will map three specified points onto three target points. */
/** Returns the transform that will map three specified points onto three target points.
*/
static AffineTransform fromTargetPoints (float sourceX1, float sourceY1, float targetX1, float targetY1,
float sourceX2, float sourceY2, float targetX2, float targetY2,
float sourceX3, float sourceY3, float targetX3, float targetY3) noexcept;
@@ -488,13 +488,12 @@ bool PNGImageFormat::writeImageToStream (const Image& image, OutputStream& out)
PNG_COMPRESSION_TYPE_BASE,
PNG_FILTER_TYPE_BASE);
HeapBlock<uint8> rowData ((size_t) width * 4);
HeapBlock <uint8> rowData ((size_t) width * 4);
png_color_8 sig_bit;
sig_bit.red = 8;
sig_bit.red = 8;
sig_bit.green = 8;
sig_bit.blue = 8;
sig_bit.gray = 0;
sig_bit.blue = 8;
sig_bit.alpha = 8;
png_set_sBIT (pngWriteStruct, pngInfoStruct, &sig_bit);
@@ -1026,7 +1026,7 @@ png_read_png(png_structrp png_ptr, png_inforp info_ptr,
if ((transforms & PNG_TRANSFORM_SHIFT)
&& png_get_valid(png_ptr, info_ptr, PNG_INFO_sBIT))
{
png_color_8p sig_bit = 0;
png_color_8p sig_bit;
png_get_sBIT(png_ptr, info_ptr, &sig_bit);
png_set_shift(png_ptr, sig_bit);
@@ -197,11 +197,11 @@ Image Image::getClippedImage (const Rectangle<int>& area) const
//==============================================================================
Image::Image() noexcept
Image::Image()
{
}
Image::Image (ImagePixelData* const instance) noexcept
Image::Image (ImagePixelData* const instance)
: image (instance)
{
}
@@ -216,7 +216,7 @@ Image::Image (const PixelFormat format, int width, int height, bool clearImage,
{
}
Image::Image (const Image& other) noexcept
Image::Image (const Image& other)
: image (other.image)
{
}
@@ -67,7 +67,7 @@ public:
//==============================================================================
/** Creates a null image. */
Image() noexcept;
Image();
/** Creates an image with a specified size and format.
@@ -106,7 +106,7 @@ public:
point to the same shared image data. To make sure that an Image object has its own unique,
unshared internal data, call duplicateIfShared().
*/
Image (const Image&) noexcept;
Image (const Image&);
/** Makes this image refer to the same underlying image as another object.
@@ -408,7 +408,7 @@ public:
ImagePixelData* getPixelData() const noexcept { return image; }
/** @internal */
explicit Image (ImagePixelData*) noexcept;
explicit Image (ImagePixelData*);
private:
//==============================================================================
@@ -506,8 +506,8 @@ private:
lf.lfOutPrecision = OUT_OUTLINE_PRECIS;
lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
lf.lfQuality = PROOF_QUALITY;
lf.lfItalic = (BYTE) (style.contains ("Italic") ? TRUE : FALSE);
lf.lfWeight = style.contains ("Bold") ? FW_BOLD : FW_NORMAL;
lf.lfItalic = (BYTE) (style == "Italic" ? TRUE : FALSE);
lf.lfWeight = style == "Bold" ? FW_BOLD : FW_NORMAL;
lf.lfHeight = -256;
name.copyToUTF16 (lf.lfFaceName, sizeof (lf.lfFaceName));