Commit 5f1a3f5c authored by Jussi Lindgren's avatar Jussi Lindgren
Browse files

Examples: How to do elementary incremental learning

parent 26b0e09a
<OpenViBE-Classifier-Box XMLVersion="3">
<Strategy-Identifier class-id="(0xffffffff, 0xffffffff)">Native</Strategy-Identifier>
<Algorithm-Identifier class-id="(0x2ba17a3c, 0x1bd46d84)">Linear Discrimimant Analysis (LDA)</Algorithm-Identifier>
<Stimulations>
<Class-Stimulation class-id="0">OVTK_StimulationId_Label_01</Class-Stimulation>
<Class-Stimulation class-id="1">OVTK_StimulationId_Label_02</Class-Stimulation>
</Stimulations>
<OpenViBE-Classifier>
<LDA version="1">
<Classes>0 1 </Classes>
<Class-config-list>
<Class-config>
<Weights> 5.482270e+001 2.478968e+001</Weights>
<Bias>-66.7812</Bias>
</Class-config>
<Class-config>
<Weights> 5.275779e+001 2.744076e+001</Weights>
<Bias>-68.0094</Bias>
</Class-config>
</Class-config-list>
</LDA>
</OpenViBE-Classifier>
</OpenViBE-Classifier-Box>
\ No newline at end of file
<OpenViBE-Classifier-Box XMLVersion="3">
<Strategy-Identifier class-id="(0xffffffff, 0xffffffff)">Native</Strategy-Identifier>
<Algorithm-Identifier class-id="(0x2ba17a3c, 0x1bd46d84)">Linear Discrimimant Analysis (LDA)</Algorithm-Identifier>
<Stimulations>
<Class-Stimulation class-id="0">OVTK_StimulationId_Label_01</Class-Stimulation>
<Class-Stimulation class-id="1">OVTK_StimulationId_Label_02</Class-Stimulation>
<Class-Stimulation class-id="2">OVTK_StimulationId_Label_03</Class-Stimulation>
</Stimulations>
<OpenViBE-Classifier>
<LDA version="1">
<Classes>0 1 2 </Classes>
<Class-config-list>
<Class-config>
<Weights> 1.420580e+002 1.407747e+002 1.515542e+002 1.064545e+002</Weights>
<Bias>-3949.05</Bias>
</Class-config>
<Class-config>
<Weights> 1.396979e+002 1.432478e+002 1.514010e+002 1.063725e+002</Weights>
<Bias>-3947.23</Bias>
</Class-config>
<Class-config>
<Weights> 1.396863e+002 1.410456e+002 1.539364e+002 1.070348e+002</Weights>
<Bias>-3961.82</Bias>
</Class-config>
</Class-config-list>
</LDA>
</OpenViBE-Classifier>
</OpenViBE-Classifier-Box>
\ No newline at end of file
sent = false
function initialize(box)
dofile(box:get_config("${Path_Data}") .. "/plugins/stimulation/lua-stimulator-stim-codes.lua")
sent = false;
end
function uninitialize(box)
end
function process(box)
while box:keep_processing() and sent == false do
current_time = box:get_current_time() + 1
box:send_stimulation(1, OVTK_StimulationId_Label_01, current_time, 0)
box:send_stimulation(1, OVTK_StimulationId_Label_02, current_time+4, 0)
box:send_stimulation(1, OVTK_StimulationId_Label_03, current_time+8, 0)
box:send_stimulation(1, OVTK_StimulationId_Label_02, current_time+12, 0)
box:send_stimulation(1, OVTK_StimulationId_Label_01, current_time+16, 0)
box:send_stimulation(1, OVTK_StimulationId_Label_03, current_time+20, 0)
box:send_stimulation(1, OVTK_StimulationId_Label_01, current_time+24, 0)
box:send_stimulation(1, OVTK_StimulationId_Label_02, current_time+28, 0)
box:send_stimulation(1, OVTK_StimulationId_Label_03, current_time+32, 0)
box:send_stimulation(1, OVTK_StimulationId_Label_03, current_time+36, 0)
box:send_stimulation(1, OVTK_StimulationId_Label_02, current_time+40, 0)
box:send_stimulation(1, OVTK_StimulationId_Label_01, current_time+44, 0)
box:send_stimulation(1, OVTK_StimulationId_ExperimentStop, current_time+48, 0)
sent = true
box:sleep()
end
end
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment