# Can quantum transfer learning be used for multi-classification？

**URL:** https://discuss.pennylane.ai/t/can-quantum-transfer-learning-be-used-for-multi-classification/3963
**Category:** Demos
**Created:** [January 26, 2024, 1:40pm UTC](https://discuss.pennylane.ai/t/can-quantum-transfer-learning-be-used-for-multi-classification/3963 "2024-01-26T13:40:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![sunny\_chan](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/sunny_chan/32/2252_2.png) [@sunny\_chan](https://discuss.pennylane.ai/u/sunny_chan)
#### Post date: [January 26, 2024, 1:40pm UTC](https://discuss.pennylane.ai/t/can-quantum-transfer-learning-be-used-for-multi-classification/3963/1 "2024-01-26T13:40:52Z")

</div>

I tested the quantum transfer learning code provided in the [demo](https://pennylane.ai/qml/demos/tutorial_quantum_transfer_learning/), and applied it to my own data for a three-classification task. The results show that quantum transfer learning quantum transfer learning seems to classify correctly, with an accuracy of 75%.

However, I only modified the output of the linear layer to be 3(like the following code). I’m not sure if this approach is reasonable. Should I redefine the DressedQuantumNet? Such as adding the number of qubits or increasing the depth of the quantum circuit.

I have to say, quantum neural networks run very slowly on my device.

```auto
class DressedQuantumNet(nn.Module):
    """
    Torch module implementing the *dressed* quantum net.
    """

    def __init__ (self):
        """
        Definition of the *dressed* layout.
        """

        super(). __init__ ()
        self.pre_net = nn.Linear(256, n_qubits)
        self.q_params = nn.Parameter(q_delta * torch.randn(q_depth * n_qubits))
        self.post_net = nn.Linear(n_qubits, 3)

```

---

<div class="post-metadata">

### Author: ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)
#### Post date: [January 29, 2024, 9:09pm UTC](https://discuss.pennylane.ai/t/can-quantum-transfer-learning-be-used-for-multi-classification/3963/2 "2024-01-29T21:09:22Z")

</div>

Hi @sunny_chan,  
Welcome to the Forum!

Our demos are not guaranteed to work with any dataset so if you can share a self-contained version of your code (meaning something we can run and test ourselves) our team can help you better.

QNNs can be very slow if you have circuits with a lot of qubits or very deep, and they’re generally slower than classical ones in any case.

I’m not sure what your dataset is like so depending on that you will need to make different modifications.

I hope this helps you!

---

<div class="post-metadata">

### Author: ![Alok\_Kumar\_Srivastav](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/alok_kumar_srivastav/32/2850_2.png) [@Alok\_Kumar\_Srivastav](https://discuss.pennylane.ai/u/Alok_Kumar_Srivastav)
#### Post date: [September 26, 2024, 4:30pm UTC](https://discuss.pennylane.ai/t/can-quantum-transfer-learning-be-used-for-multi-classification/3963/3 "2024-09-26T16:30:15Z")

</div>

yes , i am doing same thing and its performance is better than classical

---

<div class="post-metadata">

### Author: ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)
#### Post date: [September 26, 2024, 10:50pm UTC](https://discuss.pennylane.ai/t/can-quantum-transfer-learning-be-used-for-multi-classification/3963/4 "2024-09-26T22:50:29Z")

</div>

That’s interesting @Alok_Kumar_Srivastav . And welcome to the Forum!
