public int layerSize(int layer) {
        if (layer < 0 || layer > layers.length) {
            throw new IllegalArgumentException("Invalid layer index: " + layer + ". Layer index must be between 0 and "
                    + (layers.length - 1) + " inclusive");
        }
        return layerSize(layers[layer].conf().getLayer().getLayerName());
    }
public int layerSize ( int layer ) { if ( layer < 0 || layer > layers . length ) { throw new IllegalArgumentException ( "Invalid layer index: " + layer + ". Layer index must be between 0 and " + ( layers . length - 1 ) + " inclusive" ) ; } return layerSize ( layers [ layer ] . conf ( ) . getLayer ( ) . getLayerName ( ) ) ; }
Return the layer size (number of units) for the specified layer.
Note that the meaning of the "layer size" can depend on the type of layer. For example:<br>
- DenseLayer, OutputLayer, recurrent layers: number of units (nOut configuration option)<br>
- ConvolutionLayer: the channels (number of channels)<br>
- Subsampling layers, global pooling layers, etc: size of 0 is always returned<br>

@param layer Index of the layer to get the size of. Must be in range 0 to nLayers-1 inclusive
@return Size of the layer