@@ -0,0 +1,2411 @@
+/*%0D%0A * Encog(tm) Core v3.2 - Java Version%0D%0A * http://www.heatonresearch.com/encog/%0D%0A * https://github.com/encog/encog-java-core%0D%0A %0D%0A * Copyright 2008-2013 Heaton Research, Inc.%0D%0A *%0D%0A * Licensed under the Apache License, Version 2.0 (the %22License%22);%0D%0A * you may not use this file except in compliance with the License.%0D%0A * You may obtain a copy of the License at%0D%0A *%0D%0A *     http://www.apache.org/licenses/LICENSE-2.0%0D%0A *%0D%0A * Unless required by applicable law or agreed to in writing, software%0D%0A * distributed under the License is distributed on an %22AS IS%22 BASIS,%0D%0A * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.%0D%0A * See the License for the specific language governing permissions and%0D%0A * limitations under the License.%0D%0A *   %0D%0A * For more information on Heaton Research copyrights, licenses %0D%0A * and trademarks visit:%0D%0A * http://www.heatonresearch.com/copyright%0D%0A */%0D%0Apackage org.encog.ensemble.dropout;%0D%0A%0D%0Aimport java.util.ArrayList;%0D%0A%0D%0Aimport org.encog.ensemble.Ensemble;%0D%0Aimport org.encog.ensemble.EnsembleAggregator;%0D%0Aimport org.encog.ensemble.EnsembleML;%0D%0Aimport org.encog.ensemble.EnsembleMLMethodFactory;%0D%0Aimport org.encog.ensemble.EnsembleTrainFactory;%0D%0Aimport org.encog.ensemble.EnsembleTypes;%0D%0Aimport org.encog.ensemble.EnsembleTypes.ProblemType;%0D%0Aimport org.encog.ensemble.data.factories.NonResamplingDataSetFactory;%0D%0Aimport org.encog.ensemble.data.factories.WrappingNonResamplingDataSetFactory;%0D%0A%0D%0Apublic class Dropout extends Ensemble %7B%0D%0A%0D%0A%09private int splits;%0D%0A%0D%0A%09public Dropout(int splits, int dataSetSize, EnsembleMLMethodFactory mlFactory, EnsembleTrainFactory trainFactory, EnsembleAggregator aggregator)%0D%0A%09%7B%0D%0A%09%09int dataSplits = aggregator.needsTraining() ? splits + 1 : splits;%0D%0A%09%09this.dataSetFactory = new NonResamplingDataSetFactory(dataSplits);%0D%0A%09%09this.splits = splits;%0D%0A%09%09this.mlFactory = mlFactory;%0D%0A%09%09this.trainFactory = trainFactory;%0D%0A%09%09this.members = new ArrayList%3CEnsembleML%3E();%0D%0A%09%09this.aggregator = aggregator;%0D%0A%09%09initMembers();%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public void initMembers()%0D%0A%09%7B%0D%0A%09%09this.initMembersBySplits(this.splits);%0D%0A%09%7D%0D%0A%0D%0A%09@Override%0D%0A%09public ProblemType getProblemType() %7B%0D%0A%09%09return EnsembleTypes.ProblemType.CLASSIFICATION;%0D%0A%09%7D%0D%0A%09%0D%0A%09@Override%0D%0A%09public EnsembleML getMember(int memberNumber) %7B%0D%0A%09%09return members.get(memberNumber);%0D%0A%09%7D%0D%0A%0D%0A%09public void trainStep() %7B%0D%0A%09%09for (EnsembleML current : members)%0D%0A%09%09%7B%0D%0A%09%09%09current.trainStep();%0D%0A%09%09%7D%0D%0A%09%7D%0D%0A%0D%0A%7D%0D%0A

add Dropout