public Vec feedfoward ( Vec x ) { Vec a_lprev = x ; for ( int l = 0 ; l < layersActivation . size ( ) ; l ++ ) { Vec z_l = new DenseVector ( layerSizes [ l + 1 ] ) ; z_l . zeroOut ( ) ; W . get ( l ) . multiply ( a_lprev , 1.0 , z_l ) ; //add the bias term back in final Vec B_l = B . get ( l ) ; z_l . mutableAdd ( B_l ) ; layersActivation . get ( l ) . activate ( z_l , z_l ) ; a_lprev = z_l ; } return a_lprev ; }
Feeds the given singular pattern through the network and computes its activations