📄 readme
字号:
Perceptron ProgramWelcome to the wonderful world of the Perceptron C++ directory. Thisprogram demonstrates the perceptron learning algorithm with a verysimple perceptron network, a logic threshold unit. It is meant to be acompanion to chapter 5 of the "Artificial Intelligence" textbook. Thiscode was written by Jon Monsarrat, jgm@cs.brown.edu.Four sections describe the program:1. The problem2. Building the program3. Running the program4. The solution, and how to read the source code----------------------------------------------------------------------1. The problemThe book goes into quite some detail about the problem, but here it isin a nutshell.We have some function (let's pretend it's unknown or takes a long timeto compute). We want a perceptron network to simulate the function.Unfortunately, a perceptron network must be configured with a bunchof weights that tell the network how to work. This program solves theproblem by learning the weights.----------------------------------------------------------------------2. Building the programThe source code in this directory is complete and does not depend uponthe support directory or any other source code from the textbook. Itonly uses standard and libraries which should come any C++ compiler.You can build this program in UNIX by simply typing makeYou may need to edit the Makefile to change the name of the compiler,if you do not have a compiler named "CC".You will need to recompile the program to try out new functions. Thisis because function are written in C++ and must be themselves compiled.----------------------------------------------------------------------3. Running the programRunning the program is very simple. Just type perceptron -orTo try to learn the two bit "or" function. You can also type perceptron -and for "and" perceptron -xor for "exclusive or"These three functions come with the perceptron program, but you arewelcome to make up your own. You'll need to read the code andrecompile the program to do this.----------------------------------------------------------------------4. The solution, and how to read the source codeThis solution doesn't have much to do with the Lisp version givenin the textbook. It's the exact same algorithm, but I chose torepresent functions in a more C++-like way. In the Lisp program, a function is a list of input-output combinations. You never need to generate all combinations of inputs because all combinations of inputs are listed explicitly in the function. It is possible to have a function where only some of the input values are valid. In the C++ program, a function is a real C++ function. To get all combinations of inputs, they must be generated. The perceptron program does this. It is not possible to have a partially defined function which does not return values for some inputs. The classes are: Perceptron -- Holds the entire perceptron, and runs the learning algorithm Function -- Holds a single function, which is a pointer to a real C++ function.There are only 2 source files in this directory: Perceptron.C The Perceptron class Function.C The Function class----------------------------------------------------------------------
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -