@Test
public void testForward() {

    
    RandomGenerator.getDefault().initSeed(123);         // initialize weights using specified random seed
    Tensor input = new Tensor(0.1f, 0.2f, 0.3f, 0.4f, 0.5f); // input vector for this layer (output for previous layer)
    Tensor weights = new Tensor(5, 10); 
    WeightsInit.uniform(weights.getValues(), 5); // "[0.19961303, -0.23501621, 0.43907326, -0.17747784, -0.22066136, 0.06630343, 0.097314, -0.21566293, 0.273578, 0.10945064, 0.33577937, 0.044093937, 0.19323963, -0.3021235, -0.38288906, 0.16261822, 0.26498383, -0.207817, 0.070406556, -0.23022851, 0.36503863, 0.091478825, -0.31402034, -0.25345784, 0.42504954, -0.037393004, -0.38854277, -0.36758634, -0.38503492, -0.33786723, -0.36604232, -0.14479709, -0.06755906, 0.38639867, 0.3348655, 0.15910655, 0.06717491, -0.4455302, -0.09257606, -1.219213E-4, -0.21616945, 0.43006968, -0.31055218, 0.2699433, -0.214278, 0.25471163, -0.03427276, -0.43431506, -0.054469943, -0.23747501]" 
   Tensor expectedOutputs = new Tensor( 0.51053022f, 0.59142921f, 0.52648754f, 0.56102458f, 0.54380692f, 0.58635918f, 0.54137987f, 0.41367945f, 0.52289978f, 0.4961883f );
     
    // create prev fc layer with 5 outputs
    FullyConnectedLayer prevLayer = new FullyConnectedLayer(5);        
    prevLayer.setOutputs(input); // and set its ouput that will be used as input for next layer
            
    // create instance of layer to test
    OutputLayer instance = new OutputLayer(10);
    instance.setPrevLayer(prevLayer);        
    instance.init(); // init weights structures
    instance.setWeights(weights); // set weights values
    instance.setBiases(new float[] {0.1f, 0.2f, 0.3f, 0.11f, 0.12f, 0.13f, 0.21f, 0.22f, 0.23f, 0.24f}); // set bias values
    
    // run forward pass
    instance.forward();
    
    // get layer outpputs
    Tensor actualOutputs = instance.getOutputs();
    
    assertArrayEquals(actualOutputs.getValues(), expectedOutputs.getValues(), 1e-7f);
}