codesimian
Class NeuralNets

java.lang.Object
  extended by codesimian.NeuralNets

public class NeuralNets
extends java.lang.Object

this class has static functions for using NEURAL NETWORKS, which are groups of NEURAL NODES (example: SimpleNeuralNode).

A neural-node is a CS whose countP() is at least 3, and P(0) is a list of neural-nodes this neural-node connects to, and P(1) is a list of weights that is forced to sum to 1, and P(2) is the action to do when this neural-node fires (often modifying other neural-nodes recursively).

Also, a neural node must increase the values of the neural-nodes it connects to (in weighted proportions) and decrease its own value, when it fires.

WARNING: NOT IMPLEMENTED IN ALL CSs: P(0).countP() <= P(1).countP(). The higher part of P(1) is ignored.

In the simplest type of natural-language neural-net, the name of a neural-node is the word that node represents. To save memory (and to be simple), there are no nodes between the words. WHY? (WARNING: VERY THEORETICAL) Theres thousands of words it needs to know, and to equal simian intelligence, it needs millions of neural-nets distributed across many variations of the CodeSimian.jar file. A distributed chatbot that creates specializations on the fly and reads and writes sentences 1 word (or letter) at a time. By reading the internet with these many neural-nets, CodeSimian will learn to improve itself autonomously. It should also read its own source-code, including the comments. It should learn to predict the next text, given the previous text. For a long constant string, this should be easy, but if it does that, the benefit is it can interpolate between ideas it has learned to approximately duplicate. A neural-net is a set of ideas. Evolve neural nets and sequences of them (output from one is input to next).


Method Summary
 CS[] getAllNodes(CS rootNode)
          Returns array of neural-nodes.
 CS joinNets(CS anyNodeInNetworkA, CS anyNodeInNetworkB, double weightFractionB)
          returns any root node (root means can find all the other nodes) in the new network.
 void renameDuplicateNodeNames(CS anyNetworkRoot)
          adds "x" or "xx" or "xxx"...
static CS[] verify(CS anyNetworkRoot, int maxNodes)
          if verifies its (a node in) a neural-network then returns array size 0.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

joinNets

public CS joinNets(CS anyNodeInNetworkA,
                   CS anyNodeInNetworkB,
                   double weightFractionB)
returns any root node (root means can find all the other nodes) in the new network. If no root of both networks simultaneously exists then one is created whose childs are the copies of the 2 neural-node parameters of this function.

Nodes with the same name() are merged in the returned network.

If weightFractionB==.7 then nodes that overlap in both networks are merged with ratio .3*networkA to .7*networkB.


getAllNodes

public CS[] getAllNodes(CS rootNode)
Returns array of neural-nodes. aNeuralNode(listChilds listWeights action)


renameDuplicateNodeNames

public void renameDuplicateNodeNames(CS anyNetworkRoot)
adds "x" or "xx" or "xxx"... to end of name until its unique. Traverses whole network eliminating duplicate names, so you can correctly convert it to codesimian code.


verify

public static CS[] verify(CS anyNetworkRoot,
                          int maxNodes)
                   throws BigOException
if verifies its (a node in) a neural-network then returns array size 0. Else returns the CSs that are not neural-nodes (but no CSs past them).

If maxNodes is exceeded, returns all CSs traversed so far (always at least 1). That means none of the CSs are neuaral-nodes because all nodes recursively connected are not neural-nodes.

Throws:
BigOException