<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Home</title><link>https://sourceforge.net/p/ccperceptron/wiki/Home/</link><description>Recent changes to Home</description><atom:link href="https://sourceforge.net/p/ccperceptron/wiki/Home/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 24 Oct 2014 15:59:01 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/ccperceptron/wiki/Home/feed" rel="self" type="application/rss+xml"/><item><title>Home modified by Tal H</title><link>https://sourceforge.net/p/ccperceptron/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v9
+++ v10
@@ -98,7 +98,7 @@

     // Create a new perceptron with specified size of input-vector and a specified training rate
     // The size of the input vector will be changed to "1" in case that 0 or negative number is passed
-    Perceptron *Perceptron_new(int numOfInputs, double trainingRate);
+    Perceptron *Perceptron_new(unsigned numOfInputs, double trainingRate);

     // Get the sum of (input(0) * weight(0) + input(1) * weight(1) + ... + input(n) * weight(n))
     double Perceptron_getValue(const Perceptron *perceptron, const double inputs[]);
@@ -114,16 +114,26 @@
     int Perceptron_getResult(const Perceptron *perceptron, const double inputs[]);

     // Get the weight at a specific index in the weights vector
-    double Perceptron_getWeightAt(const Perceptron *perceptron, int index);
+    double Perceptron_getWeightAt(const Perceptron *perceptron, unsigned index);

     // Get the weights vector
     const double *Perceptron_getWeights(const Perceptron *perceptron);

     // Get the number of the inputs in the perceptron
-    int Perceptron_getNumOfInputs(const Perceptron *perceptron);
+    unsigned Perceptron_getNumOfInputs(const Perceptron *perceptron);

     // Get the threshold
     double Perceptron_getThreshold(const Perceptron *perceptron);

     // Get the training rate
     double Perceptron_getTrainingRate(const Perceptron *perceptron);
+
+    // Change the weight at a specific index
+    void Perceptron_setWeightAt(Perceptron *perceptron, unsigned index, double weight);
+
+    // Change the weights vector (copying, not replacing pointers)
+    void Perceptron_setWeights(Perceptron *perceptron, const double *weights);
+
+    // Change the threshold
+    void Perceptron_setThreshold(Perceptron *perceptron, double threshold);
+
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tal H</dc:creator><pubDate>Fri, 24 Oct 2014 15:59:01 -0000</pubDate><guid>https://sourceforge.netcfc089cd201c435bd6ecae5f5af7b20939cd66d7</guid></item><item><title>Home modified by Tal H</title><link>https://sourceforge.net/p/ccperceptron/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v8
+++ v9
@@ -9,13 +9,13 @@

     Results for 'OR' perceptron, BEFORE training:
     Input: (0,0). Result: 0
-    Input: (0,1). Result: 1
-    Input: (1,0). Result: 0
-    Input: (1,1). Result: 1
-    Results for 'AND' perceptron, BEFORE training:
-    Input: (0,0). Result: 0
     Input: (0,1). Result: 0
     Input: (1,0). Result: 0
+    Input: (1,1). Result: 0
+    Results for 'AND' perceptron, BEFORE training:
+    Input: (0,0). Result: 1
+    Input: (0,1). Result: 0
+    Input: (1,0). Result: 1
     Input: (1,1). Result: 0
     Results for 'OR' perceptron, AFTER training:
     Input: (0,0). Result: 0
@@ -37,7 +37,7 @@

     int main() {
        // Constants
-       const int TRAINING_ITERATIONS = 8;
+       const int TRAINING_ITERATIONS = 16;
        const int NUM_OF_INPUTS = 2;
        const double TRAINING_RATE = 0.2;

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tal H</dc:creator><pubDate>Thu, 16 Oct 2014 10:33:03 -0000</pubDate><guid>https://sourceforge.netf80a803acdb8a071a146c2636bbdbee4ae20731d</guid></item><item><title>Home modified by Tal H</title><link>https://sourceforge.net/p/ccperceptron/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v7
+++ v8
@@ -110,6 +110,7 @@
     void Perceptron_train(Perceptron *perceptron, const double inputs[], int expectedResult);

     // Get the result for an input vector (result is 0 or 1)
+    // Returns 1 in case that **Perceptron_getValue(perceptron, inputs)** is higher or equals to the thresholds. Returns 0 otherwise
     int Perceptron_getResult(const Perceptron *perceptron, const double inputs[]);

     // Get the weight at a specific index in the weights vector
@@ -126,4 +127,3 @@

     // Get the training rate
     double Perceptron_getTrainingRate(const Perceptron *perceptron);
-
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tal H</dc:creator><pubDate>Thu, 16 Oct 2014 10:21:30 -0000</pubDate><guid>https://sourceforge.neted16a960bd55c0b9b29af0f169b029bf447a6919</guid></item><item><title>Home modified by Tal H</title><link>https://sourceforge.net/p/ccperceptron/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v6
+++ v7
@@ -100,7 +100,7 @@
     // The size of the input vector will be changed to "1" in case that 0 or negative number is passed
     Perceptron *Perceptron_new(int numOfInputs, double trainingRate);

-    // Get the multiplication of an inputs vector with the weights vector
+    // Get the sum of (input(0) * weight(0) + input(1) * weight(1) + ... + input(n) * weight(n))
     double Perceptron_getValue(const Perceptron *perceptron, const double inputs[]);

     // Change the training rate
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tal H</dc:creator><pubDate>Thu, 16 Oct 2014 10:19:04 -0000</pubDate><guid>https://sourceforge.net5a68c364756c17073973e5b379396eec8b9770d8</guid></item><item><title>Home modified by Tal H</title><link>https://sourceforge.net/p/ccperceptron/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v5
+++ v6
@@ -14,9 +14,9 @@
     Input: (1,1). Result: 1
     Results for 'AND' perceptron, BEFORE training:
     Input: (0,0). Result: 0
-    Input: (0,1). Result: 1
+    Input: (0,1). Result: 0
     Input: (1,0). Result: 0
-    Input: (1,1). Result: 1
+    Input: (1,1). Result: 0
     Results for 'OR' perceptron, AFTER training:
     Input: (0,0). Result: 0
     Input: (0,1). Result: 1
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tal H</dc:creator><pubDate>Thu, 16 Oct 2014 10:05:05 -0000</pubDate><guid>https://sourceforge.netbfcbfb966657fa40adc9e222081f40301a31f7ea</guid></item><item><title>Home modified by Tal H</title><link>https://sourceforge.net/p/ccperceptron/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v4
+++ v5
@@ -94,5 +94,36 @@
     }

+***API***

-More available API functions can be found in the **perceptron.h** file
+    // Create a new perceptron with specified size of input-vector and a specified training rate
+    // The size of the input vector will be changed to "1" in case that 0 or negative number is passed
+    Perceptron *Perceptron_new(int numOfInputs, double trainingRate);
+
+    // Get the multiplication of an inputs vector with the weights vector
+    double Perceptron_getValue(const Perceptron *perceptron, const double inputs[]);
+
+    // Change the training rate
+    void Perceptron_setTrainingRate(Perceptron *perceptron, double trainingRate);
+
+    // Train perceptron according to an input vector and its expected result (result should be 0 or 1)
+    void Perceptron_train(Perceptron *perceptron, const double inputs[], int expectedResult);
+
+    // Get the result for an input vector (result is 0 or 1)
+    int Perceptron_getResult(const Perceptron *perceptron, const double inputs[]);
+
+    // Get the weight at a specific index in the weights vector
+    double Perceptron_getWeightAt(const Perceptron *perceptron, int index);
+
+    // Get the weights vector
+    const double *Perceptron_getWeights(const Perceptron *perceptron);
+
+    // Get the number of the inputs in the perceptron
+    int Perceptron_getNumOfInputs(const Perceptron *perceptron);
+
+    // Get the threshold
+    double Perceptron_getThreshold(const Perceptron *perceptron);
+
+    // Get the training rate
+    double Perceptron_getTrainingRate(const Perceptron *perceptron);
+
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tal H</dc:creator><pubDate>Thu, 16 Oct 2014 02:54:36 -0000</pubDate><guid>https://sourceforge.net3454018801bd6ed15102fba68de79042dd5c97c3</guid></item><item><title>Home modified by Tal H</title><link>https://sourceforge.net/p/ccperceptron/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -4,8 +4,6 @@
 This library enables training the perceptron step by step and enables to check its state at each step.

 ***API &amp;amp; Usage Example***
-
-***Usage Example***

 ***The text printed to the shell***

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tal H</dc:creator><pubDate>Thu, 16 Oct 2014 02:46:36 -0000</pubDate><guid>https://sourceforge.net92bafcf8f65d188510a71a27aae3813dbe14f168</guid></item><item><title>Home modified by Tal H</title><link>https://sourceforge.net/p/ccperceptron/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -6,6 +6,32 @@
 ***API &amp;amp; Usage Example***

 ***Usage Example***
+
+***The text printed to the shell***
+
+    Results for 'OR' perceptron, BEFORE training:
+    Input: (0,0). Result: 0
+    Input: (0,1). Result: 1
+    Input: (1,0). Result: 0
+    Input: (1,1). Result: 1
+    Results for 'AND' perceptron, BEFORE training:
+    Input: (0,0). Result: 0
+    Input: (0,1). Result: 1
+    Input: (1,0). Result: 0
+    Input: (1,1). Result: 1
+    Results for 'OR' perceptron, AFTER training:
+    Input: (0,0). Result: 0
+    Input: (0,1). Result: 1
+    Input: (1,0). Result: 1
+    Input: (1,1). Result: 1
+    Results for 'AND' perceptron, AFTER training:
+    Input: (0,0). Result: 0
+    Input: (0,1). Result: 0
+    Input: (1,0). Result: 0
+    Input: (1,1). Result: 1
+
+
+***The code***

     #include &amp;lt;stdio.h&amp;gt;

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tal H</dc:creator><pubDate>Thu, 16 Oct 2014 02:45:42 -0000</pubDate><guid>https://sourceforge.netec2d2ee3977d19f99c9e3967fc039a9310c5154d</guid></item><item><title>Home modified by Tal H</title><link>https://sourceforge.net/p/ccperceptron/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -1,8 +1,74 @@
-Welcome to your wiki!
+**C/C++ Perceptron**
+***Introduction***
+This project was created in order to enable Perceptron creation and training API for C programmers.
+This library enables training the perceptron step by step and enables to check its state at each step.

-This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: [SamplePage].
+***API &amp;amp; Usage Example***

-The wiki uses [Markdown](/p/ccperceptron/wiki/markdown_syntax/) syntax.
+***Usage Example***

-[[members limit=20]]
-[[download_button]]
+    #include &amp;lt;stdio.h&amp;gt;
+    
+    #include "perceptron.h"
+    
+    int main() {
+       // Constants
+       const int TRAINING_ITERATIONS = 8;
+       const int NUM_OF_INPUTS = 2;
+       const double TRAINING_RATE = 0.2;
+       
+       const double ZERO_ZERO[] = {0, 0};
+       const double ZERO_ONE[]  = {0, 1};
+       const double ONE_ZERO[]  = {1, 0};
+       const double ONE_ONE[]   = {1, 1};
+       
+       int i;
+       // Creating Perceptron instances
+       Perceptron *pAND = Perceptron_new(NUM_OF_INPUTS, TRAINING_RATE);
+       Perceptron *pOR  = Perceptron_new(NUM_OF_INPUTS, TRAINING_RATE);
+       
+       // Printing the results of the randomly generated perceptrons (BEFORE TRAINING)
+       printf("Results for 'OR' perceptron, BEFORE training:\n");
+       printf("Input: (0,0). Result: %d\n", Perceptron_getResult(pOR, ZERO_ZERO));
+       printf("Input: (0,1). Result: %d\n", Perceptron_getResult(pOR, ZERO_ONE));
+       printf("Input: (1,0). Result: %d\n", Perceptron_getResult(pOR, ONE_ZERO));
+       printf("Input: (1,1). Result: %d\n", Perceptron_getResult(pOR, ONE_ONE));
+       
+       printf("Results for 'AND' perceptron, BEFORE training:\n");
+       printf("Input: (0,0). Result: %d\n", Perceptron_getResult(pAND, ZERO_ZERO));
+       printf("Input: (0,1). Result: %d\n", Perceptron_getResult(pAND, ZERO_ONE));
+       printf("Input: (1,0). Result: %d\n", Perceptron_getResult(pAND, ONE_ZERO));
+       printf("Input: (1,1). Result: %d\n", Perceptron_getResult(pAND, ONE_ONE));
+       
+       // Training each of the perceptrons
+       for (i = 0 ; i &amp;lt; TRAINING_ITERATIONS ; i++) {
+           Perceptron_train(pAND, ZERO_ZERO, 0);
+           Perceptron_train(pAND, ZERO_ONE,  0);
+           Perceptron_train(pAND, ONE_ZERO,  0);
+           Perceptron_train(pAND, ONE_ONE,   1);
+       
+           Perceptron_train(pOR, ZERO_ZERO,  0);
+           Perceptron_train(pOR, ZERO_ONE,   1);
+           Perceptron_train(pOR, ONE_ZERO,   1);
+           Perceptron_train(pOR, ONE_ONE,    1);
+       }
+       
+       // Printing the results of the trained perceptrons (AFTER TRAINING)
+       printf("Results for 'OR' perceptron, AFTER training:\n");
+       printf("Input: (0,0). Result: %d\n", Perceptron_getResult(pOR, ZERO_ZERO));
+       printf("Input: (0,1). Result: %d\n", Perceptron_getResult(pOR, ZERO_ONE));
+       printf("Input: (1,0). Result: %d\n", Perceptron_getResult(pOR, ONE_ZERO));
+       printf("Input: (1,1). Result: %d\n", Perceptron_getResult(pOR, ONE_ONE));
+       
+       printf("Results for 'AND' perceptron, AFTER training:\n");
+       printf("Input: (0,0). Result: %d\n", Perceptron_getResult(pAND, ZERO_ZERO));
+       printf("Input: (0,1). Result: %d\n", Perceptron_getResult(pAND, ZERO_ONE));
+       printf("Input: (1,0). Result: %d\n", Perceptron_getResult(pAND, ONE_ZERO));
+       printf("Input: (1,1). Result: %d\n", Perceptron_getResult(pAND, ONE_ONE));
+       
+       return 0;
+    }
+    
+
+
+More available API functions can be found in the **perceptron.h** file
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tal H</dc:creator><pubDate>Thu, 16 Oct 2014 02:42:53 -0000</pubDate><guid>https://sourceforge.net090de13be2e58a3569fe7326eb5a1444b5266c12</guid></item><item><title>Home modified by Tal H</title><link>https://sourceforge.net/p/ccperceptron/wiki/Home/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Welcome to your wiki!&lt;/p&gt;
&lt;p&gt;This is the default page, edit it as you see fit. To add a new page simply reference it within brackets, e.g.: &lt;span&gt;[SamplePage]&lt;/span&gt;.&lt;/p&gt;
&lt;p&gt;The wiki uses &lt;a class="" href="/p/ccperceptron/wiki/markdown_syntax"&gt;Markdown&lt;/a&gt; syntax.&lt;/p&gt;
&lt;p&gt;&lt;h6&gt;Project Members:&lt;/h6&gt;
&lt;ul class="md-users-list"&gt;
&lt;li&gt;&lt;a href="/u/talh123"&gt;Tal H&lt;/a&gt; (admin)&lt;/li&gt;
&lt;/ul&gt;&lt;br /&gt;
&lt;/p&gt;&lt;p&gt;&lt;span class="download-button-543f2c1bb9363c4ce3c395bb" style="margin-bottom: 1em; display: block;"&gt;&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Tal H</dc:creator><pubDate>Thu, 16 Oct 2014 02:23:23 -0000</pubDate><guid>https://sourceforge.net0e96ae0fa6f14d01ce4b204c4af0f537d2c7126f</guid></item></channel></rss>