Skip to content

Some small code issues #1

@cexuzheng

Description

@cexuzheng

Hi,
I found your work in the Model-Based Reinforcement Learning book along with this pyhton toolbox very interesting. However, while executing the code I have found some minor issues.

  1. In the MBRLtool.py file, in the Class Objective, you missed writing the self.Q and self.R for the stage cost function
  2. In the SysID class, in the update function for the RLS, you call utils.RLS instead of utils.identification_RLS
  3. In the utils.identification_RLS, the equations didn't work quite right, so I made some modifications:

def identification_RLS(W,S,dXdt,Theta,forget_factor=0.9):
g=np.matmul(S,Theta)/(forget_factor+np.matmul(np.matmul(Theta.T,S),Theta))
S=(1/forget_factor)*(S-np.matmul(g.reshape(S.shape[0],1),np.matmul(Theta.T,S).reshape(1,S.shape[0])) )
W=W+np.matmul( (dXdt-np.matmul(W,Theta)).reshape(len(dXdt),1) ,np.matmul(Theta.T, S).reshape(1,len(Theta)))
return [W,S]

  1. I might suggest to improve the definition of the SysID class by choosing the desired lam factor for the SINDy algorithm.

Hope this can help and share better your fabulous work.

I also had some questions about the Quadrotor example, could you introduce me the parameters that you used to get those examples of the book? I found the very interesting, but didn't quite got them so quickly and stable.

Thank a lot

Ce Xu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions