user2154591
user2154591

Reputation: 51

Elman Network - Negative and above 1 calculation values

I normliezed the data but still, get negative and above 1 values when calculate new data with encog Elman pattern.

Even when run the ElmanXOR sample as is:

layers: 1 input, 5 hidden, 1 output activation: ActivationSigmoid training: LevenbergMarquardtTraining: a. Greedy b. HybridStrategy -> NeuralSimulatedAnnealing

is it possible?

Upvotes: 1

Views: 178

Answers (2)

Greg Thatcher
Greg Thatcher

Reputation: 1443

If you are using Encog's Sigmoid Activation function, you should only get output values between 0 and 1 as this is all the output function is capable of (are you sure your output node is not using a Linear activation function?). It should not be possible to get values above 1 or below -1.

Sigmoid Activation Function
(source: saedsayad.com)

I'm wondering if your data is not normalized correctly (can you upload a sample of your normalized data?).

When you normalized, I'm assuming you did something like this:

        var analyst = new EncogAnalyst();  
        var wizard = new AnalystWizard(analyst);  
        wizard.Wizard(DataFile, true, AnalystFileFormat.DecpntComma);

This will normalize your data between -1 and 1. I think you should try adding this code to normalize everything to between 0 and 1.

            foreach (AnalystField field in analyst.Script.Normalize.NormalizedFields)  
            {  
                field.NormalizedHigh = 1.0;  
                field.NormalizedLow = 0.0;  
            }  

Alternatively, you could try a different activation function, like HyperbolicTangent, as this outputs between -1 and 1.

Upvotes: 0

user2154591
user2154591

Reputation: 51

Neural Network Results:
input: 1 ,ideal=0  actual: 0.625124775182661
input: 0 ,ideal=1  actual: -0.476592365362806
input: 1 ,ideal=0  actual: -0.0206919867584277
input: 0 ,ideal=0  actual: 1.35539859989167
input: 0 ,ideal=0  actual: -0.387613018442168
input: 0 ,ideal=0  actual: -0.819489650390268
input: 0 ,ideal=1  actual: 1.2046874965753
input: 1 ,ideal=1  actual: 0.870695301738905
input: 1 ,ideal=1  actual: 0.159201074403962
input: 1 ,ideal=1  actual: 0.884482632556325

Upvotes: 0

Related Questions