public NetworkBuilder(IDiagram diagram, INeuronFactory factory,
                       ISettingsProvider settings, ILogAggregator logAggregator)
 {
     _diagram       = diagram;
     _factory       = factory;
     _settings      = settings;
     _logAggregator = logAggregator;
 }
Exemple #2
0
 private NeuralNetworkFactory(ISomaFactory somaFactory, IAxonFactory axonFactory, ISynapseFactory hiddenSynapseFactory, ISynapseFactory inputOutputSynapseFactory, IWeightInitializer biasInitializer, INeuronFactory neuronFactory)
 {
     _somaFactory               = somaFactory;
     _axonFactory               = axonFactory;
     _hiddenSynapseFactory      = hiddenSynapseFactory;
     _inputOutputSynapseFactory = inputOutputSynapseFactory;
     _biasInitiliazer           = biasInitializer;
     _neuronFactory             = neuronFactory;
 }
        public FTPerceptron(INeuronFactory neuronFactory) : base(neuronFactory)
        {
            // this is the unit input which will handle any bias
            var simpleInput = new Input(1.0);

            // dendrite has weight
            var dendrite = new Dendrite();

            // connect to the input
            dendrite.SetConnection(simpleInput);

            // connect to the neuron
            _neuron.Connect(dendrite);
        }
        public FTPerceptron(INeuronFactory neuronFactory) : base(neuronFactory)
        {
            // this is the unit input which will handle any bias
            var simpleInput = new Input(1.0);

            // dendrite has weight
            var dendrite = new Dendrite();

            // connect to the input
            dendrite.SetConnection(simpleInput);

            // connect to the neuron
            _neuron.Connect(dendrite);
        }
        public Layer(INeuronFactory factory) : base(typeof(NeuronBase))
        {
            _neuronFactory      = factory;
            _compactInputsView  = true;
            _compactOutputsView = true;
            _neuronsCount       = 1; // each layer has one neuron by defeault

            if (_neuronFactory.PropertyProviders.TryGetValue(this.GetType(), out IPropertiesProvider provider) &&
                provider is LayerProperties layerProperties)
            {
                _propertiesProvider = layerProperties;
            }

            this.Properties = this;
        }
        public INeuralNetworkFactory BuildBackpropagationNetworkFactory(IWeightInitializer weightInitializer,
                                                                        ISomaFactory somaFactory,
                                                                        IActivationFunctionDerivative activationFunctionDerivative,
                                                                        IActivationFunction inputActivationFunction,
                                                                        INeuronFactory neuronFactory)
        {
            var axonFactory          = BackpropagationAxonFactory.GetInstance(activationFunctionDerivative);
            var hiddenSynapseFactory = DecoratedSynapseFactory.GetInstance(weightInitializer,
                                                                           AxonFactory.GetInstance(activationFunctionDerivative));
            var inputSynapseFactory = DecoratedSynapseFactory.GetInstance(new ConstantWeightInitializer(1.0),
                                                                          AxonFactory.GetInstance(inputActivationFunction));
            var decoratedNeuronFactory    = BackpropagationNeuronFactory.GetInstance(neuronFactory);
            INeuralNetworkFactory factory = NeuralNetworkFactory.GetInstance(somaFactory, axonFactory,
                                                                             hiddenSynapseFactory, inputSynapseFactory, weightInitializer, decoratedNeuronFactory);

            var backPropNetworkFactory = new BackpropagationNetworkFactoryDecorator(factory);

            return(backPropNetworkFactory);
        }
Exemple #7
0
 public static NeuralNetworkFactory GetInstance(ISomaFactory somaFactory, IAxonFactory axonFactory, ISynapseFactory hiddenSynapseFactory, ISynapseFactory inputOutputSynapseFactory, IWeightInitializer biasInitializer, INeuronFactory neuronFactory)
 {
     return(new NeuralNetworkFactory(somaFactory, axonFactory, hiddenSynapseFactory, inputOutputSynapseFactory, biasInitializer, neuronFactory));
 }
 public static INeuronFactory GetInstance(INeuronFactory neuronFactory)
 {
     return(new BackpropagationNeuronFactory(neuronFactory));
 }
 private BackpropagationNeuronFactory(INeuronFactory neuronFactory)
 {
     _neuronFactory = neuronFactory;
 }
Exemple #10
0
 public Layer(double layerBias, int previousLayerOutputCount, int neuronNumber, INeuronFactory factory, string name = "")
 {
     Bias = layerBias;
     Name = name;
     for (int neuronIndex = 0; neuronIndex < neuronNumber; ++neuronIndex)
     {
         _neurons.Add(factory.ConstructNeuron(previousLayerOutputCount));
     }
 }
Exemple #11
0
 public CsvSensorLayer(INeuronFactory factory) : base(factory)
 {
     this.NeuronType = typeof(Sensor);
     this.Role       = LayerRole.Input;
     _delimiter      = ',';
 }
 public CsvSensorLayerProperties(INeuronFactory factory) : base(factory)
 {
 }
 public Perceptron(INeuronFactory neuronFactory)
 {
     _neuron = neuronFactory.Create();
 }
Exemple #14
0
 public void Setup()
 {
     _factory = MockRepository.GenerateMock <INeuronFactory>();
 }
Exemple #15
0
 public NeuronService(string weightsDirectory, INeuronFactory factory)
 {
     _weightsDirectory = weightsDirectory ?? throw new ArgumentNullException(nameof(weightsDirectory));
     _factory          = factory ?? throw new ArgumentNullException(nameof(factory));
 }
 public LayerProperties(INeuronFactory factory)
 {
     _neuronFactory = factory;
 }
 public Perceptron(INeuronFactory neuronFactory)
 {
     _neuron = neuronFactory.Create();
 }