Exemple #1
0
        public static LeakyReluLayer<T> LeakyRelu<T>(this LayerBase<T> layer, T alpha) where T : struct, IEquatable<T>, IFormattable
        {
            var relu = new LeakyReluLayer<T>(alpha);
            relu.AcceptParent(layer);

            return relu;
        }
Exemple #2
0
        public static LeakyReluLayer<T> LeakyRelu<T>(this ConvLayer<T> layer, T alpha) where T : struct, IEquatable<T>, IFormattable
        {
            var relu = new LeakyReluLayer<T>(alpha);
            relu.AcceptParent(layer);

            layer.BiasPref = (T)Convert.ChangeType(0.1, typeof(T)); // can we do better?

            return relu;
        }