<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://replica.wiki.extremist.software/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cortiz</id>
	<title>Noisebridge - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://replica.wiki.extremist.software/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Cortiz"/>
	<link rel="alternate" type="text/html" href="https://replica.wiki.extremist.software/wiki/Special:Contributions/Cortiz"/>
	<updated>2026-04-05T11:39:58Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.39.13</generator>
	<entry>
		<id>https://replica.wiki.extremist.software/index.php?title=User:Cortiz&amp;diff=3491</id>
		<title>User:Cortiz</title>
		<link rel="alternate" type="text/html" href="https://replica.wiki.extremist.software/index.php?title=User:Cortiz&amp;diff=3491"/>
		<updated>2009-03-12T05:53:11Z</updated>

		<summary type="html">&lt;p&gt;Cortiz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;h1&amp;gt;C code for the machine learning class 03/11/09&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;I used a different scale than the rest of the class. I worked entirely with integers, threshold is 500.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Scroll down for partial output. cheers.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
/*=================================================================&lt;br /&gt;
Author:         Cristian Ortiz (co.ortiz@gmail.com)&lt;br /&gt;
Description:    Coded for the perceptron class @noisebridge. peace.&lt;br /&gt;
===================================================================*/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int dot_prod(int * A, int * B, int n){&lt;br /&gt;
    int i=0;&lt;br /&gt;
    int R=0;&lt;br /&gt;
    for(i=0;i&amp;lt;n;i++){&lt;br /&gt;
        R+=A[i]*B[i];&lt;br /&gt;
    }&lt;br /&gt;
    return R;&lt;br /&gt;
}&lt;br /&gt;
int * sca_prod(int * A, int n, int x){&lt;br /&gt;
    int i=0;&lt;br /&gt;
    int * R;&lt;br /&gt;
    for(i=0;i&amp;lt;n;i++){&lt;br /&gt;
        R[i]=A[i]*x;&lt;br /&gt;
    }&lt;br /&gt;
    return R;&lt;br /&gt;
}&lt;br /&gt;
int main(void) {&lt;br /&gt;
    int input_vec[]={1,0,0,1,0,1,1,1,0,1,1,1};&lt;br /&gt;
    int expected[]={1,1,1,0};&lt;br /&gt;
    int input_offset=0;&lt;br /&gt;
    int w_vec[]={1,1,1};&lt;br /&gt;
    int learned=0;&lt;br /&gt;
    int i=0;&lt;br /&gt;
    int output=0;&lt;br /&gt;
    int dot_result=0;&lt;br /&gt;
	int * pvec;&lt;br /&gt;
	int th=500;&lt;br /&gt;
    int adjust=0;	&lt;br /&gt;
    &lt;br /&gt;
    while (learned!=4){&lt;br /&gt;
        //printf(&amp;quot;input offset: %d\n&amp;quot;, input_offset);&lt;br /&gt;
        pvec=input_vec+(input_offset*3);&lt;br /&gt;
        dot_result=dot_prod(pvec, w_vec, 3);&lt;br /&gt;
        output=(dot_result&amp;gt;th);&lt;br /&gt;
        printf(&amp;quot;ouput: %d supposed to be %d&amp;quot;, output, expected[input_offset]);&lt;br /&gt;
        &lt;br /&gt;
        if(output==expected[input_offset]){printf(&amp;quot;\t\t\t&amp;lt;OK!&amp;gt;\n&amp;quot;);}&lt;br /&gt;
        else {printf(&amp;quot;\t\t\t&amp;lt;Miss!&amp;gt;\n&amp;quot;);}&lt;br /&gt;
        &lt;br /&gt;
        if(output&amp;gt;expected[input_offset]){adjust=-1;}&lt;br /&gt;
        else if (output&amp;lt;expected[input_offset]){adjust=1;}&lt;br /&gt;
        else { learned++; }&lt;br /&gt;
        &lt;br /&gt;
        if(output!=expected[input_offset]){&lt;br /&gt;
            for(i=0;i&amp;lt;3;i++){&lt;br /&gt;
            	w_vec[i]=w_vec[i]+(input_vec[i+input_offset*3]*(adjust));&lt;br /&gt;
            	printf(&amp;quot;new w_vec[%d]: %d\n&amp;quot;, i, w_vec[i]);	&lt;br /&gt;
            }&lt;br /&gt;
            learned=0;&lt;br /&gt;
        }&lt;br /&gt;
        input_offset=(input_offset==3)?0:input_offset+1;&lt;br /&gt;
    }&lt;br /&gt;
    for(i=0;i&amp;lt;3;i++){&lt;br /&gt;
        printf(&amp;quot;Final w_vec[%d]=%d\n&amp;quot;, i, w_vec[i]);&lt;br /&gt;
    }&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;br /&gt;
&amp;lt;h1&amp;gt;Last 20 lines of output:&amp;lt;/h1&amp;gt;&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
ouput: 0 supposed to be 1			&amp;lt;Miss!&amp;gt;&lt;br /&gt;
new w_vec[0]: 503&lt;br /&gt;
new w_vec[1]: -1&lt;br /&gt;
new w_vec[2]: -1&lt;br /&gt;
ouput: 1 supposed to be 0			&amp;lt;Miss!&amp;gt;&lt;br /&gt;
new w_vec[0]: 502&lt;br /&gt;
new w_vec[1]: -2&lt;br /&gt;
new w_vec[2]: -2&lt;br /&gt;
ouput: 1 supposed to be 1			&amp;lt;OK!&amp;gt;&lt;br /&gt;
ouput: 0 supposed to be 1			&amp;lt;Miss!&amp;gt;&lt;br /&gt;
new w_vec[0]: 503&lt;br /&gt;
new w_vec[1]: -2&lt;br /&gt;
new w_vec[2]: -1&lt;br /&gt;
ouput: 1 supposed to be 1			&amp;lt;OK!&amp;gt;&lt;br /&gt;
ouput: 0 supposed to be 0			&amp;lt;OK!&amp;gt;&lt;br /&gt;
ouput: 1 supposed to be 1			&amp;lt;OK!&amp;gt;&lt;br /&gt;
ouput: 1 supposed to be 1			&amp;lt;OK!&amp;gt;&lt;br /&gt;
Final w_vec[0]=503&lt;br /&gt;
Final w_vec[1]=-2&lt;br /&gt;
Final w_vec[2]=-1&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cortiz</name></author>
	</entry>
	<entry>
		<id>https://replica.wiki.extremist.software/index.php?title=User:Cortiz&amp;diff=3490</id>
		<title>User:Cortiz</title>
		<link rel="alternate" type="text/html" href="https://replica.wiki.extremist.software/index.php?title=User:Cortiz&amp;diff=3490"/>
		<updated>2009-03-12T05:47:00Z</updated>

		<summary type="html">&lt;p&gt;Cortiz: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Didnt know how to make a page so i just pasted it here.&lt;br /&gt;
&amp;lt;p&amp;gt;C code for the machine learning class 03/11/09&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;I used a different scale than the rest of the class. I worked entirely with integers, threshold is 500.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;cheers.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
/*=================================================================&lt;br /&gt;
Author:         Cristian Ortiz (co.ortiz@gmail.com)&lt;br /&gt;
Description:    Coded for the perceptron class @noisebridge. peace.&lt;br /&gt;
===================================================================*/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int dot_prod(int * A, int * B, int n){&lt;br /&gt;
    int i=0;&lt;br /&gt;
    int R=0;&lt;br /&gt;
    for(i=0;i&amp;lt;n;i++){&lt;br /&gt;
        R+=A[i]*B[i];&lt;br /&gt;
    }&lt;br /&gt;
    return R;&lt;br /&gt;
}&lt;br /&gt;
int * sca_prod(int * A, int n, int x){&lt;br /&gt;
    int i=0;&lt;br /&gt;
    int * R;&lt;br /&gt;
    for(i=0;i&amp;lt;n;i++){&lt;br /&gt;
        R[i]=A[i]*x;&lt;br /&gt;
    }&lt;br /&gt;
    return R;&lt;br /&gt;
}&lt;br /&gt;
int main(void) {&lt;br /&gt;
    int input_vec[]={1,0,0,1,0,1,1,1,0,1,1,1};&lt;br /&gt;
    int expected[]={1,1,1,0};&lt;br /&gt;
    int input_offset=0;&lt;br /&gt;
    int w_vec[]={1,1,1};&lt;br /&gt;
    int learned=0;&lt;br /&gt;
    int i=0;&lt;br /&gt;
    int output=0;&lt;br /&gt;
    int dot_result=0;&lt;br /&gt;
	int * pvec;&lt;br /&gt;
	int th=500;&lt;br /&gt;
    int adjust=0;	&lt;br /&gt;
    &lt;br /&gt;
    while (learned!=4){&lt;br /&gt;
        //printf(&amp;quot;input offset: %d\n&amp;quot;, input_offset);&lt;br /&gt;
        pvec=input_vec+(input_offset*3);&lt;br /&gt;
        dot_result=dot_prod(pvec, w_vec, 3);&lt;br /&gt;
        output=(dot_result&amp;gt;th);&lt;br /&gt;
        printf(&amp;quot;ouput: %d supposed to be %d&amp;quot;, output, expected[input_offset]);&lt;br /&gt;
        &lt;br /&gt;
        if(output==expected[input_offset]){printf(&amp;quot;\t\t\t&amp;lt;OK!&amp;gt;\n&amp;quot;);}&lt;br /&gt;
        else {printf(&amp;quot;\t\t\t&amp;lt;Miss!&amp;gt;\n&amp;quot;);}&lt;br /&gt;
        &lt;br /&gt;
        if(output&amp;gt;expected[input_offset]){adjust=-1;}&lt;br /&gt;
        else if (output&amp;lt;expected[input_offset]){adjust=1;}&lt;br /&gt;
        else { learned++; }&lt;br /&gt;
        &lt;br /&gt;
        if(output!=expected[input_offset]){&lt;br /&gt;
            for(i=0;i&amp;lt;3;i++){&lt;br /&gt;
            	w_vec[i]=w_vec[i]+(input_vec[i+input_offset*3]*(adjust));&lt;br /&gt;
            	printf(&amp;quot;new w_vec[%d]: %d\n&amp;quot;, i, w_vec[i]);	&lt;br /&gt;
            }&lt;br /&gt;
            learned=0;&lt;br /&gt;
        }&lt;br /&gt;
        input_offset=(input_offset==3)?0:input_offset+1;&lt;br /&gt;
    }&lt;br /&gt;
    for(i=0;i&amp;lt;3;i++){&lt;br /&gt;
        printf(&amp;quot;Final w_vec[%d]=%d\n&amp;quot;, i, w_vec[i]);&lt;br /&gt;
    }&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cortiz</name></author>
	</entry>
	<entry>
		<id>https://replica.wiki.extremist.software/index.php?title=Machine_Learning_Meetup_Notes:_2009-03-11&amp;diff=3489</id>
		<title>Machine Learning Meetup Notes: 2009-03-11</title>
		<link rel="alternate" type="text/html" href="https://replica.wiki.extremist.software/index.php?title=Machine_Learning_Meetup_Notes:_2009-03-11&amp;diff=3489"/>
		<updated>2009-03-12T05:43:06Z</updated>

		<summary type="html">&lt;p&gt;Cortiz: /* Machine Learning Meetup Notes: 2009-03-11 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Machine Learning Meetup Notes: 2009-03-11==&lt;br /&gt;
&lt;br /&gt;
We made perceptrons.  To learn how, you should go to Wikipedia [http://en.wikipedia.org/wiki/Perceptron]&lt;br /&gt;
&lt;br /&gt;
We had the following success:&lt;br /&gt;
&lt;br /&gt;
* Mathematica, by Christoph ([https://www.noisebridge.net/wiki/Image:NoisebridgeNeuralNetworks.pdf PDF], because noisebridge is &#039;&#039;a little&#039;&#039; too anti-commercial)&lt;br /&gt;
* Matlab/Octave by Jean&lt;br /&gt;
* Python by Skory and Rachel&lt;br /&gt;
* Ruby by Zhao [https://www.noisebridge.net/wiki/Machine_Learning_Meetup_Notes_Ruby_Zhao]&lt;br /&gt;
* C by Cristian [https://www.noisebridge.net/wiki/User:Cortiz]&lt;br /&gt;
* [https://www.noisebridge.net/wiki/davids_perceptron.pl Python implementation by David Stainton]&lt;br /&gt;
&lt;br /&gt;
Everyone should upload their code!&lt;/div&gt;</summary>
		<author><name>Cortiz</name></author>
	</entry>
	<entry>
		<id>https://replica.wiki.extremist.software/index.php?title=User:Cortiz&amp;diff=3488</id>
		<title>User:Cortiz</title>
		<link rel="alternate" type="text/html" href="https://replica.wiki.extremist.software/index.php?title=User:Cortiz&amp;diff=3488"/>
		<updated>2009-03-12T05:42:06Z</updated>

		<summary type="html">&lt;p&gt;Cortiz: New page: Didnt know how to make a page so i just pasted it here. code for the machine learning class 03/11/09:  &amp;lt;PRE&amp;gt; /*================================================================= Author:    ...&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Didnt know how to make a page so i just pasted it here.&lt;br /&gt;
code for the machine learning class 03/11/09:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;PRE&amp;gt;&lt;br /&gt;
/*=================================================================&lt;br /&gt;
Author:         Cristian Ortiz (co.ortiz@gmail.com)&lt;br /&gt;
Description:    Coded for the perceptron class @noisebridge. peace.&lt;br /&gt;
===================================================================*/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int dot_prod(int * A, int * B, int n){&lt;br /&gt;
    int i=0;&lt;br /&gt;
    int R=0;&lt;br /&gt;
    for(i=0;i&amp;lt;n;i++){&lt;br /&gt;
        R+=A[i]*B[i];&lt;br /&gt;
    }&lt;br /&gt;
    return R;&lt;br /&gt;
}&lt;br /&gt;
int * sca_prod(int * A, int n, int x){&lt;br /&gt;
    int i=0;&lt;br /&gt;
    int * R;&lt;br /&gt;
    for(i=0;i&amp;lt;n;i++){&lt;br /&gt;
        R[i]=A[i]*x;&lt;br /&gt;
    }&lt;br /&gt;
    return R;&lt;br /&gt;
}&lt;br /&gt;
int main(void) {&lt;br /&gt;
    int input_vec[]={1,0,0,1,0,1,1,1,0,1,1,1};&lt;br /&gt;
    int expected[]={1,1,1,0};&lt;br /&gt;
    int input_offset=0;&lt;br /&gt;
    int w_vec[]={1,1,1};&lt;br /&gt;
    int learned=0;&lt;br /&gt;
    int i=0;&lt;br /&gt;
    int output=0;&lt;br /&gt;
    int dot_result=0;&lt;br /&gt;
	int * pvec;&lt;br /&gt;
	int th=500;&lt;br /&gt;
    int adjust=0;	&lt;br /&gt;
    &lt;br /&gt;
    while (learned!=4){&lt;br /&gt;
        //printf(&amp;quot;input offset: %d\n&amp;quot;, input_offset);&lt;br /&gt;
        pvec=input_vec+(input_offset*3);&lt;br /&gt;
        dot_result=dot_prod(pvec, w_vec, 3);&lt;br /&gt;
        output=(dot_result&amp;gt;th);&lt;br /&gt;
        printf(&amp;quot;ouput: %d supposed to be %d&amp;quot;, output, expected[input_offset]);&lt;br /&gt;
        &lt;br /&gt;
        if(output==expected[input_offset]){printf(&amp;quot;\t\t\t&amp;lt;OK!&amp;gt;\n&amp;quot;);}&lt;br /&gt;
        else {printf(&amp;quot;\t\t\t&amp;lt;Miss!&amp;gt;\n&amp;quot;);}&lt;br /&gt;
        &lt;br /&gt;
        if(output&amp;gt;expected[input_offset]){adjust=-1;}&lt;br /&gt;
        else if (output&amp;lt;expected[input_offset]){adjust=1;}&lt;br /&gt;
        else { learned++; }&lt;br /&gt;
        &lt;br /&gt;
        if(output!=expected[input_offset]){&lt;br /&gt;
            for(i=0;i&amp;lt;3;i++){&lt;br /&gt;
            	w_vec[i]=w_vec[i]+(input_vec[i+input_offset*3]*(adjust));&lt;br /&gt;
            	printf(&amp;quot;new w_vec[%d]: %d\n&amp;quot;, i, w_vec[i]);	&lt;br /&gt;
            }&lt;br /&gt;
            learned=0;&lt;br /&gt;
        }&lt;br /&gt;
        input_offset=(input_offset==3)?0:input_offset+1;&lt;br /&gt;
    }&lt;br /&gt;
    for(i=0;i&amp;lt;3;i++){&lt;br /&gt;
        printf(&amp;quot;Final w_vec[%d]=%d\n&amp;quot;, i, w_vec[i]);&lt;br /&gt;
    }&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/PRE&amp;gt;&lt;/div&gt;</summary>
		<author><name>Cortiz</name></author>
	</entry>
	<entry>
		<id>https://replica.wiki.extremist.software/index.php?title=Machine_Learning_Meetup_Notes:_2009-03-11&amp;diff=3487</id>
		<title>Machine Learning Meetup Notes: 2009-03-11</title>
		<link rel="alternate" type="text/html" href="https://replica.wiki.extremist.software/index.php?title=Machine_Learning_Meetup_Notes:_2009-03-11&amp;diff=3487"/>
		<updated>2009-03-12T05:24:40Z</updated>

		<summary type="html">&lt;p&gt;Cortiz: /* Machine Learning Meetup Notes: 2009-03-11 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Machine Learning Meetup Notes: 2009-03-11==&lt;br /&gt;
&lt;br /&gt;
We made perceptrons.  To learn how, you should go to Wikipedia [http://en.wikipedia.org/wiki/Perceptron]&lt;br /&gt;
&lt;br /&gt;
We had the following success:&lt;br /&gt;
&lt;br /&gt;
* Mathematica, by Christoph ([https://www.noisebridge.net/wiki/Image:NoisebridgeNeuralNetworks.pdf PDF], because noisebridge is &#039;&#039;a little&#039;&#039; too anti-commercial)&lt;br /&gt;
* Matlab/Octave by Jean&lt;br /&gt;
* Python by Skory and Rachel&lt;br /&gt;
* Ruby by Zhao [https://www.noisebridge.net/wiki/Machine_Learning_Meetup_Notes_Ruby_Zhao]&lt;br /&gt;
* C by Cristian&lt;br /&gt;
* [https://www.noisebridge.net/wiki/davids_perceptron.pl Python implementation by David Stainton]&lt;br /&gt;
&lt;br /&gt;
Everyone should upload their code!&lt;/div&gt;</summary>
		<author><name>Cortiz</name></author>
	</entry>
</feed>