4 ms·
I thought I'd make this blog post be language-agnostic, but agreed that a Python-specific version would be helpful. Here's where I calculate cosine without num
by pamelafox 1y ago
I thought I'd make this blog post be language-agnostic, but agreed that a Python-specific version would be helpful.
Here's where I calculate cosine without numpy:
https://github.com/pamelafox/vector-embeddings-demos/blob/main/similarity.ipynb https://github.com/pamelafox/vector-embeddings-demos/blob/ma...
And in the distance notebook, I calculate with numpy:
https://github.com/pamelafox/vector-embeddings-demos/blob/main/distance_metrics.ipynb https://github.com/pamelafox/vector-embeddings-demos/blob/ma...
I didn't use the @ operator! TIL.
I forget where I originally got the Disney movie titles, but it is notably just the titles. A better ranking would be based off a movie synopsis as well.
Here's where I calculated their embeddings using OpenAI:
https://github.com/pamelafox/vector-embeddings-demos/blob/main/prep_openai.ipynb https://github.com/pamelafox/vector-embeddings-demos/blob/ma...
Maybe I can submit a poster to Pytorch that would include the Python code as well.