Exemplo n.º 1
0
        public override KerasSymbol[] Invoke(KerasSymbol[] inputs, FuncArgs kwargs = null)
        {
            List <KerasSymbol> result = new List <KerasSymbol>();

            foreach (var input in inputs)
            {
                result.Add(K.Relu(input, alpha));
            }

            return(result.ToArray());
        }
Exemplo n.º 2
0
        public override KerasSymbol[] Invoke(KerasSymbol[] inputs, FuncArgs kwargs = null)
        {
            List <KerasSymbol> result = new List <KerasSymbol>();

            foreach (var input in inputs)
            {
                result.Add(
                    K.Relu(input, alpha: this.negative_slope, max_value: this.max_value, threshold: this.threshold)
                    );
            }

            return(result.ToArray());
        }
Exemplo n.º 3
0
        public override KerasSymbol[] Invoke(KerasSymbol[] inputs, FuncArgs kwargs = null)
        {
            List <KerasSymbol> result = new List <KerasSymbol>();

            foreach (var input in inputs)
            {
                KerasSymbol neg;
                var         pos = K.Relu(input);
                neg = -this.alpha * K.Relu(-input);

                result.Add(pos + neg);
            }

            return(result.ToArray());
        }
Exemplo n.º 4
0
 public static KerasSymbol Relu(KerasSymbol x, float alpha = 0, float?max_value = null, float threshold = 0)
 {
     return(K.Relu(x, alpha: alpha, max_value: max_value, threshold: threshold));
 }