Ejemplo n.º 1
0
	public Layer(Matrix weightMatrix, Vector biasVector, ActivationFunction af) {

		activationFunction = af;
		this.weightMatrix = weightMatrix;
		lastWeightUpdateMatrix = new Matrix(weightMatrix.getRowDimension(),
				weightMatrix.getColumnDimension());
		penultimateWeightUpdateMatrix = new Matrix(weightMatrix
				.getRowDimension(), weightMatrix.getColumnDimension());

		this.biasVector = biasVector;
		lastBiasUpdateVector = new Vector(biasVector.getRowDimension());
		penultimateBiasUpdateVector = new Vector(biasVector.getRowDimension());
	}
Ejemplo n.º 2
0
	public Layer(int numberOfNeurons, int numberOfInputs,
			double lowerLimitForWeights, double upperLimitForWeights,
			ActivationFunction af) {

		activationFunction = af;
		this.weightMatrix = new Matrix(numberOfNeurons, numberOfInputs);
		lastWeightUpdateMatrix = new Matrix(weightMatrix.getRowDimension(),
				weightMatrix.getColumnDimension());
		penultimateWeightUpdateMatrix = new Matrix(weightMatrix
				.getRowDimension(), weightMatrix.getColumnDimension());

		this.biasVector = new Vector(numberOfNeurons);
		lastBiasUpdateVector = new Vector(biasVector.getRowDimension());
		penultimateBiasUpdateVector = new Vector(biasVector.getRowDimension());

		initializeMatrix(weightMatrix, lowerLimitForWeights,
				upperLimitForWeights);
		initializeVector(biasVector, lowerLimitForWeights, upperLimitForWeights);
	}