This is Neuron.h in view mode; [Download] [Up]
/* =======================================================
Neural Network Classes for the NeXT Computer
Written by: Ralph Zazula
University of Arizona - Fall 1991
zazula@pri.com (NeXT Mail)
==========================================================*/
/*$Log: Neuron.h,v $
* Revision 1.2 92/01/14 21:20:28 zazula
* Check in before HashTable mod
*
* Revision 1.1 92/01/02 12:42:30 zazula
* Initial revision
* */
#import <objc/Object.h>
#import <objc/List.h>
#import <objc/Storage.h>
#import "Random.h" // Random number generator
typedef struct {
id source;
double weight;
struct connection *next;
} connection;
@interface Neuron:Object
#define Binary 0 // Node Types
#define Sigmoid 1
#define Sign 2
#define Tanh 3
{
id inputs; // list of Neuron's that are inputs to this Neuron
double lastOutput; // output value from last time step
double T; // Temperature
id random; // Random instance
int nodeType; // the type of this node
connection *head, // the head of the linked list
*tail; // the tail of the linked list
BOOL Symmetric; // symmetric connections?
}
- (double)activation:(double)net;
- init; // initialization method
- step; // read inputs and generate output
- inputs; // returns a pointer to the List of inputs
- (double)lastOutput; // returns the last output value of the Neuron
- connect:sender; // add sender to the list of inputs to this Neuron
- connect:sender withWeight:(double)weight;
- (double)getWeightFor:source;
// returns the weight for the given input Neuron
- setWeightFor:source to:(double)weight;
// sets the weight for the given input Neuron
- setOutput:(double)output;// set the output value manually (used for inputs)
- changeWeightFor:source by:(double)delta;
- setType:(int)type; // set the type of node - determines the activation
// function
- (int)getType; // returns the node type for this Neuron
- setTemp:(double)newT; // set the temperature for the neuron
- (double)getTemp; // returns the temperature
- setRandom:theRandom; // set random number generator pointer
- setSymmetric:(BOOL)sym; // set symmetric connection status
- (BOOL)getSymmetric; // return the symmetric connection status
@endThese are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.