/// <summary> /// Create a new Function instance which just combines the outputs of the specified list of 'operands' Functions such that the 'Outputs' of the /// new 'Function' are union of the 'Outputs' of each of the specified 'operands' Functions. /// E.g. When creating a classification model, typically the CrossEntropy loss Function and the ClassificationError Function comprise the two roots /// of the computation graph which can be "Combine"d to create a single Function with 2 outputs; viz. CrossEntropy loss and ClassificationError output. /// </summary> /// <param name="operands">variables whose function are to be combined</param> /// <param name="name"></param> /// <returns></returns> public static Function Combine(IList <Variable> operands, string name = "") { VariableVector operandVector = Helper.AsVariableVector(operands); return(CNTKLib.Combine(operandVector, name)); }
/// <summary> /// Create a new Function which is the alias of operand. /// </summary> /// <param name="operand"></param> /// <param name="name"></param> /// <returns></returns> public static Function Alias(Variable operand, string name = "") { return(CNTKLib.Alias(operand, name)); }
/// <summary> /// Creates a composite function from the rootFunction. /// </summary> /// <param name="rootFunction"></param> /// <param name="name"></param> /// <returns></returns> public static Function AsComposite(Function rootFunction, string name = "") { return(CNTKLib.AsComposite(rootFunction, name)); }
/// <summary> /// Create a Placeholder variable to be used as a temporary/placeholder input to a Function. /// All placeholder inputs of a Function must be replaced with non-placeholder Variables before Forward evaluation of the Function. /// </summary> /// <param name="shape"></param> /// <param name="dynamicAxes"></param> /// <returns></returns> public static Variable PlaceholderVariable(NDShape shape, IList <Axis> dynamicAxes) { AxisVector dynamicAxesVector = Helper.AsAxisVector(dynamicAxes); return(CNTKLib.PlaceholderVariable(shape, dynamicAxesVector)); }
/// <summary> /// times operator of 2 Variables /// </summary> /// <param name="v1"></param> /// <param name="v2"></param> /// <returns></returns> public static Function operator *(Variable v1, Variable v2) { return(CNTKLib.Times(v1, v2)); }
/// <summary> /// plus operator of 2 Variables /// </summary> /// <param name="v1"></param> /// <param name="v2"></param> /// <returns></returns> public static Function operator +(Variable v1, Variable v2) { return(CNTKLib.Plus(v1, v2)); }