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); }
public static EvaluatorLayer CreateFromLayer(NetworkLayer modelLayer, int multiLayer) { if (modelLayer.GetType() == typeof(InputLayer)) { return(new EvaluatorInputLayer(modelLayer, multiLayer)); } return(new EvaluatorLayer(modelLayer, multiLayer)); }
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); }
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]); } } }
//Only for derrived classes that do their own thing protected EvaluatorLayer(NetworkLayer modelLayer) { Size = modelLayer.Size; ModelLayer = modelLayer; }