コード例 #1
0
 public EvaluatorOutputLayer(NetworkLayer modelLayer, int multiLayers) : base(modelLayer)
 {
     //OutputActivation = new NativeArray2D<float>(modelLayer.Size, EVALUATOR_BUCKET_SLICE_SIZE);
     WeightedInput   = new NativeArray2D <float>(modelLayer.Size, EVALUATOR_BUCKET_SLICE_SIZE);
     Error           = new NativeArray2D <float>(Size, EVALUATOR_BUCKET_SLICE_SIZE);
     WeightGradients = new NativeArray <float>(ModelLayer.Weights.Length, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);
 }
コード例 #2
0
        public static EvaluatorLayer CreateFromLayer(NetworkLayer modelLayer, int multiLayer)
        {
            if (modelLayer.GetType() == typeof(InputLayer))
            {
                return(new EvaluatorInputLayer(modelLayer, multiLayer));
            }

            return(new EvaluatorLayer(modelLayer, multiLayer));
        }
コード例 #3
0
 protected EvaluatorLayer(NetworkLayer modelLayer, int multiLayers)
 {
     Size             = modelLayer.Size;
     ModelLayer       = modelLayer;
     OutputActivation = new NativeArray2D <float>(EVALUATOR_BUCKET_SLICE_SIZE, modelLayer.Size);
     WeightedInput    = new NativeArray2D <float>(EVALUATOR_BUCKET_SLICE_SIZE, modelLayer.Size);
     Error            = new NativeArray2D <float>(EVALUATOR_BUCKET_SLICE_SIZE, Size);
     WeightGradients  = new NativeArray <float>(ModelLayer.Weights.Length, Allocator.Persistent, NativeArrayOptions.UninitializedMemory);
 }
コード例 #4
0
ファイル: NeuralNetwork.cs プロジェクト: 64-bit/NeuralBurst
 private void ConstructLayers(NetworkDescription description)
 {
     _layers = new NetworkLayer[description.Layers.Count];
     for (int i = 0; i < description.Layers.Count; i++)
     {
         if (i == 0)
         {
             _layers[i] = NetworkLayer.ConstructLayer(description.Layers[i]);
         }
         else
         {
             _layers[i] = NetworkLayer.ConstructLayer(description.Layers[i], description.Layers[i - 1]);
         }
     }
 }
コード例 #5
0
 //Only for derrived classes that do their own thing
 protected EvaluatorLayer(NetworkLayer modelLayer)
 {
     Size       = modelLayer.Size;
     ModelLayer = modelLayer;
 }