public void CalculateOutput() { foreach (var inputNeuron in InputLayer.Neurons) { inputNeuron.Input = Activation.Sigmoid(inputNeuron.Input); inputNeuron.Activate(); } for (var i = 0; i < HiddenLayers.Count; i++) { foreach (var currentLayerNeuron in HiddenLayers[i].Neurons) { if (i == 0) { //Cross point between first hidden layer and input layer foreach (var inputNeuron in InputLayer.Neurons) { currentLayerNeuron.Input += inputNeuron.Output; } } else { foreach (var hiddenLayerNeuron in HiddenLayers[i - 1].Neurons) { currentLayerNeuron.Input += hiddenLayerNeuron.Output; } } currentLayerNeuron.Activate(); } } foreach (var outputNeuron in OutputLayer.Neurons) { foreach (var hiddenLayerNeuron in HiddenLayers[HiddenLayers.Count - 1].Neurons) { outputNeuron.Input += hiddenLayerNeuron.Output; } outputNeuron.Activate(); } }
public Dropout(Activation activation, double width = 0.25f) : base(activation) { this.width = width; }
public Layer(int dimIn, int dimOut, Activation activation = null) { _W = new double[dimIn, dimOut]; _b = new double[dimOut]; _activation = activation; }
public Layer(Activation activation) { func = activation; }
public MaxPool2D(Activation activation, int width, int height) : base(activation) { this.width = width; this.height = height; }
public FullyConnLayar(Activation activation, Size output) : base(activation) { this.output_size = output; }
public Conv2D(Activation activation, int width, int height, int count = 1) : base(activation) { this.width = width; this.height = height; this.count = count; }
protected double GetChunkOfDeltaH(double weightSynapse, double neuronInBeginSynapse, double deltaInEndSynapse) => weightSynapse *deltaInEndSynapse *Activation.DeriveFunc(neuronInBeginSynapse);
protected Vector GetDelta0(Vector actual, Vector ideal) => Vector.Combine(actual, ideal, (actualItem, idealItem) => (idealItem - actualItem) * Activation.DeriveFunc(actualItem));