Package nnetwork
Class Node
java.lang.Object
nnetwork.Node
public class Node
extends java.lang.Object
Network node.
-
Field Summary
Fields Modifier and Type Field Description (package private) Bipolarsigm
b
(package private) double
bias
(package private) double
cum
(package private) java.lang.String
function
(package private) Hypertansigm
h
(package private) int
id
(package private) java.util.ArrayList<java.lang.Integer>
inputfrom
(package private) java.util.ArrayList<java.lang.Double>
inputs
(package private) Linear
l
(package private) java.lang.String
nodetype
(package private) java.util.ArrayList<java.lang.Integer>
outputto
(package private) ReLU
r
(package private) Sigm
s
(package private) Threshold
t
-
Constructor Summary
Constructors Constructor Description Node(int id, java.lang.String nodetype, java.lang.String function, double bias)
-
Method Summary
Modifier and Type Method Description double
activation(double d)
Select activation function.void
addinfrom(int e)
Add node to receive input from.void
addinput(java.lang.Double i)
Add input in ArrayList.void
addoutto(int s)
Add node to output to.void
clearinputs()
Clear inputs.void
cum()
Compute node cumulative output.double
getbias()
Get bias.double
getcum()
Get cumulative output.int
getid()
Get node ID.double
getinput(int in)
Get input from ArrayList.int[]
getinputfrom()
Get inputs from connected nodes.java.lang.String
getnodetype()
Get node type.int[]
getoutto()
Get outpu to connected nodes.java.lang.String
gettype()
Get node type.void
setbias(double b)
Set bias.void
setid(int i)
Set node ID.void
settype(java.lang.String t)
Set node type.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
id
int id -
nodetype
java.lang.String nodetype -
function
java.lang.String function -
bias
double bias -
inputfrom
java.util.ArrayList<java.lang.Integer> inputfrom -
outputto
java.util.ArrayList<java.lang.Integer> outputto -
inputs
java.util.ArrayList<java.lang.Double> inputs -
cum
double cum -
b
-
h
-
l
Linear l -
r
ReLU r -
s
Sigm s -
t
-
-
Constructor Details
-
Node
public Node(int id, java.lang.String nodetype, java.lang.String function, double bias)
-
-
Method Details
-
activation
public double activation(double d)Select activation function. -
addinput
public void addinput(java.lang.Double i)Add input in ArrayList. -
getinput
public double getinput(int in)Get input from ArrayList. -
clearinputs
public void clearinputs()Clear inputs. -
cum
public void cum()Compute node cumulative output. -
addinfrom
public void addinfrom(int e)Add node to receive input from. -
addoutto
public void addoutto(int s)Add node to output to. -
getinputfrom
public int[] getinputfrom()Get inputs from connected nodes. -
getoutto
public int[] getoutto()Get outpu to connected nodes. -
setid
public void setid(int i)Set node ID. -
settype
public void settype(java.lang.String t)Set node type. -
getid
public int getid()Get node ID. -
gettype
public java.lang.String gettype()Get node type. -
setbias
public void setbias(double b)Set bias. -
getbias
public double getbias()Get bias. -
getnodetype
public java.lang.String getnodetype()Get node type. -
getcum
public double getcum()Get cumulative output.
-