src/core/reinforcement/value/SoftQValueFunctionEstimator.java
public void updateFunctionEstimator() throws NeuralNetworkException, MatrixException, DynamicParamException, AgentException {
        TreeSet<StateTransition> sampledStateTransitions = getSampledStateTransitions();
        if (sampledStateTransitions == null || sampledStateTransitions.isEmpty()) return;

        updateFunctionEstimatorMemory(sampledStateTransitions);

        if (!isStateActionValueFunction()) {
            for (StateTransition stateTransition : sampledStateTransitions) {
                Matrix targetValues1 = functionEstimator.predict(stateTransition.environmentState.state()).copy();
                targetValues1.setValue(getFunctionIndex(stateTransition), 0, stateTransition.tdTarget);
                functionEstimator.store(stateTransition, targetValues1);

                Matrix targetValues2 = functionEstimator2.predict(stateTransition.environmentState.state()).copy();
                targetValues2.setValue(getFunctionIndex(stateTransition), 0, stateTransition.tdTarget);
                functionEstimator2.store(stateTransition, targetValues2);
            }
            functionEstimator.update();
            functionEstimator2.update();
        }

    }
/**
     * Updates FunctionEstimator.
     *
     * @throws NeuralNetworkException throws exception if neural network operation fails.
     * @throws MatrixException throws exception if matrix operation fails.
     * @throws DynamicParamException throws exception if parameter (params) setting fails.
     * @throws AgentException throws exception if function estimator update fails.
     */


@throws NeuralNetworkException throws exception if neural network operation fails.
@throws MatrixException throws exception if matrix operation fails.
@throws DynamicParamException throws exception if parameter (params) setting fails.
@throws AgentException throws exception if function estimator update fails.
@throws NeuralNetworkException throws exception if neural network operation fails . @throws MatrixException throws exception if matrix operation fails . @throws DynamicParamException throws exception if parameter ( params ) setting fails . @throws AgentException throws exception if function estimator update fails .
public void updateFunctionEstimator() throws NeuralNetworkException, MatrixException, DynamicParamException, AgentException {
        TreeSet<StateTransition> sampledStateTransitions = getSampledStateTransitions();
        if (sampledStateTransitions == null || sampledStateTransitions.isEmpty()) return;
        updateFunctionEstimatorMemory(sampledStateTransitions);
        if (!isStateActionValueFunction()) {
            for (StateTransition stateTransition : sampledStateTransitions) {
                Matrix targetValues1 = functionEstimator.predict(stateTransition.environmentState.state()).copy();
                targetValues1.setValue(getFunctionIndex(stateTransition), 0, stateTransition.tdTarget);
                functionEstimator.store(stateTransition, targetValues1);
                Matrix targetValues2 = functionEstimator2.predict(stateTransition.environmentState.state()).copy();
                targetValues2.setValue(getFunctionIndex(stateTransition), 0, stateTransition.tdTarget);
                functionEstimator2.store(stateTransition, targetValues2);
            }
            functionEstimator.update();
            functionEstimator2.update();
        }
    }
public void updateFunctionEstimator ( ) throws NeuralNetworkException , MatrixException , DynamicParamException , AgentException { TreeSet < StateTransition > sampledStateTransitions = getSampledStateTransitions ( ) ; if ( sampledStateTransitions == null || sampledStateTransitions . isEmpty ( ) ) return ; updateFunctionEstimatorMemory ( sampledStateTransitions ) ; if ( ! isStateActionValueFunction ( ) ) { for ( StateTransition stateTransition : sampledStateTransitions ) { Matrix targetValues1 = functionEstimator . predict ( stateTransition . environmentState . state ( ) ) . copy ( ) ; targetValues1 . setValue ( getFunctionIndex ( stateTransition ) , 0 , stateTransition . tdTarget ) ; functionEstimator . store ( stateTransition , targetValues1 ) ; Matrix targetValues2 = functionEstimator2 . predict ( stateTransition . environmentState . state ( ) ) . copy ( ) ; targetValues2 . setValue ( getFunctionIndex ( stateTransition ) , 0 , stateTransition . tdTarget ) ; functionEstimator2 . store ( stateTransition , targetValues2 ) ; } functionEstimator . update ( ) ; functionEstimator2 . update ( ) ; } }
Updates FunctionEstimator.
Updates FunctionEstimator .