Re: Algothim help



googlinggoogler@xxxxxxxxxxx said:

Hi,

I'm writing a neural network program in C, so that I can start to
tinker with them. I have a basic program already to do back propogation
and it works as i would expect.

But now im trying to write a program where I can specify the number of
layers and neurons per layer and then train it from that.

The actual mathmatics of the program is easy and the operation of the
network doesnt concern me at all.

What does and has baffled me as i've come up with lots of ideas but
find weakness in them all is this.

I might have a network where Layer 1 is smaller or bigger than the next
and Layer 2 might be smaller of bigger than any layer, and so on...
like this - http://tinyurl.com/yl7gda

my issue is how to store and retrieve the weights for each of the paths
between the neurons, in some sort of method which is simple to
reference to, i obviously know how many there will be and have thought
of using a array and then pulling out the number i know i should take
and then offsetting for the next layer of paths. But that seems
somewhat crude, what do you think?

Store the paths separately.

That lets you have a really simple neuron structure, something like:

struct neuron
{
int prevweight;
int currweight;
int threshold;
int inhibited;
};

You can have a dynamic array of these critters, which you'd allocate with
malloc:

n = number of neurons in this layer

struct neuron *thisbunch = malloc(n * sizeof *thisbunch);
if(thisbunch != NULL)
{
whoa, we have n neurons on this layer, and they're raring to go!

You might want to store the pointer in an array, for easy looping.

And then you have the path information. A path is a connection between two
neurons. We decide arbitrarily that this layer stores information about all
paths that *start* on this layer.

A path can then look something like this:

struct path
{
int startindex;
int endlayer; /* on which layer is the neuron that this connects to? */
int endindex; /* where on that layer is the neuron? */
double weight;
int is_inhibitory;
};

You can now have a dynamic array of these, two.

I think that gives you a totally flexible ANN, with as many layers as you
like, as many neurons on each layer as you like (independently settable),
and as many paths as you like, connecting anything to anything at your
convenience.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at the above domain, - www.
.



Relevant Pages

  • Re: Machine learning
    ... They usually consist of neurons, ... input layer, the intermediate layer and the output layer. ... into the network using a method called "back-propagation". ... Train the network until it recognises characters reliably.. ...
    (borland.public.delphi.thirdpartytools.general)
  • Algothim help
    ... I'm writing a neural network program in C, so that I can start to ... layers and neurons per layer and then train it from that. ... I might have a network where Layer 1 is smaller or bigger than the next ... of using a array and then pulling out the number i know i should take ...
    (comp.programming)
  • Re: Machine learning
    ... or ANN. ... They usually consist of neurons, ... layers: the input layer, the intermediate layer and the output layer. ... order to make the network do something useful, ...
    (borland.public.delphi.thirdpartytools.general)
  • Re: Invariant Recognition, Grandmother Cell, and Memory Hierarchy
    ... > neurons are very slow processors. ... > multiple levels of hierarchical tree (14 in the visual cortex alone, ... > travel six or seven layers before reaching the motor layer. ...
    (comp.ai.philosophy)
  • Re: [PATCH 00/13] Re: Scalability requirements for sysv ipc
    ... int nr; ... struct ridr_preget *ridp; ... If this layer is full mark the bit in the layer above to ... lock guarding all updates of a given ridr structure, ...
    (Linux-Kernel)