Example #1
0
    def step_statictics(simu, network, plot, inputs, outputs):
        cell = [0 for _ in range(10)]
        for k in range(10):
            if index_max_nth(network['FoN'].stateOutputNeurons,
                             k) == index_max(outputs):
                cell[k] = 1
                break

        #rms
        simu.rms('FoN', inputs, outputs)
        simu.rms('SoN', network['FoN'].stateHiddenNeurons, cell)

        #err
        simu.perf('FoN', outputs)
        simu.perf('SoN', cell)

        #wager ratio
        if (index_max(network['SoN'].stateOutputNeurons) == 0):
            plot['high_wager'] += 1

        #feedback
        if (index_max_nth(
                network['FoN'].stateOutputNeurons,
                index_max(
                    network['SoN'].stateOutputNeurons)) == index_max(outputs)):
            plot['feedback'] += 1
Example #2
0
    def step_statictics(simu, network, plot, inputs, outputs):
        cell = [0., 0.]
        if index_max(network['FoN'].stateOutputNeurons) == index_max(outputs):
            cell = [0., 1]
        else:
            cell = [1, 0.]

        #rms
        simu.rms('FoN', inputs, outputs)
        simu.rms('SoN', network['FoN'].stateHiddenNeurons, cell)
        
        #err
        simu.perf('FoN', outputs)
        simu.perf('SoN', cell)
        
        #wager ratio
        if(index_max(network['SoN'].stateOutputNeurons) == 1):
            plot['high_wager'] += 1
            
        #feedback
        if(index_max(network['SoN'].stateOutputNeurons) == 1):
            if(index_max(network['FoN'].stateOutputNeurons) == index_max(outputs)):
                plot['feedback'] += 1
        if(index_max(network['SoN'].stateOutputNeurons) == 0):
            if(index_max_nth(network['FoN'].stateOutputNeurons,1) == index_max(outputs)):
                plot['feedback'] += 1
Example #3
0
    def step_statictics(simu, network, plot, inputs, outputs):
        cell = [0., 0.]
        if index_max(network['FoN'].stateOutputNeurons) == index_max(outputs):
            cell = [0., 1]
        else:
            cell = [1, 0.]

        #rms
        simu.rms('FoN', inputs, outputs)
        simu.rms('SoN', network['FoN'].stateHiddenNeurons, cell)

        #err
        simu.perf('FoN', outputs)
        simu.perf('SoN', cell)

        #wager ratio
        if (index_max(network['SoN'].stateOutputNeurons) == 1):
            plot['high_wager'] += 1

        #feedback
        if (index_max(network['SoN'].stateOutputNeurons) == 1):
            if (index_max(
                    network['FoN'].stateOutputNeurons) == index_max(outputs)):
                plot['feedback'] += 1
        if (index_max(network['SoN'].stateOutputNeurons) == 0):
            if (index_max_nth(network['FoN'].stateOutputNeurons,
                              1) == index_max(outputs)):
                plot['feedback'] += 1
Example #4
0
 def step_learn(network, inputs, outputs):
     cell = [0 for _ in range(10)]
     for k in range(10):
         if index_max_nth(network['FoN'].stateOutputNeurons, k) == index_max(outputs):
             cell[k] = 1
             break
     #Learning
     network['SoN'].train(network['FoN'].stateHiddenNeurons, cell)
     network['FoN'].train(inputs, outputs)
Example #5
0
 def step_learn(network, inputs, outputs):
     cell = [0 for _ in range(10)]
     for k in range(10):
         if index_max_nth(network['FoN'].stateOutputNeurons,
                          k) == index_max(outputs):
             cell[k] = 1
             break
     #Learning
     network['SoN'].train(network['FoN'].stateHiddenNeurons, cell)
     network['FoN'].train(inputs, outputs)
Example #6
0
    def step_statictics(simu, network, plot, inputs, outputs):
        cell = [0 for _ in range(10)]
        for k in range(10):
            if index_max_nth(network['FoN'].stateOutputNeurons, k) == index_max(outputs):
                cell[k] = 1
                break

        #rms
        simu.rms('FoN', inputs, outputs)
        simu.rms('SoN', network['FoN'].stateHiddenNeurons, cell)
        
        #err
        simu.perf('FoN', outputs)
        simu.perf('SoN', cell)
        
        #wager ratio
        if(index_max(network['SoN'].stateOutputNeurons) == 0):
            plot['high_wager'] += 1
        
        #feedback
        if(index_max_nth(network['FoN'].stateOutputNeurons, index_max(network['SoN'].stateOutputNeurons)) == index_max(outputs)):
            plot['feedback'] += 1