Workflow: Formulation and Sampling - dynexcoin/DynexSDK GitHub Wiki
This section provides a high-level description of how you solve problems using the Dynex Neuromorphic Computing Platform.
The two main steps of solving problems using neuromorphic computing are:
1. Formulate your problem as an objective function
Objective (cost) functions are mathematical expressions of the problem to be optimized; for neuromorphic computing, these are quadratic models that have lowest values (energy) for good solutions to the problems they represent.
2. Find good solutions by sampling
Samplers are processes that sample from low-energy states of objective functions. Find good solutions by submitting your quadratic model to the Dynex Neuromorphic Computing Platform.
1. Objective Functions
To express a problem for the Dynex Platform in a form that enables solution by minimization, you need an objective function, a mathematical expression of the energy of a system. The energy is a function of voltages on the (simulated) neuromorphic chips. For most problems, the lower the energy of the objective function, the better the solution. Sometimes any low-energy state is an acceptable solution to the original problem; for other problems, only optimal solutions are acceptable. The best solutions typically correspond to the global minimum energy in the solution space.
Quadratic Models
To express your problem as an objective function and submit to the Dynex Platform for solution, you typically use quadratic models, for example:
-
Binary Quadratic Models are unconstrained and have binary variables. BQMs are typically used for applications that optimize over decisions that could either be true (or yes) or false (no); for example, should an antenna transmit, or did a network node experience failure?
-
Constrained Quadratic Models can be constrained and have integer and binary variables. CQMs are typically used for applications that optimize problems that might include real, integer and/or binary variables and one or more constraints.
-
Discrete Quadratic Models are unconstrained and have discrete variables. DQMs are typically used for applications that optimize over several distinct options; for example, which shift should employee X work, or should the state on a map be coloured red, blue, green or yellow?
Tools for Formulating Objective Functions
To express your problem as an objective function and submit to the Dynex Platform for solution, you typically use one of the quadratic models generated by the following tools:
Dimod: A Shared API for QUBO/Ising Samplers
Dimod is a shared API for samplers. It provides classes for quadratic models—such as the binary quadratic model (BQM) class that contains Ising and QUBO models used by samplers such as the Dynex Neuromorphic Platform or the D-Wave system—and higher-order (non-quadratic) models, reference examples of samplers and composed samplers and abstract base classes for constructing new samplers and composed samplers:
PyQUBO: QUBOs or Ising Models from Flexible Mathematical Expressions
PyQUBO allows you to create QUBOs or Ising models from flexible mathematical expressions easily. It is Python based (C++ backend), fully integrated with Ocean SDK, supports automatic validation of constraints and features placeholder for parameter tuning.
AutoQUBO: Automated Conversion from Python functions to QUBO
AUTOmated QUBO Generator (by Fujitsu Research) is an automatic tool for converting a high-level description of an optimization problem, written in Python, into an equivalent QUBO representation. It is doing this by using a novel data driven translation method that can completely decouple the input and output representation. The QUBO framework provides a way to model, in principle, any combinatorial optimization problem and enables the use of Ising machines, like available on the Dynex Platform, to solve it. It introduces symbolic sampling, which provides QUBO formulations for entire problem classes.
Qubolite: light-weight toolbox for working with QUBO instances in NumPy
Quantum Computing (QC) has ushered in a new era of computation, promising to solve problems that are practically infeasible for classical computers. One of the most exciting applications of quantum computing is its ability of solving combinatorial optimization problems, such as Quadratic Unconstrained Binary Optimization (QUBO). This problem class has regained significant attention with the advent of Quantum Computing. These hard-to-solve combinatorial problems appear in many different domains, including finance, logistics, Machine Learning and Data Mining. To harness the power of Quantum Computing for QUBO, The Lamarr Institute introduced qubolite, a Python package comprising utilities for creating, analyzing, and solving QUBO instances, which incorporates current research algorithms developed by scientists at the Lamarr Institute. Qubolite is a light-weight toolbox for working with QUBO instances in NumPy. This fork showcases the use of Qubolite to compute on the Dynex Neuromorphic computing platform.
Dynex PyTorch Library
Neuromorphic Dynex Chips can be used as Torch Layers ("DNX layer") in any PyTorch NN model with the Dynex SDK. This provides Python programmers easy access to neuromorphic computing as it provides seamless integration for machine learning and Artificial Intelligence tasks. DNX layers can be used stand-alone and combined with classical Torch layers (hybrid machine learning models) or used for transfer learning concepts. As DNX layers can also be run in parallel, federated machine learning tasks can be performed on the Dynex platform.
Dynex Neuromorphic TensorFlow Layers
The Dynex Neuromorphic Torch layer can be used in any NN model. Welcome to hybrid models, neuromorphic-, transfer- and federated-learning with TensorFlow
-
Example: Quantum-Support-Vector-Machine (TensorFlow) on Dynex | Scientific background: Rounds, Max and Phil Goddard. “Optimal feature selection in credit scoring and classification using a quantum annealer.” (2017)
-
Example: Mode-assisted unsupervised learning of restricted Boltzmann machines (MA-QRBM for Tensorflow) | Scientific background: Mode-assisted unsupervised learning of restricted Boltzmann machines, Communications Physics volume 3, Article number:105 (2020)
Dynex Scikit-learn Plugin
The D-Wave quantum computer has been widely studied as a discrete optimization engine that accepts any problem formulated as quadratic unconstrained binary optimization (QUBO). In 2008, Google and D-Wave published a paper, Training a Binary Classifier with the Quantum Adiabatic Algorithm, which describes how the Qboost ensemble method makes binary classification amenable to quantum computing: the problem is formulated as a thresholded linear superposition of a set of weak classifiers and the D-Wave quantum computer is used to optimize the weights in a learning process that strives to minimize the training error and number of weak classifiers. The Dynex Scikit-Learn plugin provides this QBoost algorithm to use the Dynex Neuromorphic Platform.
2. Sampling
Samplers are processes that sample from low-energy states of objective functions. Having formulated an objective function that represents your problem (typically as a quadratic model, you sample it for solutions. The Dynex SDK provides a neuromorphic sampler to run on the Dynex platform or locally on your GPU for testing purposes.