Skip to content

Commit

Permalink
Fix comment in qkt tutorial. Remove unnecessary type checks from QKT …
Browse files Browse the repository at this point in the history
…module
  • Loading branch information
caleb-johnson committed Dec 14, 2021
1 parent d5c8bff commit 4ed685a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 12 deletions.
2 changes: 1 addition & 1 deletion docs/tutorials/08_quantum_kernel_trainer.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@
"source": [
"### Train the Quantum Kernel\n",
"\n",
"To train the quantum kernel on the dataset (samples and labels), we call the `fit_kernel` method of `QuantumKernelTrainer`.\n",
"To train the quantum kernel on the dataset (samples and labels), we call the `fit` method of `QuantumKernelTrainer`.\n",
"\n",
"The output of `QuantumKernelTrainer.fit` is a `QuantumKernelTrainerResult` object. The results object contains the following class fields:\n",
" - `optimal_parameters`: A dictionary containing {parameter: optimal value} pairs\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,17 +113,8 @@ def __init__(
self._initial_point = initial_point
self._optimizer = optimizer or SPSA()

# Set up loss function
if isinstance(loss, str):
loss = loss.lower()
if loss == "svc_loss":
self._loss = self._str_to_loss(loss)
else:
raise ValueError(f"Unknown loss {loss}!")
elif isinstance(loss, KernelLoss):
self._loss = loss
else:
raise ValueError(f"Unknown loss {loss}!")
# Loss function setter
self.loss = loss

@property
def quantum_kernel(self) -> QuantumKernel:
Expand Down

0 comments on commit 4ed685a

Please sign in to comment.