コード例 #1
0
 public AveragePooling2D(object poolSize = null, object strides = null, string padding = "valid", string dataFormat = null, int[] inputShape = null)
 {
     _poolSize   = poolSize == null ? new int[] { 2, 2 } : KerasUtils.GetArray(poolSize, 2);
     _strides    = strides == null ? _poolSize : KerasUtils.GetArray(strides, 2);
     _padding    = padding;
     _dataFormat = dataFormat == null ? Globals.DataFormat : dataFormat;
     _inputShape = inputShape;
 }
コード例 #2
0
        public Conv2D(int filters, object kernelSize, object strides = null, object activation = null, bool useBias = true, int [] inputShape = null)
        {
            _inputShape = inputShape;
            _kernelSize = KerasUtils.GetArray(kernelSize, 2);
            if (_kernelSize == null)
            {
                throw new ArgumentException("The kernelSize parameter type is not supported.");
            }
            _filters    = filters;
            _activation = activation;
            _useBias    = useBias;
            if (strides == null)
            {
                _strides = new int[] { 1, 1 }
            }
            ;
            else
            {
                _strides = KerasUtils.GetArray(strides, 2);
            }

            _op = "Conv2D";
        }