-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPBGNeuron.h
More file actions
58 lines (42 loc) · 1.26 KB
/
PBGNeuron.h
File metadata and controls
58 lines (42 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// PBGNeuron.h
// neurosis
//
// Created by Patrick B. Gibson on 27/10/07.
// Copyright 2007 Patrick B. Gibson. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "PBGWeightedConnection.h"
#import <math.h>
enum PBGActivationFunction {
PBGSignFunction,
PBGStepFunction,
PBGSigmoidFunction,
PBGSigmoidFunctionHyperbolic,
PBGLinearFunction
};
@interface PBGNeuron : NSObject {
int neuronID;
NSMutableArray *inputConnectionsArray;
double value;
BOOL valueWasExplicitlySet; // Used in order to create "Dummy" Neurons for the input layer.
BOOL usingThreshold;
double threshold;
double newThreshold;
double errorGradient;
enum PBGActivationFunction activationFunction;
}
- (id)initWithID:(int)i networkSize:(int)netSize threshold:(BOOL)t;
- (double)outputValue;
- (double)errorGradientUsingExpectedOutput:(double)expectedOutput;
- (double)errorGradient;
- (void)setErrorGradient:(double)e;
- (void)addInputConnection:(PBGWeightedConnection *)connection;
- (PBGWeightedConnection *)connectionToNeuron:(PBGNeuron *)neuron;
- (void)setValue:(double)newValue;
- (void)setThreshold:(double)t;
- (double)threshold;
- (NSMutableArray *)inputConnectionsArray;
- (void)setNewThreshold:(double)t;
- (void)updateNow;
@end