7308
Comment:
|
← Revision 72 as of 2011-08-30 18:14:49 ⇥
9373
|
Deletions are marked like this. | Additions are marked like this. |
Line 11: | Line 11: |
/!\ In this "g<<FootNote(genius, or goal, or glad, or gorgeous, or glory, but definitely not garbage)>>=max(intelligence)" workshop we are going to use PC's and Microsoft Windows. If you happen to have a Mac, no problem --- things mentioned in this workshop should work on Mac too. But please find a PC for this workshop because we are not going to deal with platform differences. | /!\ In this "g<<FootNote(the transfer function, or genius, or goal, or glad, or gorgeous, or glory, but definitely not garbage)>>=max(intelligence)" workshop we are going to use PC's and Microsoft Windows. If you happen to have a Mac, no problem --- things mentioned in this workshop should work on Mac too. But please find a PC for this workshop because we are not going to deal with platform differences. |
Line 16: | Line 16: |
/!\ This is a list of software to be used. | |
Line 37: | Line 36: |
Follow the installation instructions came with the software. | Follow the installation instructions came with the [[http://www.merchantos.com/features/cloud-based-point-of-sale|cloud point of sale system]] software. |
Line 39: | Line 38: |
When later we try to load Java externals, Max might complain about QuickTime not being installed. So if you don't hate Apple that much, install QuickTime. | When later we try to load Java externals, Max might complain about QuickTime not being installed. So if you don't hate Apple that much, install QuickTime [[http://www.cassetteplayer.org | Cassette Player]]. |
Line 72: | Line 71: |
Download Maxuino from [[http://www.parasitaere-kapazitaeten.net/max_msp/pduino_for_max|its website]] or from [[attachment:maxuino-004.zip|this wiki]]. | Download the latest Maxuino from [[http://www.maxuino.org|its website]] or version 004 from [[attachment:maxuino-004.zip|this wiki]]. |
Line 74: | Line 73: |
Unzip the downloaded zip file. You need to load Pd_firmware.pde to your Arduino board first. To do so, you need the Arduino programing environment. You might need [[http://www.arduino.cc/files/arduino-0011-win.zip|version 11]] instead of the later versions to get the old firmware up and running. | Unzip the downloaded zip file. You need to load Pd_firmware.pde to your Arduino board first. To do so, you need the [[http://arduino.cc/en/Main/Software|Arduino programing environment]]. If you see an error message such as "arduino.exe has stopped working" when start the arduino programming environment, use "run.bat" to start the program instead of "arduino.exe". |
Line 93: | Line 92: |
=== The Max patcher === | === A simple patcher: xor.maxpat === |
Line 96: | Line 95: |
=== Something more interesting: xor_arduino.maxpat === Want to see how the AdMoVeo robot can take advantage of the Max/Java intelligence? Take some middleware, let's work it through: {{attachment:xor_arduino.png}} |
|
Line 159: | Line 163: |
== Q&A == === What is "learning rate"? what is "momentum" in JOONE? === The learning rate represents the 'speed' of the virtual point (the blue ball in the above figure) along the error surface, and the momentum represents the 'inertia' of that point. [[attachment:JooneCompleteGuide.pdf|The Joone Complete Guide]] has more detailed illustrative explanation in page 69. {{attachment:errorsurface.png}} === What is this "sigmoid" mentioned here and there? === Did I tell you that you should read [[attachment:JooneCompleteGuide.pdf|The Joone Complete Guide]]? or do you know our best friend [[http://en.wikipedia.org/wiki/Sigmoid_function|wikipedia]]? Alright, the answer (copied from [[http://en.wikipedia.org/wiki/Sigmoid_function|wikipedia]]): {{http://upload.wikimedia.org/math/c/6/8/c681ea98a754c7f47276e7733d37c847.png}} {{http://upload.wikimedia.org/wikipedia/commons/thumb/8/88/Logistic-curve.svg/320px-Logistic-curve.svg.png}} === What is RMSE? is it the same as the cost function that Rene mentioned? === Well, read it [[http://en.wikipedia.org/wiki/Mean_squared_error|here]]. === I really want to know what backpropagation is ! === Very good! Does the word "backward" in the following picture ring a bell? {{attachment:backpropagation.png}} No? then I can't help that much. Then you really need to spend some time on [[attachment:JooneCompleteGuide.pdf|The Joone Complete Guide]] or the book [[http://www.heatonresearch.com/articles/series/1|Introduction to Neural Networks with Java]]. ##The End ################################################################################ <<BR>><<BR>> ---- |
g=max(intelligence)
Philip Ross, Jun Hu and Rene Ahn
March 2009
In this "g1=max(intelligence)" workshop we are going to use PC's and Microsoft Windows. If you happen to have a Mac, no problem --- things mentioned in this workshop should work on Mac too. But please find a PC for this workshop because we are not going to deal with platform differences.
1. Workshop material
1.1. Software
Java SE Runtime Environment (JRE) or Java SE Development Kit (JDK).
For this workshop, JRE is enough. But you might want to install JDK in order to use an integrated Java editing and compiling tool within Max.
1.2. Hardware
1.3. Middleware
1.4. Reading
The Joone Complete Guide, PDF, 2M.
Writing Max Externals in Java, PDF, 500K.
Introduction to Neural Networks with Java, online book.
2. Software Installation & Configuration
2.1. Max
Follow the installation instructions came with the cloud point of sale system software.
When later we try to load Java externals, Max might complain about QuickTime not being installed. So if you don't hate Apple that much, install QuickTime Cassette Player.
2.2. JRE or JDK
To make use of Max quickie (an integrated Java editing and compiling tool within Max), you have to install JDK for its Java compiler. Since in this workshop we are going to use Eclipse for programming Java, JDK is not necessary.
No matter which one to be installed, run the installer and simply follow the instructions.
2.3. Eclipse
To synchronize what we are going to point to and what we are talking about, please install Eclipse and JOONE in C:\Programs. ( Note, not C:\Program Files --- it has a good reason to do so.)
Extract the downloaded ZIP file to C:\Programs so that eclipse.exe is in C:\Programs\eclipse. Create a shortcut to C:\Programs\eclipse\eclipse.exe on your desktop: Go to C:\Programs\eclipse, right click on eclipse.exe, select Send to and then Desktop(create shortcut).
2.4. JOONE
Download the GUI editor.
If you are using Windows XP, download the version for Windows (Without JVM).
Run the installer. When asked by about where would you like to install, answer "C:\Programs\joone". When asked about where would you like to create links, select Other, and choose your Desktop. If you see an error message about available disk space, possibly because you have too much of space left on you C: disk and the installer could not understand the big number of bytes. Ignore the error message unless you are really running out of disk space.
If you are using Windows Vista or Mac, download the version for All Platfs (Without JVM).
Extract the downloaded Zip file to C:\Programs so that RunEditor.bat is in C:\Programs\joone. Create a shortcut to RunEditor.bat on your desktop.
After installed Eclipse and JOONE, check again to see whether they are at right places:
2.5. JOONE engine for Max
To be able to use Java externals with JOONE engine in Max, JOONE engine must be visible to Max. A simple way to enable it is to copy the JOONE engine
C:\Programs\joone\lib\joone-engine.jar
and put it into Max's Java library directory (suppose you have installed Max at suggested default place):
C:\Program Files\Cycling '74\Max 5.0\Cycling '74\java\lib
2.6. Maxuino
Download the latest Maxuino from its website or version 004 from this wiki.
Unzip the downloaded zip file. You need to load Pd_firmware.pde to your Arduino board first. To do so, you need the Arduino programing environment. If you see an error message such as "arduino.exe has stopped working" when start the arduino programming environment, use "run.bat" to start the program instead of "arduino.exe".
To use the arduino object in Max, you have to either put arduino.pat in the same directory of your own patcher, or copy arduino.pat to somewhere Max can find it, for example
C:\Program Files\Cycling '74\Max 5.0\Cycling '74\max-externals
is a good place.
2.7. Setup Eclipse
In order to communicate with the Max patcher and the JOONE engine, your eclipse project must include both the max.jar library and the joone-engine.jar in its build path:
3. Simple Example: XOR
Follow the GUI example from JOONE website, build and train the neural network to solve the XOR problem. Export the network and load it in your Java program. Try to use the Java program in Max.
The complete source code, sample data and the Max patcher can be downloaded xor.zip
Take a deep breath, here are some beautiful parts from xor.zip:
3.1. A simple patcher: xor.maxpat
3.2. Something more interesting: xor_arduino.maxpat
Want to see how the AdMoVeo robot can take advantage of the Max/Java intelligence? Take some middleware, let's work it through:
3.3. The Java external
import org.joone.engine.*;
import org.joone.net.*;
import com.cycling74.max.*;
public class XorNet extends MaxObject {
NeuralNet nnet = null;
String snet = "C:/Users/jhu/Documents/Development/workspace/XOR/XOR.snet";
DirectSynapse memInp = null;
DirectSynapse memOut = null;
public float inlet_left = 0;
public float inlet_right = 0;
public XorNet() {
declareInlets(new int[]{DataTypes.FLOAT, DataTypes.FLOAT});
declareOutlets(new int[]{DataTypes.FLOAT});
initNet();
}
private void initNet(){
NeuralNetLoader netLoader = new NeuralNetLoader(snet);
nnet = netLoader.getNeuralNet();
Layer input = nnet.getInputLayer();
input.removeAllInputs();
memInp = new DirectSynapse();
input.addInputSynapse(memInp);
Layer output = nnet.getOutputLayer();
output.removeAllOutputs();
memOut = new DirectSynapse();
output.addOutputSynapse(memOut);
nnet.getMonitor().setLearning(false);
nnet.start();
}
public void inlet(float f){
int inlet_no = getInlet();
if(inlet_no == 0)
inlet_left = f;
else
inlet_right = f;
}
public void bang(){
Pattern iPattern = new Pattern(new double[]{inlet_left, inlet_right});
memInp.fwdPut(iPattern);
Pattern oPattern = memOut.fwdGet();
outlet(0, oPattern.getArray()[0]);
}
}
4. Q&A
4.1. What is "learning rate"? what is "momentum" in JOONE?
The learning rate represents the 'speed' of the virtual point (the blue ball in the above figure) along the error surface, and the momentum represents the 'inertia' of that point. The Joone Complete Guide has more detailed illustrative explanation in page 69.
4.2. What is this "sigmoid" mentioned here and there?
Did I tell you that you should read The Joone Complete Guide? or do you know our best friend wikipedia?
Alright, the answer (copied from wikipedia):
4.3. What is RMSE? is it the same as the cost function that Rene mentioned?
Well, read it here.
4.4. I really want to know what backpropagation is !
Very good! Does the word "backward" in the following picture ring a bell?
No? then I can't help that much. Then you really need to spend some time on The Joone Complete Guide or the book Introduction to Neural Networks with Java.
the transfer function, or genius, or goal, or glad, or gorgeous, or glory, but definitely not garbage (1)