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;
}
}
Aggregations