internal override Shape GetNoiseShape(KerasSymbol inputs)
        {
            var input_shape = K.Shape(inputs);
            var noise_shape = (input_shape[0], 1, input_shape[2]);

            return(noise_shape);
        }
        internal override Shape GetNoiseShape(KerasSymbol inputs)
        {
            Shape noise_shape = null;
            var   input_shape = K.Shape(inputs);

            if (this.data_format == "channels_first")
            {
                noise_shape = new Shape(input_shape[0], input_shape[1], 1, 1);
            }
            else
            {
                noise_shape = new Shape(input_shape[0], 1, 1, input_shape[3]);
            }

            return(noise_shape);
        }
Beispiel #3
0
        internal virtual Shape GetNoiseShape(KerasSymbol inputs)
        {
            if (this.noise_shape == null)
            {
                return(this.noise_shape);
            }

            var symbolic_shape = K.Shape(inputs);

            for (int axis = 0; axis < noise_shape.Dimension; axis++)
            {
                var shape = noise_shape[axis];
                if (shape <= 0)
                {
                    noise_shape[axis] = symbolic_shape[axis];
                }
            }

            return(noise_shape);
        }