jeffheaton / encog-java-core

http://www.heatonresearch.com/encog
Other
742 stars 268 forks source link

Activation function from a wrong layer #243

Closed ahsimb closed 7 years ago

ahsimb commented 7 years ago

package org.encog.neural.networks.training.propagation;

public class GradientWorker implements EngineTask { ... private void processLevel(final int currentLevel) { final int fromLayerIndex = this.layerIndex[currentLevel + 1]; final int toLayerIndex = this.layerIndex[currentLevel]; final int fromLayerSize = this.layerCounts[currentLevel + 1]; final int toLayerSize = this.layerFeedCounts[currentLevel];

    final int index = this.weightIndex[currentLevel];
    final ActivationFunction activation = this.network
            .getActivationFunctions()[currentLevel]; // SHOULD BE currentLevel + 1 SHOULDN'T IT?
    final double currentFlatSpot = this.flatSpot[currentLevel + 1];

... } ... }

jeffheaton commented 7 years ago

Thanks, very good catch!