Pagina 23 van 49

Geplaatst: 09 okt 2007, 09:59
door Rens
Geledu, van harte man.....nog vele jaren toegewenst.............

Geplaatst: 09 okt 2007, 10:25
door geledu
Bedankt,


nu maar weer ontopic ... :wink:

Geplaatst: 09 okt 2007, 10:30
door Lassie
....ik Geledu feliciteer!


....ik heerlijk van mijn vakantie aan het genieten ben!!!

Geplaatst: 09 okt 2007, 10:50
door Mariavt
Van harte Gefeliciteerd Geledu, en God's zegen toegewenst.

Geplaatst: 09 okt 2007, 12:17
door helma
Van harte Geledu!! (en ik ben toch wel benieuwd naar je leeftijd....)

Geplaatst: 09 okt 2007, 12:18
door Erasmiaan
Van harte!

Geplaatst: 09 okt 2007, 12:25
door BJD
helma schreef:Van harte Geledu!! (en ik ben toch wel benieuwd naar je leeftijd....)
Raden maar... (ik zeg het niet :mrgreen: )

Geplaatst: 09 okt 2007, 12:28
door Debby
Gefeliciteerd Geledu.

Geplaatst: 09 okt 2007, 13:06
door helma
BJD schreef:
helma schreef:Van harte Geledu!! (en ik ben toch wel benieuwd naar je leeftijd....)
Raden maar... (ik zeg het niet :mrgreen: )
oké dan: 35 :idea:

Geplaatst: 09 okt 2007, 15:28
door Kaw

Geplaatst: 10 okt 2007, 07:43
door JolandaOudshoorn
Geledu, alsnog van harte!! :D

Geplaatst: 10 okt 2007, 13:20
door Rens
........ik de boosaardige neiging nauwelijks kan onderdrukken om een hele oude topic nieuw leven in te blazen?
........die oude topic heet: veel kijkers, weinigen reageren?
........die topic ongelofelijk veel postings heeft opgeleverd?
........ik er met plezier de boel weer zal opstarten?

Geplaatst: 10 okt 2007, 15:31
door Lizzy
...ik er gewoon niet toe kom om wat er allemaal geschreven wordt te lezen.
...ik blij ben dat de zon schijnt.

Geplaatst: 10 okt 2007, 15:33
door jakobmarin
Rens schreef:........ik de boosaardige neiging nauwelijks kan onderdrukken om een hele oude topic nieuw leven in te blazen?
........die oude topic heet: veel kijkers, weinigen reageren?
........die topic ongelofelijk veel postings heeft opgeleverd?
........ik er met plezier de boel weer zal opstarten?
welk topic rens? 8)

Geplaatst: 11 okt 2007, 10:09
door Kaw

Code: Selecteer alles

    struct NeuralConst
    {
        public static float learningRate = 0.2f;
    }
    
    class Perceptron
    {
        float weight;
        Neuron child;
        Neuron parent;

        public Perceptron(Neuron child, Neuron parent)
        {
            this.child = child;
            this.parent = parent;
            child.addPerceptron(this);
            parent.addPerceptron(this);
            weight = 1;
        }

        public float think()
        {
            child.think();
            return child.value * weight;
        }

        public void learn()
        {
            weight += NeuralConst.learningRate * parent.getError() * child.value;
            child.learn();
        }

        public float getError()
        {
            return weight * parent.getError();
        }

        public bool youAreTheParent(Neuron you)
        {
            return parent.Equals(you);
        }

        public static float F(float x)
        {
            return (1 / (1 + (float)Math.Exp(-x)));
        }
    }
    
    class Neuron
    {
        Perceptron[] childs;
        Perceptron[] parents;

        public float target = 0;
        public float value;
        public float delta = 0;

        public bool functionsAsInput;
        public bool functionsAsOutput;
        public bool functionsAsBias;

        public Neuron(bool functionsAsInput, bool functionsAsOutput, bool functionsAsBias)
        {
            childs = new Perceptron[0];
            parents = new Perceptron[0];
            this.functionsAsInput = functionsAsInput;
            this.functionsAsOutput = functionsAsOutput;
            this.functionsAsBias = functionsAsBias;
            value = 1;
        }

        public void think()
        {
            if ((!functionsAsBias)&&(!functionsAsInput))
            {
                if (childs.Length > 0)
                {
                    float sum = 0;
                    foreach (Perceptron child in childs)
                        sum += child.think();
                    value = Perceptron.F(sum);
                }
            }
        }

        public void learn()
        {
            if ((!functionsAsOutput) && (!functionsAsBias) && (!functionsAsInput))
            {
                float error = 0.0f;
                foreach (Perceptron parent in parents)
                {
                    error += parent.getError();
                }
                delta = value * (1.0f - value) * error;
            }

            if (functionsAsOutput)
                delta = value * (1.0f - value) * (target - value);

            if ((!functionsAsBias) && (!functionsAsInput))
            {
                
                foreach (Perceptron child in childs)
                {
                    child.learn();
                }
            }

        }

        public float getError()
        {
            return delta;
        }

        public void addPerceptron(Perceptron perceptron)
        {
            if (perceptron.youAreTheParent(this))
            {
                Array.Resize(ref childs, childs.Length + 1);
                childs[childs.Length - 1] = perceptron;
            }
            else
            {
                Array.Resize(ref parents, parents.Length + 1);
                parents[parents.Length - 1] = perceptron;
            }
        }
    }