Exemplo n.º 1
0
        public void ExpGradientCheck()
        {
            var cns = new ConvNetSharp <T>();
            var x   = cns.PlaceHolder("x");
            var fun = cns.Exp(x);

            var shape    = new Shape(2, 2, 3, 4);
            var location = NewVolume(RandomUtilities.RandomDoubleArray(shape.TotalLength), shape);

            GradientCheck(cns, fun, location);
        }
        public void Exp()
        {
            var cns = new ConvNetSharp <double>();
            var a   = cns.Const(1.0, "one");
            var op  = cns.Exp(a);

            var xml          = op.ToXml();
            var deserialized = SerializationExtensions.FromXml <double>(xml) as Exp <double>;

            Assert.IsNotNull(deserialized);
            Assert.AreEqual(1, deserialized.Parents.Count);
            Assert.AreEqual("one", (deserialized.Parents[0] as Const <double>).Name);
        }