X

Gemini for Programming

You can use Gemini to generate codes of different programming languages, e.g. Java, C++, Python, Latex, etc.

Prompts

1

implement self attention layer in transformer in python code using pyTorch package

Reviews

Tags


  • wilsonz1989 2024-09-03 18:19
    Interesting:3,Helpfulness:3,Correctness:4
    Prompt: implement self attention layer in transformer in python code using pyTorch package

    Overall, Gemini did a good job though not optimal in the pytorch model coding test. I asked the same question on ChatGPT vs Gemini vs Claude. Among all these three platforms, Gemini‘s python code is correct but less concise. It also uses some unusual functions of pytorch package, such as """ context.permutate(0, 2, 1, 3).view(...) """. This is just a weighted average tensor operation, so this implementation is very uncommon and not necessary. And ChatGPT and Claude use the correct function for this operation, which is """ torch.einsum().reshape() """. Even though it's not a big deal, but generating common python code in Gemini is not optimal.


  • Joseph Davis 2024-06-19 00:46

    I ask Gemini about the KL Divergence equation in latex. And it provides a vert succinct answer.


  • wilsonz1989 2024-06-19 00:43

    To Implement a QuickSort in python. Gemini provides a quite reasonable answer, without introducing too much backgrounds and other less relevant information. So I will give it an overall 4 stars rating.

Write Your Review

Detailed Ratings

ALL
Correctness
Helpfulness
Interesting
Upload Pictures and Videos