src/utils/procedure/ProcedureFactory.java
private void defineGradientPath(ProcedureData procedureData) {
        Stack<Node> resultNodes = new Stack<>();
        for (Node outputNode : procedureData.outputNodes.values()) resultNodes.push(outputNode);
        while (!resultNodes.empty()) {
            Expression expression = procedureData.reverseExpressionMap.get(resultNodes.pop());
            if (expression != null && !procedureData.gradients.contains(expression)) {
                procedureData.gradients.add(expression);
                Node argument1 = expression.getArgument1();
                if (argument1 != null) resultNodes.push(argument1);
                Node argument2 = expression.getArgument2();
                if (argument2 != null) resultNodes.push(argument2);
            }
        }
    }
/**
     * Defines backward gradient calculation path for expressions.<br>
     * Records gradient path to current procedure data.<br>
     *
     */
Defines backward gradient calculation path for expressions.
Records gradient path to current procedure data.
Defines backward gradient calculation path for expressions . Records gradient path to current procedure data .
private void defineGradientPath(ProcedureData procedureData) {
        Stack<Node> resultNodes = new Stack<>();
        for (Node outputNode : procedureData.outputNodes.values()) resultNodes.push(outputNode);
        while (!resultNodes.empty()) {
            Expression expression = procedureData.reverseExpressionMap.get(resultNodes.pop());
            if (expression != null && !procedureData.gradients.contains(expression)) {
                procedureData.gradients.add(expression);
                Node argument1 = expression.getArgument1();
                if (argument1 != null) resultNodes.push(argument1);
                Node argument2 = expression.getArgument2();
                if (argument2 != null) resultNodes.push(argument2);
            }
        }
    }
private void defineGradientPath ( ProcedureData procedureData ) { Stack < Node > resultNodes = new Stack < > ( ) ; for ( Node outputNode : procedureData . outputNodes . values ( ) ) resultNodes . push ( outputNode ) ; while ( ! resultNodes . empty ( ) ) { Expression expression = procedureData . reverseExpressionMap . get ( resultNodes . pop ( ) ) ; if ( expression != null && ! procedureData . gradients . contains ( expression ) ) { procedureData . gradients . add ( expression ) ; Node argument1 = expression . getArgument1 ( ) ; if ( argument1 != null ) resultNodes . push ( argument1 ) ; Node argument2 = expression . getArgument2 ( ) ; if ( argument2 != null ) resultNodes . push ( argument2 ) ; } } }
Defines backward gradient calculation path for expressions.<br>
 Records gradient path to current procedure data.<br>
Defines backward gradient calculation path for expressions . <br > Records gradient path to current procedure data . <br >