Git Product home page Git Product logo

qc-cnn's People

Contributors

christorange avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

qc-cnn's Issues

运行的相关问题

老哥

运行项目的时候 Devices是不是不能选择cuda
我看选用cuda后 optimizer.step()那边报错:
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cuda:0 and cpu!

量子微分是不是目前不能在gpu上 【基于pennylane】

inception.py

老哥我又来了 我有个新问题

我有读Hybrid quantum-classical convolutional neural networks这篇论文
Hybrid QCCNN. The input demonstrated here is a two-dimensional array, which is sent to a quantum convolutional layer of 6
filters. 这个多个滤波器的概念如果要实现应该怎么修改呢 因为我看现在数据的通道数是从1变到N量子位 且受限于量子位(虽然量子机器学习的优势就是减少参数数量 但我总感觉用一个量子电路会不会不够) 正常我们Conv2d会有输入输出的通道数 也就是说滤波核是三维的(+通道) 我看现在您复现的QCCNN里面好像不是 我看其他复现QCCNN的好像也没通道这个概念 我不清楚我这样理解是否正确 希望能够得到您的指导

非常感谢
Pengl

I have some questions

Thanks you for you make this code, is very good for me understanding.

Here:
https://pennylane.ai/qml/demos/tutorial_quantum_transfer_learning.html

@qml.qnode(dev, interface="torch")
def quantum_net(q_input_features, q_weights_flat):
    
    # Reshape weights
    q_weights = q_weights_flat.reshape(q_depth, n_qubits)

    # Start from state |+> , unbiased w.r.t. |0> and |1>
    H_layer(n_qubits)

    # Embed features in the quantum node
    RY_layer(q_input_features)

    # Sequence of trainable variational layers
    for k in range(q_depth):
        entangling_layer(n_qubits)
        RY_layer(q_weights[k])

    # Expectation values in the Z basis
    exp_vals = [[qml.expval](https://docs.pennylane.ai/en/stable/code/api/pennylane.expval.html#pennylane.expval)([qml.PauliZ]

(https://docs.pennylane.ai/en/stable/code/api/pennylane.PauliZ.html#pennylane.PauliZ)(position)) for position in range(n_qubits)]
return tuple(exp_vals)
He make use of reshape weights, but your code no make use. Why? Whts is difference?

Also here:
https://github.com/christorange/QC-CNN/blob/6f498d25de4187b730f7b146ad691e95520ed2d9/models/single_encoding.py#LL36C4-L42C43

 x_lst = []
for i in range(0, x.shape[2]-1,2):
    for j in range(0, x.shape[3]-1,2):
        x_lst.append(self.ql1(torch.flatten(x[:, :, i:i + self.kernel_size, j:j + self.kernel_size], start_dim=1)))
x = torch.cat(x_lst,dim=1)  # .view(bs,n_qubits,14,14)

What is the prupose of x_lst and make loop after? I no understand.

If want make process 64x64 image, what change neem make?

Thanks you and sorry for bad english.

How to do it for custom dataset

Hi @christorange ,
You have done a fabulous work. I would like to run on my custom image dataset where image size is quite larger 416x416. But if i convert to csv its very large, can you please help me to execute in such configuration.

博主你好,我想问一些问题

因为最近导师给的方向是经典神经网络加一点量子,那么对于传统的目标检测,比如ssd算法的话,我现在想的是将传统的2d卷积换成量子卷积,但是我觉得因为输入会很大,比如对一个3030256的输入进行量子卷积,输出成1515256的,使用量子卷积的话,可以实现出来嘛

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.