-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] initial version of classifier and regressor #13
Conversation
Please make sure all files here have the required copyright header in them - this includes the init files too. |
from ...exceptions import QiskitMachineLearningError | ||
|
||
|
||
class Loss(ABC): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need a whole package for one file. If these were all in separate files I could see it. But with everything in one file I would have a thought a loss_functions.py file directly in utils would have sufficed. Unless there is some view to future expansion that would see more coming to this loss_functions folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. it is our plan to add more loss in this folder.
…rning into batches � Conflicts: � qiskit_machine_learning/neural_networks/circuit_qnn.py � qiskit_machine_learning/neural_networks/opflow_qnn.py � test/neural_networks/test_opflow_qnn.py � test/neural_networks/test_two_layer_qnn.py
2) add VQR
2. fit, predict and score functions were removed from VQR
# Conflicts: # docs/tutorials/02_neural_network_classifier_and_regressor.ipynb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
* initial version of classifier and regressor * update structure * fix l1 and l2 losses * clean imports * add `dense` to QNNs and update NNClassifier/Regressor * shelved changes * batching * more on batching * more on batching * more on batching * consistent batching * some spelling * add copyright * some docstrings. * fix some lint errors * add unit tests and fix output shape * fix circuit qnn tests * fix typing * fix typing * more batching * more batching * Update circuit_qnn.py * Update opflow_qnn.py * use sparse probability gradients in case of sample based evaluation * update neural network classifier * fix style/spelling/mypy * fix tests * Update neural_network_classifier.py * more batching * removed duplicate code * gradients reshaping and more tests. * fix circuit QNN tests * fix typing * add batching logic to `sample()`, `probabilities()`, and `probability_gradients()` * fix lint * add gradients for circuit QNN classification + tests * add initial draft for VQC * gradient tests. * add tests with cross entropy * fix lint, style, mypy * cross_entropy gradient added * add cross entropy test with gradients * fix style, spell * removed _sample double definition * make a clean git mv instead of just renaming (1) * make a clean git mv instead of just renaming (2) * add vqc + test * update vqc and tests * update tutorials * cross_entropy sigmod, softmax, softmax_stable added * cross_entropy sigmod, softmax, softmax_stable added * cross_entropy sigmod added to NN classifier * cross_entropy and sigmod_cross_entropy has been changed to "CrossEntryLoss" and "CrossEntropySigmodLoss" in both classifier and regression; initial version of NN regressor * fix loss + minor changes * revert changes in raw_feature_vector as non-required. * minor fixes * Update 02_neural_network_classifier_and_regressor.ipynb * Update 02_neural_network_classifier_and_regressor.ipynb * use given gradient in circuit qnn * remove double output_shape handling * style, lint * update tutorial to use regressor * fix mypy * merged with new RawFeatureVector, some tests fail * fix test randomness, disable some of test_raw_feature_vector * One hot encoding has been removed from NNregression * randomness, tests * fix tutorial * fix tutorial * fix vqc test with bfgs and qasm simulator * fix raw feature vector tests * import fix * Update 02_neural_network_classifier_and_regressor.ipynb * test neural network regressor * 1) 1 bug in NNregressor has been fixed 2) add VQR * revert notebook to python 3 * 1. VQR updated with TwoLayerQNN 2. fit, predict and score functions were removed from VQR * new readme test, fix style, lint * updated vqc notebook, refactored readme test * update circuit QNN to remove final circuit measurements for gradient * remove old tutorials * update TwoLayerQNN and VQR to use default feature map and var form * update init files * update NNC/NNR tutorial (02) * update vqc and vqr * Update 02_neural_network_classifier_and_regressor.ipynb * fix lint, mypy * Update 02_neural_network_classifier_and_regressor.ipynb * added test_vqr.py * updated readme Co-authored-by: Stefan Woerner <WOR@zurich.ibm.com> Co-authored-by: Anton Dekusar <adekusar@ie.ibm.com> Co-authored-by: Manoel Marques <Manoel.Marques@ibm.com>
Summary
Details and comments