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

Get non trainable parameters #522

Open
AdrianPerezSalinas opened this issue Nov 26, 2021 · 1 comment
Open

Get non trainable parameters #522

AdrianPerezSalinas opened this issue Nov 26, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@AdrianPerezSalinas
Copy link
Contributor

If we have a circuit depending on parameters, it is possible to set some parameters as trainable or not trainable. Then, it is possible to recover only the trainable one or all of them. Can we add a feature to retrieve the non trainable parameters as well?

from qibo.models import Circuit
from qibo import gates
C = Circuit(2)

C.add(gates.RY(0, theta=1))
C.add(gates.RY(1, theta=2, trainable=False))

print(C.get_parameters(include_not_trainable=False))
print(C.get_parameters(include_not_trainable=True))
@AdrianPerezSalinas AdrianPerezSalinas added the enhancement New feature or request label Nov 26, 2021
@AdrianPerezSalinas
Copy link
Contributor Author

As a related request, we could use the set_parameters method to modify trainable or non trainable parameters.

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

No branches or pull requests

1 participant