You can use Gemini to generate codes of different programming languages, e.g. Java, C++, Python, Latex, etc.
You can use Gemini to generate codes of different programming languages, e.g. Java, C++, Python, Latex, etc.
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.
I ask Gemini about the KL Divergence equation in latex. And it provides a vert succinct answer.
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.
Detailed Ratings
Reply