public DenseLayer(int numNeurons, int numNeuronsNext, IActivationFunc activationFunc, IInitialization initialization) { weights = new Weights(numNeurons, numNeuronsNext, initialization); bias = new Bias(numNeuronsNext); gradWeights = new Weights(numNeurons, numNeuronsNext, initialization); gradBias = new Bias(numNeuronsNext); this.activationFunc = activationFunc; }
public Bias(Bias bias) { this.vals = DenseMatrix.Create(bias.vals.RowCount, bias.vals.ColumnCount, new Func <int, int, float>((r, c) => bias.vals[r, c])); }