dwavesystems/dwave-pytorch-plugin
dwavesystems/dwave-pytorch-plugin has 41 GitHub stars and 26 forks. Star changes are not measured yet. Last checked 2026-11-12 18:07 UTC. Last push 2026-10-28.
Comment ces chiffres sont mesurés
D-Wave PyTorch plugin for quantum-classical hybrid ML.
Progression mesurée des étoiles
- in 24h
- Historique en cours
- in 7 days
- Historique en cours
- in 15 days
- Historique en cours
- in 1 month
- Historique en cours
Variations nettes sur des périodes qui se chevauchent, pas des totaux quotidiens. Les mesures absentes restent vides. Les étoiles indiquent l’intérêt, pas la qualité.
README.md
OriginalD-Wave PyTorch Plugin
This plugin provides an interface between D-Wave's quantum computers and the PyTorch framework, including neural network modules for building and training Boltzmann Machines along with various sampler utility functions.
Example
Boltzmann Machines are probabilistic generative models for high-dimensional binary data. The following example walks through a typical workflow for fitting Boltzmann Machines via maximum likelihood.
Define a Graph-Restricted Boltzmann Machine with a square graph
.. code-block:: python
import torch
from torch.optim import SGD
from dwave.plugins.torch.models import GraphRestrictedBoltzmannMachine as GRBM
from dwave.plugins.torch.samplers import BlockSampler
grbm = GRBM(nodes=["a", "b", "c", "d"], edges=[("a", "b"), ("b", "c"), ("c", "d"), ("d", "a")])
print("Linear weights:", grbm.linear)
print("Quadratic weights:", grbm.quadratic)
Instantiate a block-Gibbs sampler <https://en.wikipedia.org/wiki/Gibbs_sampling#Blocked_Gibbs_sampler>_.
Variables "a" and "c" are in block 0; variables "b" and "d" are in block 1.
The sampler consists of three parallel Markov chains of length ten each.
Each Markov chain samples at a constant unit inverse temperature.
.. code-block:: python
sampler = BlockSampler(grbm=grbm, colouring=lambda v: v in {"b", "d"}, num_chains=3, schedule=[1]*10)
Create a batch of data and perform one likelihood-optimization step
.. code-block:: python
x_data = torch.tensor([[1, -1, 1, -1], [-1, 1, 1, 1]], dtype=torch.float32)
optimizer = SGD(grbm.parameters(), lr=1)
x_model = sampler.sample()
grbm.quasi_objective(x_data, x_model).backward()
optimizer.step()
print("Updated quadratic weights:", grbm.quadratic)
To use a dimod <https://github.com/dwavesystems/dimod/>_ sampler, replace the :code:sampler = BlockSampler(...) line with
.. code-block:: python
from dwave.plugins.torch.samplers import DimodSampler
from dwave.samplers import RandomSampler
sampler = DimodSampler(grbm=grbm, sampler=RandomSampler(),
prefactor=1, sample_kwargs=dict(num_reads=5))
License
Released under the Apache License 2.0. See LICENSE file.
Explorer des projets similaires
tensorflow/tensorflow
Un framework open source d'apprentissage automatique pour tous
201,584 étoileshuggingface/transformers
🤗 Transformers : le framework de définition de modèles pour les modèles d'apprentissage automatique de pointe en texte, vision, audio et multimodal, pour l'inférence et l'entraînement.
168,917 étoilesAUTOMATIC1111/stable-diffusion-webui
Interface web de Stable Diffusion
165,300 étoilesComfy-Org/ComfyUI
La GUI, l'API et le backend les plus puissants et modulaires pour les modèles de diffusion, avec une interface de graphes et de nœuds. Le moteur d'inférence local le plus rapide au monde.
146,472 étoiles