#include <VowelClassifier.h>
Collaboration diagram for VowelClassifier:
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) |
PerceptronNetwork * | getNetwork (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 | |
PerceptronNetwork * | nn_a_ou_ei |
PerceptronNetwork * | nn_o_u_aei |
PerceptronNetwork * | nn_e_i_aou |
VowelClassifierLearnParams | lpar |
vector< RandomInterval > | weight_initializations |
vector< RandomInterval > | theta_initializations |
Classifies and learns VowelSample's.
|
Basic constructor. Construct the VowelClassifier, given its layout through the parameters.
|
|
Default destructor. |
|
Copy constructor.
|
|
Classify a vowel.
|
|
Get the symbolic name of the expert network associated with expert_number.
|
|
Ask one expert individually. Processes a single neural network by feeding input in, and returning the networks output layer.
|
|
Get the currently used learning parameters. |
|
Get the PerceptronNetwork object behind an expert.
|
|
Create the initialization maps in correct_results. |
|
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.
|
|
Load three networks from the stream fs.
|
|
Randomize the network parameters.
|
|
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. |
|
Save the entire classification system.
|
|
Set the activation function name.
|
|
Set the learning parameters. Change the internal learning parameters of the system. To keep this extendable we use a structure here.
|
|
Set the randomization parameters for an expert.
|
|
Propagate and backpropagate for a single expert.
|
|
Update the effective system states. Updating the states make the changes the learnVowel () method produced effective, hence increasing the classification success, hopefully. |
|
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. |
|
The system internal learning parametrization. |
|
One MLP expert that groups the input vowel into three disjoint sets: { a }, { o, u } and { e, i }. Named "network 0". |
|
One MLP expert that groups the input vowel into three disjoint sets: { e }, { i } and { a, o, u }. Named "network 2". |
|
One MLP expert that groups the input vowel into three disjoint sets: { o }, { u } and { a, e, i }. Named "network 1". |
|
The theta initialization array, containing three intervals. |
|
The weight initialization array, containing three intervals. |