src/core/reinforcement/function/NNFunctionEstimator.java
public void update() throws NeuralNetworkException, DynamicParamException, AgentException, MatrixException {
        HashMap<Integer, MMatrix> states = new HashMap<>();
        HashMap<Integer, MMatrix> stateValues = new HashMap<>();
        HashMap<Integer, Double> importanceSamplingWeights = new HashMap<>();
        int index = 0;
        for (StateTransition stateTransition : stateTransitionValueMap.keySet()) {
            states.put(index, new MMatrix(stateTransition.environmentState.state()));
            stateValues.put(index, new MMatrix(stateTransitionValueMap.get(stateTransition)));
            if (applyImportanceSamplingWeights) importanceSamplingWeights.put(index++, stateTransition.importanceSamplingWeight);
            index++;
        }
        if (applyImportanceSamplingWeights) neuralNetwork.setImportanceSamplingWeights(importanceSamplingWeights);
        neuralNetwork.train(new BasicSampler(states, stateValues, "fullSet = true, randomOrder = false, numberOfIterations = " + numberOfIterations));

        updateComplete();
    }
/**
     * Updates (trains) neural network.
     *
     * @throws NeuralNetworkException throws exception if neural network operation fails.
     * @throws DynamicParamException throws exception if parameter (params) setting fails.
     * @throws AgentException throws exception if update cycle is ongoing.
     * @throws MatrixException throws exception if matrix operation fails.
     */
Updates (trains) neural network.
@throws NeuralNetworkException throws exception if neural network operation fails.
@throws DynamicParamException throws exception if parameter (params) setting fails.
@throws AgentException throws exception if update cycle is ongoing.
@throws MatrixException throws exception if matrix operation fails.
Updates ( trains ) neural network . @throws NeuralNetworkException throws exception if neural network operation fails . @throws DynamicParamException throws exception if parameter ( params ) setting fails . @throws AgentException throws exception if update cycle is ongoing . @throws MatrixException throws exception if matrix operation fails .
public void update() throws NeuralNetworkException, DynamicParamException, AgentException, MatrixException {
        HashMap<Integer, MMatrix> states = new HashMap<>();
        HashMap<Integer, MMatrix> stateValues = new HashMap<>();
        HashMap<Integer, Double> importanceSamplingWeights = new HashMap<>();
        int index = 0;
        for (StateTransition stateTransition : stateTransitionValueMap.keySet()) {
            states.put(index, new MMatrix(stateTransition.environmentState.state()));
            stateValues.put(index, new MMatrix(stateTransitionValueMap.get(stateTransition)));
            if (applyImportanceSamplingWeights) importanceSamplingWeights.put(index++, stateTransition.importanceSamplingWeight);
            index++;
        }
        if (applyImportanceSamplingWeights) neuralNetwork.setImportanceSamplingWeights(importanceSamplingWeights);
        neuralNetwork.train(new BasicSampler(states, stateValues, "fullSet = true, randomOrder = false, numberOfIterations = " + numberOfIterations));
        updateComplete();
    }
public void update ( ) throws NeuralNetworkException , DynamicParamException , AgentException , MatrixException { HashMap < Integer , MMatrix > states = new HashMap < > ( ) ; HashMap < Integer , MMatrix > stateValues = new HashMap < > ( ) ; HashMap < Integer , Double > importanceSamplingWeights = new HashMap < > ( ) ; int index = 0 ; for ( StateTransition stateTransition : stateTransitionValueMap . keySet ( ) ) { states . put ( index , new MMatrix ( stateTransition . environmentState . state ( ) ) ) ; stateValues . put ( index , new MMatrix ( stateTransitionValueMap . get ( stateTransition ) ) ) ; if ( applyImportanceSamplingWeights ) importanceSamplingWeights . put ( index ++ , stateTransition . importanceSamplingWeight ) ; index ++ ; } if ( applyImportanceSamplingWeights ) neuralNetwork . setImportanceSamplingWeights ( importanceSamplingWeights ) ; neuralNetwork . train ( new BasicSampler ( states , stateValues , "fullSet = true, randomOrder = false, numberOfIterations = " + numberOfIterations ) ) ; updateComplete ( ) ; }
Updates (trains) neural network.
Updates ( trains ) neural network .