Exemplo n.º 1
0
 /// <summary>
 /// Constructor for creating new dense layer
 /// </summary>
 /// <param name="activationFunction">type of activation function</param>
 /// <param name="numNeurons">number of neurons which will be used</param>
 public LinearLayer(int numNeurons, AbstractBiasInitializer biasInitializer = null,
                    AbstractWeightInitializer weightInitializer             = null, AbstractRegularizer regularizer = null)
 {
     this.numNeurons  = numNeurons;
     this.regularizer = regularizer;
     layerName        = "Linear";
 }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor for initialization of convolution layer
        /// </summary>
        /// <param name="inputDimension">dimension of input data</param>
        /// <param name="filterSize">size of filters which will be used</param>
        /// <param name="filterCount">count of filters which will be used</param>
        /// <param name="stride">stride of filters during convolution</param>
        /// <param name="zeroPadding">if is true zero padding will be used</param>
        public Convolution1DLayer(Dimension inputDimension = null, int filterSize             = DEFAULT_FILTER_SIZE,
                                  int filterCount          = DEFAULT_FILTER_COUNT, int stride = DEFAULT_STRIDE,
                                  bool zeroPadding         = DEFAULT_ZERO_PADDING, AbstractBiasInitializer biasInitializer = null,
                                  AbstractWeightInitializer weightInitializer = null, AbstractRegularizer regularizer      = null)
        {
            // init vaiiables
            this.filterSize     = filterSize;
            this.filterCount    = filterCount;
            this.stride         = stride;
            this.zeroPadding    = zeroPadding;
            this.inputDimension = inputDimension;
            this.regularizer    = regularizer;
            layerName           = CONV_LAYER_NAME;
            outputSize          = 0;

            this.biasInitializer   = biasInitializer;
            this.weightInitializer = weightInitializer;
        }