public BackPropagationTrainer(IFeedForwardNetRepository feedForwardNet, IBackPropagationConstants backPropagationConstants, ISquashFunction squashFunction, ITrainingSetRepository trainingSet, IHiddenLayerWeightChangeStrategy hiddenUnitWeightStrategy, IOutputLayerWeightChangeStrategy outputUnitWeightStrategy) { this.feedForwardNet = feedForwardNet; this.backPropagationConstants = backPropagationConstants; this.squashFunction = squashFunction; this.trainingSet = trainingSet; this.hiddenUnitWeightStrategy = hiddenUnitWeightStrategy; this.outputUnitWeightStrategy = outputUnitWeightStrategy; }
/*public void UpdateWeights(ref IFeedForwardNetLayerRepository currentLayer) * { * for (int toNo = 0; toNo < currentLayer.GetToUnitCount(); toNo++) * { * for (int fromNo = 0; fromNo < currentLayer.GetFromUnitCount(); fromNo++) * { * double weightChange = backPropagationConstants.LearningRate * currentLayer.GetToUnitDelta(toNo) + * currentLayer.GetLayerWeightChange(fromNo, toNo) * backPropagationConstants.Momentum; * currentLayer.SetLayerWeightChange(fromNo, toNo, weightChange); * currentLayer.AddLayerWeight(fromNo, toNo, weightChange); * } * double biasChange = backPropagationConstants.LearningRate * currentLayer.GetToUnitDelta(toNo) + currentLayer.GetLayerBiasChange(toNo) * backPropagationConstants.Momentum; * currentLayer.SetLayerBiasChange(toNo, biasChange); * currentLayer.AddLayerBias(toNo, biasChange); * } * }*/ public OutputUnitWeightChangeStrategyExp(IBackPropagationConstants backPropagationConstants) : base(backPropagationConstants) { // this.backPropagationConstants = backPropagationConstants; }
public UpdateWeightsAbs(IBackPropagationConstants backPropagationConstants) { this.backPropagationConstants = backPropagationConstants; }