예제 #1
0
 public DenseLayerVisualizer(SpatialLayer spatialLayer, TreeLayer combinationLayer, DenseLayer denseLayer, string[] actionIndex)
 {
     _actionIndex      = actionIndex;
     _spatialLayer     = spatialLayer;
     _combinationLayer = combinationLayer;
     _denseLayer       = denseLayer;
     _spatialVisuals   = GameObject.Instantiate(Resources.Load <GameObject>("DenseLayerVisualizer"));
     _outputVisuals    = GameObject.Instantiate(Resources.Load <GameObject>("OutputLayerVisualizer"));
 }
예제 #2
0
 public ConvolutionalNetwork(int matsize, int vecsize, int depth, int labels, params CNNArgs[] args)
 {
     _matsize               = matsize;
     _vecsize               = vecsize;
     _depth                 = depth;
     _labels                = labels;
     _args                  = args;
     InputLayer             = new SpatialLayer(matsize, depth);
     ConvolutionalLayers    = new ConvolutionalLayer[args.Length];
     SubSampleLayers        = new MeanPoolLayer[args.Length];
     ConvolutionalLayers[0] = new ConvolutionalLayer(args[0].FilterSize, args[0].FilterCount, args[0].Stride, InputLayer, Functions.Rectifier2D);
     SubSampleLayers[0]     = new MeanPoolLayer(args[0].PoolLayerSize, ConvolutionalLayers[0]);
     for (int i = 1; i < args.Length; i++)
     {
         ConvolutionalLayers[i] = new ConvolutionalLayer(args[i].FilterSize, args[i].FilterCount, args[i].Stride, SubSampleLayers[i - 1], Functions.Rectifier2D);
         SubSampleLayers[i]     = new MeanPoolLayer(args[i].PoolLayerSize, ConvolutionalLayers[i]);
     }
     FlattenLayer      = new FlattenLayer(SubSampleLayers[SubSampleLayers.Length - 1]);
     VectorInput       = new InputLayer(vecsize);
     LinearHiddenLayer = new DenseLayer(vecsize, VectorInput, Functions.Sigmoid);
     CombinationLayer  = new TreeLayer(FlattenLayer.Size(), vecsize);
     OutputLayer       = new DenseLayer(labels, CombinationLayer, Functions.Identity);
 }
예제 #3
0
 // Use this for initialization
 void Start()
 {
     current = this;
 }