Main Page   Class Hierarchy   Compound List   File List   Compound Members  

VowelClassifier Class Reference

#include <VowelClassifier.h>

Collaboration diagram for VowelClassifier:

Collaboration graph
List of all members.

Public Member Functions

 VowelClassifier (unsigned int input_dim, const VowelClassifierLayout *layout)
 ~VowelClassifier (void)
 VowelClassifier (VowelClassifier &source)
bool load (fstream &fs)
void save (fstream &fs) const
VowelClassification classifyVowel (const VowelSample *input)
void learnVowel (const VowelSample *input)
void updateLearned (void)
void resetLearned (void)
void setLearningParameters (VowelClassifierLearnParams params)
VowelClassifierLearnParams getLearningParameters (void) const
const char * getExpertName (unsigned int expert_number)
void randomizeExpert (unsigned int expert)
void setRandomizationParameters (unsigned int expert, double weight_low, double weight_high, double theta_low, double theta_high)
bool setActivationFunction (unsigned int expert_number, PerceptronLayerType type, const char *fact_name)
PerceptronNetworkgetNetwork (unsigned int expert_number) const

Static Public Attributes

vector< double > correct_results [3][(VowelSampleType) Unknown+1]

Private Member Functions

vector< double > getExpertResults (PerceptronNetwork *exp, vector< double > in)
void singleExpertLearn (PerceptronNetwork *exp, vector< double > input, vector< double > optimal)
void initializeCorrectResults (void)

Private Attributes

VowelClassifierLearnParams lpar
vector< RandomIntervalweight_initializations
vector< RandomIntervaltheta_initializations

Detailed Description

Vowel classification system.

Classifies and learns VowelSample's.

Constructor & Destructor Documentation

VowelClassifier::VowelClassifier unsigned int    input_dim,
const VowelClassifierLayout   layout

Basic constructor.

Construct the VowelClassifier, given its layout through the parameters.

input_dim The input dimension for each sample the classifier should process.
layout Part of the neural network layout, the dimensions of each layer, except the first and the last one.

VowelClassifier::~VowelClassifier void   

Default destructor.

VowelClassifier::VowelClassifier VowelClassifier &    source

Copy constructor.

source Source object to be copied.

Member Function Documentation

VowelClassification VowelClassifier::classifyVowel const VowelSample   input

Classify a vowel.

input The vowel sample the system should try to classify.

const char* VowelClassifier::getExpertName unsigned int    expert_number

Get the symbolic name of the expert network associated with expert_number.

expert_number The number of expert the name should be obtained from. Can range from 0 to 2.
The name of the expert.

vector< double > VowelClassifier::getExpertResults PerceptronNetwork   exp,
vector< double >    in

Ask one expert individually.

Processes a single neural network by feeding input in, and returning the networks output layer.

exp The expert to be asked.
in The network input.

VowelClassifierLearnParams VowelClassifier::getLearningParameters void    const

Get the currently used learning parameters.

PerceptronNetwork * VowelClassifier::getNetwork unsigned int    expert_number const

Get the PerceptronNetwork object behind an expert.

expert_number The network to be returned.
The network.

void VowelClassifier::initializeCorrectResults void    [private]

Create the initialization maps in correct_results.

void VowelClassifier::learnVowel const VowelSample   input

Learn a vowel input using the current learning parameters.

Note that while the internal system state changes due to the learning, the effective network does not. Hence, if you want to make the changes effective, you have to call updateLearned () afterwards. By choosing to call it after each learnVowel () call, you implement online-learning. Using a number of learnVowel () calls and then calling updateLearned () does all the accumulated changes at once, hence you implement batch-learning.

input The vowel, including its type_correct member, that the system should learn to classify.

bool VowelClassifier::load fstream &    fs

Load three networks from the stream fs.

fs The stream the system is loaded from.
True on success, false on failure.

void VowelClassifier::randomizeExpert unsigned int    expert

Randomize the network parameters.

expert The expert index (0-2) that is initialized using its current settings.

void VowelClassifier::resetLearned void   

Reset the currently learned parameter differences.

After having called updateLearned (), the differences are still active. To reset the learned differences when starting a new learning epoch, you have to call this method.

void VowelClassifier::save fstream &    fs const

Save the entire classification system.

fs The already open write stream the system is saved to.

bool VowelClassifier::setActivationFunction unsigned int    expert_number,
PerceptronLayerType    type,
const char *    fact_name

Set the activation function name.

expert_number The number (0-2) of the expert you want to change.
type The layer type you want to change the activation function of.
fact_name The symbolic name of the activation function.
True on success, false on failure.

void VowelClassifier::setLearningParameters VowelClassifierLearnParams    params

Set the learning parameters.

Change the internal learning parameters of the system. To keep this extendable we use a structure here.

params The parameters to apply.

void VowelClassifier::setRandomizationParameters unsigned int    expert,
double    weight_low,
double    weight_high,
double    theta_low,
double    theta_high

Set the randomization parameters for an expert.

expert The expert index (0-2).
weight_low The lower randomization boundary for the weights.
weight_high The higher boundary for the weights.
theta_low The lower theta-initialization boundary.
theta_high The higher theta-initialization boundary.

void VowelClassifier::singleExpertLearn PerceptronNetwork   exp,
vector< double >    input,
vector< double >    optimal

Propagate and backpropagate for a single expert.

exp The expert network to be processed.
input The input vector.
optimal The optimal output vector used for the backprogation process.

void VowelClassifier::updateLearned void   

Update the effective system states.

Updating the states make the changes the learnVowel () method produced effective, hence increasing the classification success, hopefully.

Member Data Documentation

vector< double > VowelClassifier::correct_results [static]

The training map to teach the experts.

Each expert has its own translation map. The map itself maps a vowel type to the optimal expert results. For example, the first expert categorizes into the groups { A, OU, EI }, and would have this entries for the A vowel type:

correct_results[0][(VowelSampleType) A][0] = 1.0; correct_results[0][(VowelSampleType) A][1] = 0.0; correct_results[0][(VowelSampleType) A][2] = 0.0;

This is what it wants to tell you: "When the correct type is an A, the first output neuron should have level 1.0, the second and third the level 0.0". (For the first expert).

Note, that before using the correct_results map you have to initialize it using initializeCorrectResults. Also, the array should be used read-only from outside this class.

VowelClassifierLearnParams VowelClassifier::lpar [private]

The system internal learning parametrization.

PerceptronNetwork* VowelClassifier::nn_a_ou_ei [private]

One MLP expert that groups the input vowel into three disjoint sets: { a }, { o, u } and { e, i }. Named "network 0".

PerceptronNetwork* VowelClassifier::nn_e_i_aou [private]

One MLP expert that groups the input vowel into three disjoint sets: { e }, { i } and { a, o, u }. Named "network 2".

PerceptronNetwork* VowelClassifier::nn_o_u_aei [private]

One MLP expert that groups the input vowel into three disjoint sets: { o }, { u } and { a, e, i }. Named "network 1".

vector<RandomInterval> VowelClassifier::theta_initializations [private]

The theta initialization array, containing three intervals.

vector<RandomInterval> VowelClassifier::weight_initializations [private]

The weight initialization array, containing three intervals.

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