Package engine.neural.networks
Class Feedforward
java.lang.Object
engine.neural.networks.Feedforward
- All Implemented Interfaces:
Network,Reconstructible
"Simple" multi-layer neural network
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ActivationVariable that tracks the activation function being usedprivate Vector[]private Vector[]private final CostVariable that tracks the cost function being usedprivate floatVariable that keeps track of the last cost of the networkprivate final InitializerVariable that tracks the initializer being usedprivate final int[]Keeps track of the network geometryprivate final OptimizerVariable that tracks the optimizer being usedprivate Vector[]private Matrix[] -
Constructor Summary
ConstructorsConstructorDescriptionFeedforward(int[] networkSizes, Initializer initializer, Activation activation, Cost cost, Optimizer optimizer) Constructs a new multilayer neural networkFeedforward(String name) -
Method Summary
Modifier and TypeMethodDescriptionprivate voidprivate VectorfloatgetCost()private StringprintMatrices(Matrix[] m) voidsaveNetwork(String name) private ObjectFunction for finding and initializing network paramsvoidprivate voidtextToMatrix(Scanner scan, Matrix[] m) voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface engine.neural.Reconstructible
getClassInfo
-
Field Details
-
networkSizes
private final int[] networkSizesKeeps track of the network geometry -
biases
-
activations
-
preActivations
-
weights
-
initializer
Variable that tracks the initializer being used -
activation
Variable that tracks the activation function being used -
cost
Variable that tracks the cost function being used -
optimizer
Variable that tracks the optimizer being used -
currCost
private float currCostVariable that keeps track of the last cost of the network
-
-
Constructor Details
-
Feedforward
public Feedforward(int[] networkSizes, Initializer initializer, Activation activation, Cost cost, Optimizer optimizer) Constructs a new multilayer neural network- Parameters:
networkSizes- The size of each layer of the network, for instance, [2, 4, 4, 1] has an input of size 2, 2 hidden layers of size 4, and an output of size 1initializer- The specific way you want to populate the weights at creationactivation- The specific way you want neurons to firecost- The specific way you want to show how wrong the network isoptimizer- The specific way you want to push the network towards minima
-
Feedforward
- Throws:
Exception
-
-
Method Details
-
textToMatrix
-
search
Function for finding and initializing network params- Parameters:
str- Header informationscan- Scanner object- Returns:
- Class within text file
- Throws:
Exception
-
forward
-
backward
-
train
-
step
-
predict
-
getCost
public float getCost() -
saveNetwork
- Specified by:
saveNetworkin interfaceNetwork
-
printMatrices
-