OpenViBE forum

The OpenViBE community
It is currently Tue Nov 13, 2018 3:36 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: Mon Dec 04, 2017 2:28 pm 
Offline

Joined: Wed Nov 22, 2017 6:42 pm
Posts: 2
Hello! I have an already trained classifier and a I need to load it only once, when pressing play to the scenario. I'm using a Matlab Scripting Box, and I want to know if it should be loaded in the "Initialize" script of the box and declared as global (an how to use it after that) or if I should do it in the "Process" script.

Thank you! :D


Top
 Profile  
Reply with quote  
PostPosted: Tue Dec 05, 2017 11:30 am 
Offline

Joined: Tue Dec 04, 2012 3:53 pm
Posts: 762
Location: INRIA Rennes, FRANCE
Hello Eli,

global variables can get a bit messy, so I recommend doing it like this,

Code:
       % in initialize.m
       box_in.user_data.classifier = myClassifier; % store your loaded classifier
       box_out = box_in;  % pass it out to openvibe

       % in process.m
       myClassifier = box_in.user_data.classifier;  % take the classifier from openvibe
       % use it somehow


For reference, the global variable solution would look like

Code:
     % in initialize.m
     global myClassifier;
     % do something to initialize it, load from disk or whatever

     % in process.m
     global myClassifier;
     % use it somehow


In any case, if you have a premade classifier, you should definitely load/build it in initialize unless you have some reason to do it in process.


Hope this helps,
Jussi


Top
 Profile  
Reply with quote  
PostPosted: Tue Dec 05, 2017 12:17 pm 
Offline

Joined: Wed Nov 22, 2017 6:42 pm
Posts: 2
jtlindgren wrote:
Hello Eli,

global variables can get a bit messy, so I recommend doing it like this,

Code:
       % in initialize.m
       box_in.user_data.classifier = myClassifier; % store your loaded classifier
       box_out = box_in;  % pass it out to openvibe

       % in process.m
       myClassifier = box_in.user_data.classifier;  % take the classifier from openvibe
       % use it somehow


For reference, the global variable solution would look like

Code:
     % in initialize.m
     global myClassifier;
     % do something to initialize it, load from disk or whatever

     % in process.m
     global myClassifier;
     % use it somehow


In any case, if you have a premade classifier, you should definitely load/build it in initialize unless you have some reason to do it in process.


Hope this helps,
Jussi


Thank you! It helps a lot!! :D :D


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group
Americanized by Maƫl Soucaze.