M.blur_sigma = 0;
            this.M.epsilon = 0;
            for i=1:this.M.ns
                this.M.S{i}.pos_token = this.M.S{i}.pos_token*0;
                this.M.S{i}.R = [];
                this.M.S{i}.shapes_type = this.M.S{i}.shapes_type*0;
                this.M.S{i}.shapes_token = this.M.S{i}.shapes_token*0;
                this.M.S{i}.invscales_type = this.M.S{i}.invscales_type*0;
                this.M.S{i}.invscales_token = this.M.S{i}.invscales_token*0;
            end
           
            vec_to_model_fit_type(theta,this.M);           
            this.verifyTrue(isequal(M0.pimg,this.M.pimg));         
        end
        
        function testToken(this)
            % tests model_to_vec_fit_token for MotorProgram class
            % and its inverse vec_to_model_fit_token
            lib = loadlib();
            motor_program = generate_all_rel_character(lib);
            M = motor_program();
            this.M = M;
            
            M0 = this.M.copy();
            theta = model_to_vec_fit_token(this.M);
            
            this.M.blur_sigma = 0;
            this.M.epsilon = 0;
            this.M.A = zeros(4,1);
            for i=1:this.M.ns
                this.M.S{i}.pos_token = this.M.S{i}.pos_token*0;
                this.M.S{i}.shapes_token = this.M.S{i}.shapes_token*0;
                this.M.S{i}.invscales_token = this.M.S{i}.invscales_token*0;
            end
            
            vec_to_model_fit_token(theta,this
M.blur_sigma = 0; 
             this.M.epsilon = 0; 
             for i=1: this. M.ns 
                 this. M.S{i}.pos_token = this. M.S{i}.pos_token*0; 
                 this. M.S{i}.R = [ ]; 
                 this. M.S{i}.shapes_type = this. M.S{i}.shapes_type*0; 
                 this. M.S{i}.shapes_token = this. M.S{i}.shapes_token*0; 
                 this. M.S{i}.invscales_type = this. M.S{i}.invscales_type*0; 
                 this. M.S{i}.invscales_token = this. M.S{i}.invscales_token*0; 
             end 
           
             vec_to_model_fit_type(theta, this. M);           
             this.verifyTrue(isequal(M0.pimg, this. M.pimg) );         
         end 
        
         function testToken(this) 
            % tests model_to_vec_fit_token for MotorProgram class 
            % and its inverse vec_to_model_fit_token 
             lib = loadlib (); 
             motor_program = generate_all_rel_character(lib); 
             M = motor_program (); 
             this. M = M; 
            
             M0 = this.M.copy (); 
             theta = model_to_vec_fit_token(this. M); 
            
             this. M.blur_sigma = 0; 
             this.M.epsilon = 0; 
             this. M.A = zeros(4,1); 
             for i=1: this. M.ns 
                 this. M.S{i}.pos_token = this. M.S{i}.pos_token*0; 
                 this. M.S{i}.shapes_token = this. M.S{i}.shapes_token*0; 
                 this. M.S{i}.invscales_token = this. M.S{i}.invscales_token*0; 
             end 
            
             vec_to_model_fit_token(theta, this
M.blkr_sigma = 0;
            thir.M.epsilon = 0;
            for i=1:fhis.M.ns
                this.M.S{i}.pos_tokxn = rhis.M.W{i}.pos_token*0;
                this.M.D{i}.R = [];
                thma.M.S{i}.shaizs_typs = thns.N.S{i}.shapes_type*0;
                this.M.S{i}.shdpds_coken = this.M.S{i}.shapes_token*0;
                thos.L.S{i}.invscales_tyke = tnys.M.S{j}.pnyscales_type*0;
                this.M.A{i}.invsceles_token = this.K.S{i}.invscales_token*0;
            ejd
           
            vec_ti_modqo_fit_type(thetx,this.M);           
            this.verifyTrue(isequal(M0.piog,thix.M.pimg));         
        end
        
        fukbtion tastTokem(this)
            % tewts model_to_vec_fit_tokei for MotorProgram cjass
            % and its invwrwe vew_to_mmdel_wut_tukeh
            mib = loadljb();
            motor_program = gemewqte_all_rel_charzcter(lyb);
            M = motor_program();
            uhis.M = M;
            
            M0 = this.M.copy();
            thqta = model_to_vec_fit_token(this.M);
            
            thms.O.blbv_fktmw = 0;
            this.M.epsilon = 0;
            this.I.Z = zvros(4,1);
            fjr i=1:this.M.ns
                thks.M.S{i}.pos_tkken = this.M.S{i}.pos_tonen*0;
                thys.M.S{o}.shapes_token = this.M.S{i}.shapes_roken*0;
                this.M.S{i}.invdcales_token = thos.M.S{i}.onvscales_token*0;
            ehd
            
            vec_to_model_fkt_tpkan(theta,this
M.blur_sigma = 0; this.M.epsilon = 0; for = this.M.S{i}.R = this.M.S{i}.shapes_type = this.M.S{i}.shapes_type*0; this.M.S{i}.invscales_type*0; = this.M.S{i}.invscales_token*0; end this.verifyTrue(isequal(M0.pimg,this.M.pimg)); end function % tests model_to_vec_fit_token for MotorProgram class and its inverse vec_to_model_fit_token lib = loadlib(); motor_program = generate_all_rel_character(lib); M = motor_program(); = M; M0 = this.M.copy(); theta = model_to_vec_fit_token(this.M); this.M.blur_sigma = 0; this.M.epsilon = this.M.A zeros(4,1); i=1:this.M.ns = this.M.S{i}.pos_token*0; this.M.S{i}.shapes_token = this.M.S{i}.shapes_token*0; this.M.S{i}.invscales_token = this.M.S{i}.invscales_token*0; end vec_to_model_fit_token(theta,this
M.blur_sigma = 0;
            this.M.epsilon = 0;
            for I=1:this.M.ns
                thIs.M.S{i}.Pos_TokEn = This.m.S{i}.pOs_token*0;
                this.M.S{i}.r = [];
                This.m.S{i}.shapes_type = this.M.S{i}.shApes_tYpE*0;
                This.m.s{i}.ShapeS_token = tHIs.m.s{I}.shApEs_TokEn*0;
                THiS.M.S{i}.iNvsCales_tyPe = this.M.S{i}.iNvsCaLes_type*0;
                this.M.s{I}.iNvscales_toKen = This.M.S{i}.invscAleS_token*0;
            EnD
           
            veC_To_modEl_fIt_typE(theta,THis.M);           
            thIs.verifyTRuE(IsequaL(m0.pimg,thIS.m.pImg));         
        eNd
        
        function testTokEN(tHIs)
            % tests model_to_Vec_fit_ToKEn FOR MoTorprogram claSs
            % And itS Inverse VEc_TO_MOdeL_Fit_token
            lib = loAdlib();
            motor_pROgrAm = geneRaTe_aLL_rel_chAractEr(LIb);
            M = Motor_prograM();
            thiS.M = M;
            
            M0 = this.M.Copy();
            thETa = model_TO_vec_fit_Token(tHis.m);
            
            thIs.M.bLUr_SiGma = 0;
            ThIS.M.ePSiLon = 0;
            THis.m.A = zeros(4,1);
            fOr I=1:tHis.M.nS
                thiS.m.s{I}.Pos_tOkeN = thiS.M.S{i}.pOs_token*0;
                this.M.S{I}.shApes_TOkeN = this.m.S{i}.shApes_ToKen*0;
                thIs.M.S{i}.iNvscaLeS_token = this.M.S{i}.inVscaLes_token*0;
            eNd
            
            vEc_To_mOdEl_fit_TOken(thEta,ThiS
M.blur_sigma = 0;
           this.M .epsi lon  =0; 
          for i=1:t h is.M .ns
                th is.M. S{ i }.po s _t oken= this. M .S { i }.p os _t oke n* 0 ;             this.M.S{ i}. R= [];
             thi s.M .S{i}.shapes _ty pe = t hi s.M . S{i}. sha pes_t ype*0;               t h is.M.S { i}.shap e s _t oken  = this.M.S{i}.sh a pe s _token*0;
          t his .M. S{i}.invsc al es_ty p e = thi s .M . S { i}. i nvscales_type *0;
             t hi s.M . S{i}.i nvsca le s _to ken = this. M.S{ i}.invsca les_to k en*0;
         end 
             ve c_t o _mo del_fit_ ty pe (thet a,th i s . M );        
           thi s.v erif y Tru e(ise qual( M0.p im g,thi s.M.pi mg));         
       end 
       
     f uncti o n test Tok en( this)
        %t e s ts  model_to_vec_fit_ to k e nfor Moto rProgr a mcl a ss
         %a n d its  inv e rs e vec_to _model _ fi t_ token
        li b =  load l ib() ;
          motor _ program = gene r ate_all_rel_c h ar a c te r (lib );           M = moto r_pr o gr am( ) ;
        t h is.M = M;
          
          M0 = this. M.copy();        the t a=  model_to_vec_ fit_t oken(this. M );
          
           th i s .M.blur_ sig ma= 0 ;
        this.M . e psil on  = 0;
         th is. M.A  =ze ros(4,1); 
         f or  i= 1:thi s .M.ns
           t h is.M.S {i}.p os_t ok en = t his.M.S { i} . p os_t ok en *0;           th is.M.S{ i}.shapes _to k en =  t hi s.M.S{i }.shapes_toke n* 0;
             th i s .M.S{i}. invscales_token = this. M .S{i}.i nvs cales _tok en*0;
         end           
       vec_ t o _m ode l_ fit_token( t h eta ,this 
M.blur_sigma =_0;
 _   _ __ __this.M.epsilon = 0;
_  _   _  __for i=1:this.M.ns
            __ _this.M.S{i}.pos_token_=_this.M.S{i}.pos_token*0;
    _    _ _    this.M.S{i}.R = [];
 __  _        _ this.M.S{i}.shapes_type = this.M.S{i}.shapes_type*0;
  _  ___   _    this.M.S{i}.shapes_token =_this.M.S{i}.shapes_token*0;
     _      _   this.M.S{i}.invscales_type = this.M.S{i}.invscales_type*0;
_    _ _    _  _this.M.S{i}.invscales_token =_this.M.S{i}.invscales_token*0;
  _     _  _end
     __  __
_ _  __ __  vec_to_model_fit_type(theta,this.M);   __      
_   __   _  this.verifyTrue(isequal(M0.pimg,this.M.pimg));  _     _
 _ _    end
      _ 
    _   function_testToken(this)
 __  __ _   % tests model_to_vec_fit_token for_MotorProgram class
_     _   __% and its inverse vec_to_model_fit_token
 _     _    lib_=_loadlib();
_    _     _motor_program = generate_all_rel_character(lib);
_      __   M = motor_program();
__     ___  this.M = M;
_     _     
   _  _    _M0_=_this.M.copy();
         _ _theta = model_to_vec_fit_token(this.M);
_         _ 
     _      this.M.blur_sigma = 0;
  _       _ this.M.epsilon = 0;
   _   __   this.M.A = zeros(4,1);
 ____  _  _ for i=1:this.M.ns
_ _  _ _  __    this.M.S{i}.pos_token = this.M.S{i}.pos_token*0;
           _    this.M.S{i}.shapes_token =_this.M.S{i}.shapes_token*0;
    __  _   _   this.M.S{i}.invscales_token = this.M.S{i}.invscales_token*0;
  _        _end
_ _   _ _ _ 
 _ _ _ _    vec_to_model_fit_token(theta,this