Main Page   Class Hierarchy   Compound List   File List   Compound Members  

WeightMatrix Class Reference

#include <GUINeuralNet.h>

Collaboration diagram for WeightMatrix:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 WeightMatrix (QWidget *parent=0, const char *name=0)
 ~WeightMatrix (void)
void setNet (PerceptronNetwork *net)
void setLayerNum (unsigned int layernum)
unsigned int getLayerMax (void) const

Protected Member Functions

void paintEvent (QPaintEvent *)

Private Member Functions

void paintSquare (unsigned int wx, unsigned int wy, const QColor &col)

Private Attributes

unsigned int weight_fromcount
unsigned int weight_tocount
unsigned int layernum
unsigned int x_needed
unsigned int y_needed
PerceptronNetworknet
vector< double > thetas
double theta_min
double theta_max
double theta_mid
double theta_rng
vector< vector< double > > weights
double weight_min
double weight_max
double weight_mid
double weight_rng
QPainter * painter
unsigned int margin_up
unsigned int margin_down
unsigned int margin_left
unsigned int margin_right
int x_box
int y_box
int square_size_x
int square_size_y

Detailed Description

Wrapper class from a neural network weight matrix to a GUI visualization.

The neural network related code is encapsulated within this class, so the GUI does use only this widget and does not have to cope with the PerceptronNetwork directly.


Constructor & Destructor Documentation

WeightMatrix::WeightMatrix QWidget *    parent = 0,
const char *    name = 0
 

Constructor which draws the weight diagramm for the weights going from layer layernum within network net.

Parameters:
parent The standard QT parent widget.
name The widgets' name.

WeightMatrix::~WeightMatrix void   
 

Standard destructor.


Member Function Documentation

unsigned int WeightMatrix::getLayerMax void    const
 

Give the maximum layer number.

Returns:
The maximum layer number plus one, i.e. 2 means: 0-1 is allowed.

void WeightMatrix::paintEvent QPaintEvent *    [protected]
 

QT paintEvent method, used to redraw the modified screen content.

void WeightMatrix::paintSquare unsigned int    wx,
unsigned int    wy,
const QColor &    col
[private]
 

Paint a single rectangle on the rectangle plane.

Parameters:
wx The virtual x position on the plane.
wy The virtual y position on the plane.
col The color the rectangle is drawn in.

void WeightMatrix::setLayerNum unsigned int    layernum
 

Set the layer which outgoing weights will be shown

Parameters:
layernum The layer index into the network.

void WeightMatrix::setNet PerceptronNetwork   net
 

Set the PerceptronNetwork

Parameters:
net The neural network the weight diagramm is created from.


Member Data Documentation

unsigned int WeightMatrix::layernum [private]
 

Layer which outgoing weights will be shown

unsigned int WeightMatrix::margin_down [private]
 

Margin to the downside border of the widget, in pixels

unsigned int WeightMatrix::margin_left [private]
 

Margin to the left border of the widget, in pixels

unsigned int WeightMatrix::margin_right [private]
 

Margin to the right border of the widget, in pixels

unsigned int WeightMatrix::margin_up [private]
 

Margin to the upper border of the widget, in pixels

PerceptronNetwork* WeightMatrix::net [private]
 

The neural network the weight diagram is created from.

QPainter* WeightMatrix::painter [private]
 

The QT painter needed to (re-) draw the canvas. Initialized once upon object construction and used from there.

int WeightMatrix::square_size_x [private]
 

The size of one square in x direction

int WeightMatrix::square_size_y [private]
 

The size of one square in y direction

double WeightMatrix::theta_max [private]
 

Maximum theta value found in current theta vector.

double WeightMatrix::theta_mid [private]
 

Middle of theta_min and theta_max.

double WeightMatrix::theta_min [private]
 

Minimum theta value found in current theta vector.

double WeightMatrix::theta_rng [private]
 

Absolute range between theta_min and theta_max.

vector<double> WeightMatrix::thetas [private]
 

The theta column values. Extracted from the neurons of the displayed layer.

unsigned int WeightMatrix::weight_fromcount [private]
 

Hold the number of weight origins.

double WeightMatrix::weight_max [private]
 

The maximum weight found in the current weight matrix.

double WeightMatrix::weight_mid [private]
 

Middle between weight_min and weight_max.

double WeightMatrix::weight_min [private]
 

The minimum weight found in the current weight matrix.

double WeightMatrix::weight_rng [private]
 

Absolute distance between weight_min and weight_max.

unsigned int WeightMatrix::weight_tocount [private]
 

Hold the number of weight targets.

vector<vector<double> > WeightMatrix::weights [private]
 

The array of weight values displayed. Extracted from both the individual weights of the neurons of the current layer.

int WeightMatrix::x_box [private]
 

The actual available pixelsize for the squares in x direction

unsigned int WeightMatrix::x_needed [private]
 

Number of squares needed in the widget in horizontal direction. Calculated as .

int WeightMatrix::y_box [private]
 

The actual available pixelsize for the squares in y direction

unsigned int WeightMatrix::y_needed [private]
 

Number of squares needed in the widget in vertical direction. Calculated as .


The documentation for this class was generated from the following files:
Generated on Mon Feb 24 19:37:47 2003 by doxygen1.3-rc3