mirror of
https://github.com/esiur/esiur-dotnet.git
synced 2025-05-06 19:42:58 +00:00
22 lines
533 B
C#
22 lines
533 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Esiur.Analysis.Neural
|
|
{
|
|
internal class Neuron
|
|
{
|
|
public double Value { get; set; }
|
|
public NeuralLayer Layer { get; set; }
|
|
|
|
public List<Synapse> Synapses { get; set; } = new List<Synapse>();
|
|
|
|
public void Forward()
|
|
{
|
|
var sum = Synapses.Sum(x => x.Weight * x.Source.Value);
|
|
Value = Layer.Activation.Function(sum + Layer.PreviousLayer?.Bias ?? 0);
|
|
}
|
|
}
|
|
}
|