-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
21 changed files
with
369 additions
and
235 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ | |
.. currentmodule:: qbraid_algorithms | ||
""" | ||
|
||
from . import datasets, esn, qrc | ||
|
||
try: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# Copyright (C) 2024 qBraid | ||
# | ||
# This file is part of the qBraid-SDK | ||
# | ||
# The qBraid-SDK is free software released under the GNU General Public License v3 | ||
# or later. You can redistribute and/or modify it under the terms of the GPL v3. | ||
# See the LICENSE file in the project root or <https://www.gnu.org/licenses/gpl-3.0.html>. | ||
# | ||
# THERE IS NO WARRANTY for the qBraid-SDK, as per Section 15 of the GPL v3. | ||
|
||
""" | ||
Module for encoding of data. | ||
""" | ||
|
||
import torch | ||
|
||
|
||
def one_hot_encoding(labels: torch.Tensor, num_classes: int) -> torch.Tensor: | ||
""" | ||
Convert a tensor of numeric labels into a one-hot encoded matrix using PyTorch. | ||
Args: | ||
labels (torch.Tensor): The tensor of labels to encode. | ||
num_classes (int): The total number of classes. | ||
Returns: | ||
torch.Tensor: The one-hot encoded matrix where each row corresponds to a label. | ||
TODO: Implement the one-hot encoding function. | ||
""" | ||
# Placeholder for actual implementation. | ||
return torch.nn.functional.one_hot(labels, num_classes=num_classes) |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.