Search in sources :

Example 1 with BasicDropoutLayer

use of ml.shifu.shifu.core.dtrain.nn.BasicDropoutLayer in project shifu by ShifuML.

the class FloatFlatNetwork method init.

private void init(FlatLayer[] layers, boolean dropout) {
    super.init(layers);
    final int layerCount = layers.length;
    if (dropout) {
        this.setLayerDropoutRates(new double[layerCount]);
    } else {
        this.setLayerDropoutRates(new double[0]);
    }
    int index = 0;
    for (int i = layers.length - 1; i >= 0; i--) {
        final FlatLayer layer = layers[i];
        if (dropout && layer instanceof BasicDropoutLayer) {
            this.getLayerDropoutRates()[index] = ((BasicDropoutLayer) layer).getDropout();
        }
        index += 1;
    }
}
Also used : FlatLayer(org.encog.neural.flat.FlatLayer) BasicDropoutLayer(ml.shifu.shifu.core.dtrain.nn.BasicDropoutLayer)

Aggregations

BasicDropoutLayer (ml.shifu.shifu.core.dtrain.nn.BasicDropoutLayer)1 FlatLayer (org.encog.neural.flat.FlatLayer)1