Ejemplo n.º 1
0
        private static Symbol MeanAbsoluteLogError(Symbol preds, Symbol labels)
        {
            Symbol first_log  = OperatorSupply.Log(OperatorSupply.Clip(preds, float.Epsilon, 0) + 1);
            Symbol second_log = OperatorSupply.Log(OperatorSupply.Clip(labels, float.Epsilon, 0) + 1);
            Symbol loss       = OperatorSupply.Mean(OperatorSupply.Square(first_log - second_log));

            return(new Operator("MakeLoss").SetInput("data", loss).CreateSymbol("MeanAbsoluteLogError"));
        }
Ejemplo n.º 2
0
        private static Symbol Hinge(Symbol preds, Symbol labels)
        {
            Symbol loss = OperatorSupply.Mean(OperatorSupply.MaximumScalar(1 - (labels * preds), 0));

            return(new Operator("MakeLoss").SetInput("data", loss).CreateSymbol("Hinge"));
        }
Ejemplo n.º 3
0
        private static Symbol MeanAbsolutePercentageError(Symbol preds, Symbol labels)
        {
            Symbol loss = OperatorSupply.Mean(OperatorSupply.Abs(labels - preds) / OperatorSupply.Clip(OperatorSupply.Abs(labels), float.Epsilon, 0));

            return(new Operator("MakeLoss").SetInput("data", loss).CreateSymbol("MeanAbsolutePercentageError"));
        }
Ejemplo n.º 4
0
        private static Symbol Poisson(Symbol preds, Symbol labels)
        {
            Symbol loss = OperatorSupply.Mean(preds - labels * OperatorSupply.Log(preds + float.Epsilon));

            return(new Operator("MakeLoss").SetInput("data", loss).CreateSymbol("Poisson"));
        }