Skip to content

Commit

Permalink
Modify our navigational structure to handle pytorch/standalone bifurc…
Browse files Browse the repository at this point in the history
…ation
  • Loading branch information
JeffBerger committed Sep 4, 2024
1 parent 26c9ef0 commit 5ef89ea
Show file tree
Hide file tree
Showing 20 changed files with 107 additions and 33 deletions.
15 changes: 15 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,18 @@

html_theme = "sphinx_rtd_theme"
html_static_path = ["_static"]

html_theme_options = {
# 'analytics_id': 'G-XXXXXXXXXX', # Provided by Google in your dashboard
# 'analytics_anonymize_ip': False,
# 'logo_only': False,
'display_version': True,
'prev_next_buttons_location': 'bottom',
'style_external_links': False,
# Toc options
'collapse_navigation': True,
'sticky_navigation': True,
'navigation_depth': 4,
'includehidden': True,
'titles_only': False
}
6 changes: 6 additions & 0 deletions docs/examples/pytorch/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
PyTorch QCML Model Examples
===========================

.. toctree::

/examples/pytorch/mnist
4 changes: 4 additions & 0 deletions docs/examples/pytorch/mnist.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
QCML PyTorch MNIST
==================

pass
File renamed without changes.
8 changes: 8 additions & 0 deletions docs/examples/stand_alone/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Stand Alone QCML Model Examples
===============================

.. toctree::

/examples/stand_alone/coil20
/examples/stand_alone/wisconsin
/examples/stand_alone/timeseries
File renamed without changes.
File renamed without changes.
19 changes: 6 additions & 13 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,36 @@ Qognitive Python Client
=======================

.. toctree::
:maxdepth: 2
:hidden:
:caption: Getting started

/tutorial/install
/tutorial/datasets
/tutorial/models
/tutorial/training
/tutorial/inference

.. toctree::
:maxdepth: 2
:hidden:
:caption: Examples

/examples/wisconsin
/examples/coil20
/examples/timeseries
/examples/stand_alone/index
/examples/pytorch/index

.. toctree::
:maxdepth: 2
:hidden:
:caption: Models

/models/pauli
/models/ensemble
/models/stand_alone/pauli
/models/stand_alone/ensemble
/models/pytorch/qcml_layer

.. toctree::
:maxdepth: 2
:hidden:
:caption: Parameters
:caption: QCML Stand Alone Parameters

/parameters/optimization
/parameters/state

.. toctree::
:maxdepth: 2
:hidden:
:caption: API Reference

Expand Down
4 changes: 4 additions & 0 deletions docs/models/pytorch/qcml_layer.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
QCML Layer
==========

The QCML Pytorch layer
File renamed without changes.
File renamed without changes.
25 changes: 8 additions & 17 deletions docs/tutorial/models.rst
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
Model Selection
===============

Here we will choose one of our QCML models and parameterize it for training. There are several QCML models that you can choose from and we are continuing to develop new models as well as improve existing ones. You can see which models are currently available on the sidebar.
Here we will choose one of our QCML models and parameterize it for training. There are several QCML models that you can choose from and we are continuing to develop new models as well as improve existing ones. You can see which models are currently available on the sidebar.
about:blank#blocked
There are two categories of models. The first is a stand alone QCML model, which has at its core a single cost function that involves the quantum state. The second is a QCML PyTorch layer which has been built so that you can integrate it with classical ML deep learning layers, and so develop a hybrid quantum-classical model whose architecture fits your needs. The cost function is defined by you which is a classical cost function where QCML will be a part of the network.

We're going to use the Pauli model for this example.
Setting up each is a little different, so we'll cover them separately.

Setting the Model Parameters
----------------------------
.. toctree::
:caption: QCML Models

We configure our model by a call on our ``qcml`` object, which returns the object with the model configuration. This is the same procedure for both sync and async clients.
/tutorial/stand_alone/index
/tutorial/pytorch/index

.. code-block:: python
qcml = qcml.pauli(
operators=["X", "Y", "Z"],
qbits=2,
pauli_weight=2
)
You can read more about the pauli model, the parameterization, and the available options on the :doc:`/models/pauli` page.

.. note::
The operators list does have to match the dataset that you are going to be running on. This might seem redundant but it happens in lots of other machine learning models where you have to match the dimensionality of your input to the dimensions of the model - or at least do some preprocessing to get the data into the proper scale.
9 changes: 9 additions & 0 deletions docs/tutorial/pytorch/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
PyTorch QCML
============


.. toctree::

/tutorial/pytorch/models
/tutorial/pytorch/train
/tutorial/pytorch/inference
4 changes: 4 additions & 0 deletions docs/tutorial/pytorch/inference.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Inference with PyTorch
======================

Inference on QCML PyTorch models will be coming mid Sept 2024!
4 changes: 4 additions & 0 deletions docs/tutorial/pytorch/models.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Building a PyTorch Train Function
=================================

PyTorch
4 changes: 4 additions & 0 deletions docs/tutorial/pytorch/train.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
PyTorch Training
================

Call the train
8 changes: 8 additions & 0 deletions docs/tutorial/stand_alone/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Stand Alone QCML
================

.. toctree::

/tutorial/stand_alone/models
/tutorial/stand_alone/train
/tutorial/stand_alone/inference
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ That's it! You have all the pieces to get started with the QCML library. You ca

Try some more complicated examples and see how the model performs, or dive right into your own data.

* :doc:`/examples/wisconsin`
* :doc:`/examples/coil20`
* :doc:`/examples/timeseries`
* :doc:`/examples/stand_alone/wisconsin`
* :doc:`/examples/stand_alone/coil20`
* :doc:`/examples/stand_alone/timeseries`
24 changes: 24 additions & 0 deletions docs/tutorial/stand_alone/models.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Stand Alone Models
==================

Here we will choose one of our QCML models and parameterize it for training. There are several QCML models that you can choose from and we are continuing to develop new models as well as improve existing ones. You can see which models are currently available on the sidebar.

We're going to use the Pauli model for this example.

Setting the Model Parameters
----------------------------

We configure our model by a call on our ``qcml`` object, which returns the object with the model configuration. This is the same procedure for both sync and async clients.

.. code-block:: python
qcml = qcml.pauli(
operators=["X", "Y", "Z"],
qbits=2,
pauli_weight=2
)
You can read more about the pauli model, the parameterization, and the available options on the :doc:`/models/stand_alone/pauli` page.

.. note::
The operators list does have to match the dataset that you are going to be running on. This might seem redundant but it happens in lots of other machine learning models where you have to match the dimensionality of your input to the dimensions of the model - or at least do some preprocessing to get the data into the proper scale.
File renamed without changes.

0 comments on commit 5ef89ea

Please sign in to comment.