示例#1
0
        /// <summary>
        /// Saves the neural network as a .ann file.
        /// </summary>
        /// <param name="name">The .ann file name.</param>
        /// <returns>The .ann file.</returns>
        public AnnFile Save(string name)
        {
            var map = ComputeNodeIdMap();

            return(new AnnFile
            {
                Name = name,
                Activation = Activation,
                InputNeurons = InputNeurons.Select(neuron => (uint)map[neuron.ID]).ToList(),
                OutputNeurons = OutputNeurons.Select(neuron => (uint)map[neuron.ID]).ToList(),
                AdjacencyMatrix = AdjacencyMatrix
            });
        }
示例#2
0
 public double[] GetInputValues(int cycle)
 {
     return(InputNeurons.Select(x => x.Values[cycle] / Divisor).ToArray());
 }