Database Reference
In-Depth Information
Figure 11.4
Multi-Layer Feed-Forward Network Implementation
The type of neural network described earlier is known as a feed-forward
network. This is because inputs arrive at the input layer and then
information is fed forward through the network to the output layer.
To implement this model, first define a Layer class. This class holds the
current values for the layer as well as the weight matrix that is used to
produce the weighted sum of values. The size of the weight matrix is defined
by the number of units and the number of inputs to the layer. There is also
an array of bias weights included in the layer implementation:
public class Layer {
double[] v;
double[][] w;
double[] bW = null;
Activation fn;
public Layer(int units,int inputs,Activation
fn,boolean bias) {
this.fn = fn;
v = new double[units];
w = new double[units][];
for(int i=0;i<v.length;i++) w[i] = new
double[inputs];
if(bias)
bW = new double[units];
}
 
Search WWH ::




Custom Search