Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why does the input state contain sinusoids? #28

Closed
ehannigan opened this issue Jun 19, 2020 · 4 comments
Closed

Why does the input state contain sinusoids? #28

ehannigan opened this issue Jun 19, 2020 · 4 comments

Comments

@ehannigan
Copy link
Contributor

This is not necessarily a coding issue, but I don't know where else to ask. In mass_spring.py, the input to the neural network controller (length of n_input_states) contains n_sin_waves.

https://github.com/yuanming-hu/difftaichi/blob/242905d81d0814911d8f3c376f35b5045446bf61/examples/mass_spring.py#L102-L108

What is the purpose of feeding sine waves into the system? I read the DiffTaiChi paper and I do not see any references to the design of the mass-spring system or why you would want to input a sine wave. If it is not a simple explanation, could you point me towards a source that I could read? I appreciate it.

@yuanming-hu
Copy link
Member

Thanks for the question. That's just to enforce a periodic motion. I was also curious about if a purely open-loop controller works, so I made that design.

Of course, you can change that to a close-loop controller, as in https://github.com/yuanming-hu/difftaichi/blob/242905d81d0814911d8f3c376f35b5045446bf61/examples/rigid_body.py#L113

@ehannigan
Copy link
Contributor Author

Thanks! That I'll try both options.

@ehannigan
Copy link
Contributor Author

Actually, one more question. I looked closer at rigid_body.py and mass_spring.py, I don't see how the definitions of nn1 are different such that mass_spring.py is open-loop and rigid_body.py is closed loop. Could you expand on that point a little more?

@ehannigan
Copy link
Contributor Author

I think I figured it out. The mass_spring nn1 is closed loop in that the goal is used as part of the state multiplied by the weights of nn1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants