Hey Pennylane Team,
I was just wondering what the general review time was for new demos? Maybe I’m missing a step somewhere?
Hey Pennylane Team,
I was just wondering what the general review time was for new demos? Maybe I’m missing a step somewhere?
Hi @vinayak19th, thanks for messaging us here.
Usually we start with a message here (or via an issue) indicating that you would like to write a demo. This way we can provide some guidance on how to proceed. This helps us plan for your contribution! We usually recommend that you start with a community demo, which is hosted on your own repo. You can find the community demos here.
Community demos have a few advantages:
In this case, given that PennyLane will no longer support Keras, we won’t be able to publish the demo on the main demos page, but we can indeed add it to the community demos page.
You will find the submission guidelines for the community demo at the bottom of our demo submission page. This process will require you to open an issue so we’ll get back to you on the issue once you’ve oped it.
Let us know if you have any questions about this.
Considering that many people would still love to be able to use keras, I hoped it’ll help people work it into the existing pipeline.
I’m also kinda curious if the pennylane team is still interested in contributions to the library to reintroduce keras support. Especially since the Keras 3 pipeline allows for multi-backend (TF, Torch, and JAX) training and inference.
Hi @vinayak19th ,
I agree that many people would still love to use Keras, which is why your community demo might be super valuable to many!
Unfortunately, at the moment we’re not ready to receive contributions that reintroduce Keras support. This may or may not change in the future, I really don’t know, but at the moment this introduces maintenance work that we cannot support.
Since this is valuable to you, you’re free to open a fork of the PennyLane repository and add support for it there. We just wouldn’t be able to merge it back into PennyLane, so it’s best to keep it separate.
I’ll respond regarding the community demo in the issue you opened. Thanks for opening it so quickly by the way!
Let me know if you have any follow-up questions.
Thanks for the clarifications, they’re really helpful.
Hi @vinayak19th ,
One of my colleagues had a really good idea. Your work on integrating Keras3 could make a good library/extension for PennyLane (e.g., pennylane-keras). I’m not sure if you’d like to take on this work but it would be nice to have this. Note that this would need to be hosted on a repo of your own, not on a PennyLane repo.
I ended up creating the extension/library that we were discussing. Is there any way to get this validated and/or promoted?
This is amazing @vinayak19th !
I’m checking with our team what’s the best way to promote this but one option is via a PennyLane Blog post. We have this example from a few years ago, where a professor wrote a blog post on the package they built on top of PennyLane.
That blog example is particularly long, but if you wanted to write a short blog post with a quick example of how to use your package with PennyLane, I think it could be a wonderful way of promoting your library.
Let me know if you would be up for it!
Thanks @CatalinaAlbornoz that would be great.
If it helps, I’ve already implemented the old KerasLayer tutorial (and technically still current TorchLayer tutorial) using the twin moons dataset using this new plugin with the JAX backend - pennylane-keras-layer/examples/KerasCircuitLayer_example.ipynb at main · vinayak19th/pennylane-keras-layer · GitHub
That’s great @vinayak19th !
And it’s great that you added these to your repo.
For the potential PennyLane blog post it’s better to have a smaller example though. Something like one of the quickstart examples you have on PyPI.
Since you’re interested in the blog post, the next step is to align on the outline. Basically, what’s the story that the blog post wants to tell? And what are the key elements of that story?
Take your time to think about this and share it here when you’re ready.
I’ll check with our team here to see who would have capacity to review and guide you along the process. I should be able to have this info sometime next week.
Let me know here if you have any questions on the process or on what we’re looking for!
Would a simple tutorial with dummy data be perfect for this? Basically just the pip install, creating a random qnode, wrapping it into keras and doing model.fit and model.save/model.load be enough?
Also I was curious, the issue with introducing this into pennylane earlier was not wanting to support the tensorflow backend, I wonder if trying to mainline this into pennylane for jax and torch specifically be useful. It seems functionally identical to the TorchLayer right now and has the additional benefit of integrating with jax and jax.compile. Since keras 3 integrates with flax models as well it would introduce a simpler path to hybrid QML with JAX.
Hi @vinayak19th ,
Regarding your first question, yes, a tutorial with dummy data would be perfect! The steps that you mentioned seem like a good flow for a blog post.
Regarding your second question, can you please clarify what the question or suggestion is? I’m not sure I’m fully understanding it.
This is the demo code.
Regarding the 2nd part it was more about pushing this into the main pennylane library for the jax and pytorch backends
Thanks for sharing the demo @vinayak19th !
For a blog post it’s important to focus on the “story” that you want to tell. The written sections are key! I would recommend creating an outline as the next step.
Regarding the contribution into PennyLane for the JAX and Torch backends, thanks for offering to contribute! It’s wonderful to see this initiative. I’ll add this to the queue for our team to review. We may take a few weeks to come back with next steps (we’ve just got some core things to prioritize at the moment) but we will get back to you on this.