vc.optimizers module
This module is used to define optimizers for training quantum models.
- vc.optimizers.get_optimizer(parameters, optimizer)[source]
Create instance of an optimizer.
- Parameters:
parameters (
Iterable
[TensorType
]) – Tensor objects to optimize over.optimizer (
Mapping
[str
,Any
]) –Mapping of the form
{"name": str, "options": dict}
. The value for"name"
is used to determine the optimizer class. The value for"options"
should be adict
and is passed as kwargs to the constructor of the corresponding optimizer class. The supported optimizers are:- SDG:
name:
"stochastic_gradient_descent"
options: see SDG kwargs
- Adam
name:
"adam"
options: see Adam kwargs
- Return type:
Optimizer
- Returns:
Instance of a torch optimizer.